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]

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.