p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   CSS Cascading Style Sheets (http://p2p.wrox.com/forumdisplay.php?f=146)
-   -   How can I stop <DIV> tag wrapping (http://p2p.wrox.com/showthread.php?t=54144)

sinkalanick February 16th, 2007 06:03 AM

How can I stop <DIV> tag wrapping
 
Hi,

I am using the <DIV> tag to create a triangle-shaped image. I want this triangle and the text before it to be on the same line. How can I stop this wrapping? See the HTML code that is doing this:

Thanks,
Niq.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title>Untitled</title>
</head>
<body>
<table>
<tr align="center" valign="top">
   <td width="100%" valign="bottom">THE TRIANGLE BELOW NEED TO BE ON THE SAME LINE AS THIS TEXT<div style="border-bottom: 12px solid #006600;border-left: 7px solid #ffffff;border-right:7px solid #ffffff;font-size: 0px; line-height: 0%; width: 0px;"</div></td>
</tr>
</table>
</body>
</html>



mat41 February 18th, 2007 09:16 PM

You have not closed of your opening div tag, Change:
0px;"</div></td>
To
0px;"></div></td>

Why create an arrow this way? It will appear pixelated in the browser and is very browser dependant. Using an image will make your page much more portable not to mention eliminate these issues. However if you must, change your div tag to a span tag.

Wind is your friend
Matt

sinkalanick February 19th, 2007 06:38 AM

Thanks Matt. <SPAN> has done the trick!


mat41 February 19th, 2007 09:16 PM

Glad to help :0)

Wind is your friend
Matt


All times are GMT -4. The time now is 09:30 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.