Divs.

liunx

Guest
What I want to do is create divs within divs, like this:<br />
<br />
<div class="a"><br />
Blah blah <div class="b">blah</div> blah <div class="b">blah</div>.<br />
</div><br />
<br />
And I want it all to be on one line, but the browser creates a <br> before and after every class "b" div.<br />
<br />
Thanks, Alan.<!--content-->Originally posted by AntonioMainenti <br />
<br />
<div class="a"><br />
Blah blah <div class="b">blah</div> blah <div class="b">blah</div>.<br />
</div><br />
<br />
<br />
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<br />
<br />
<br />
<span class="a">Blah blah <span>blah</span> blah <span>blah</span>.</span> <br />
<br />
And then target it with<br />
span.a span {your-rules}<br />
<br />
That means "a span that is a child of a span of class=a"<br />
<br />
Ie, you can compleatly eliminate the need of class=b both in the CSS and the markup reducing the bloat :)<!--content-->
 
Back
Top