Jump to content

div wraps another div


otuatail

Recommended Posts

Maybe I didn't understand your question. I attached how yours looks and how mines with my code. Let me know if this is what you mean

 

<div style="border: 1px dashed rgb(119, 0, 0); width: 450px; overflow: hidden;">
<div style="float: left; width: 130px; border-width: 1px; height: 30px; font-size: 27px; color: red;">News Flash</div>
<div style="float: left; width: 318px; border-width: 1px; height: 90px; padding: 0px 2px;">This is a sample line to show how text within a floting div can wrap another div. This is a sample line to show how text within a floting div can wrap another div.</div>
</div>

 

[attachment deleted by admin]

Setting the overflow to hidden would just hide the text that doesn't fit. That usually won't make sense.

 

To wrap text around other text you can do this:

 

<div id="container">
  <h2>News Flash</h2>
  <p>Nullam vel elit in urna pulvinar adipiscing. Nam sapien diam, pretium sit amet dictum sed; placerat eu est.</p>
</div>

 

h2
{
float:left;
}

 

With this code, the text in the <p> tag will wrap around the text in the <h2> tag.

I thought I had made it clear about text wrapping, obviusly not. If you read a newspaper you would understand. What I wanted in

http://www.des-otoole.co.uk/breakingnews.php was

 

News Flash  This is a sample line to show how text within a

                    floting div can wrap another div. This is a sample

line to show how text within a floting div can wrap another div.

 

This means in my link lines 3 and 4 go underneith the red text. An example of text wrapping. Used in Microsoft office as well.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.