you don't need anything around the image or the paragraph... .outer img {float:left;} .outer p {float: right;}
If you want white space, you can apply margins, padding, borders, etc, just like you would if they were a div. But you can apply them directly to the img and p elements without needing any parent container. ---Tim > -----Original Message----- > From: css-d-boun...@lists.css-discuss.org [mailto:css-d- > boun...@lists.css-discuss.org] On Behalf Of John > Sent: Wednesday, November 17, 2010 2:54 PM > To: css-d@lists.css-discuss.org > Subject: Re: [css-d] Is this proper use of div tags? > > On Nov 17, 2010, at 11:25 AM, G.Sørtun wrote: > > > > Your example looks like a clear case of "divitis" - meaningless > > overuse of divs. > > > > The following... > > > > <div class="outer"> > > <h3>Title</h3> > > <img src="image_1.jpg"> > > <p>descriptive text</p> > > </div> > > > > ...would be a better and more meaningful source-code, and the use > of > > class="outer" instead of ID is more correct for repeated blocks in > > same page. No problem with ID on "outer" if you're creating a new > page > > for each such block though. > > > > > Heh.."divitus"...I was afraid of that! Well, in your example then, would > I need to throw a tag around the <img src> tag to indicate image > position (float, etc) and I guess my <p> would also need that, as I want > to control where these things sit. Basically, I want to control the space > around both image and text, plus make my image top- align with that > text. > > I haven't played around with your suggestion yet, but I am about to..I > wanted to send off this question right away. > > Many thanks! > > John > ______________________________________________________ > ________________ > css-discuss [cs...@lists.css-discuss.org] http://www.css- > discuss.org/mailman/listinfo/css-d > List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- > http://css-discuss.org/policies.html > Supported by evolt.org -- http://www.evolt.org/help_support_evolt/ ______________________________________________________________________ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/