Click to See Complete Forum and Search --> : Divs.


AntonioMainenti
01-24-2003, 08:50 PM
What I want to do is create divs within divs, like this:

<div class="a">
Blah blah <div class="b">blah</div> blah <div class="b">blah</div>.
</div>

And I want it all to be on one line, but the browser creates a <br> before and after every class "b" div.

Thanks, Alan.

Stefan
01-24-2003, 09:38 PM
Originally posted by AntonioMainenti

<div class="a">
Blah blah <div class="b">blah</div> blah <div class="b">blah</div>.
</div>


Since I assume you are doing this to be able to target your class="b" with CSS, you can further optimize the solution by eg


<span class="a">Blah blah <span>blah</span> blah <span>blah</span>.</span>

And then target it with
span.a span {your-rules}

That means "a span that is a child of a span of class=a"

Ie, you can compleatly eliminate the need of class=b both in the CSS and the markup reducing the bloat :)