Viewing 4 replies - 1 through 4 (of 4 total)
  • I don’t think it’s possible to do automatically because that’s the way CSS floats work. You could use this hack though:

    <p class="lab_tweetme" style="width:300px;">highlight content</p>

    Thread Starter Tom Ewer

    (@tomewer)

    Hi blogjunkie,

    Thanks for the suggestion. Whilst that would work for now, it wouldn’t be future proof (e.g. if at some point in the future I increased the content width, the box would be too narrow). Any other ideas?

    I thought that there would be a relatively straightforward answer – something along the lines of floating one element to the right, the other to the left, and instructing the div to fill the gap?

    Thanks again!

    Tom

    Yes, it’s not future proof. You won’t be able to do it the way you envision unless the markup is changed. The problem is that you have a markup like this:

    <div class="entry">
        <div class="wp-caption alignright">...</div>
        <p class="lwb_tweetme">...</p>
        Your content...
    

    You’d need your content to be in a div of it’s own to achieve a layout like that. So.. sorry, no easy answer for what you want to my knowledge. I’ve struggled with this problem myself too :/

    Thread Starter Tom Ewer

    (@tomewer)

    Are you saying that if I change this:

    <p class="lwb_tweetme">...</p>

    to this:

    <div class="lwb_tweetme">...</div>

    I can get it to work in the way that I want? If so, that wouldn’t be a problem – it’d only take 10-15 mins to change the old <p>’s, and I could just use divs in the future.

    Thanks again! ??

    Tom

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘CSS Div Width’ is closed to new replies.