If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Display: Block vs. Inline

So I think I have a basic understand of how the display parameter works in CSS. However, I guess I'm not doing it right.

Here's my example: http://www.daily-chronicle.com/test2/
I have a main div and then a div for the article and a div for the photo. I have the main div set up a block, and the other two sub divs as inlines. One would think that it'd work but it doesn't.

Sometimes there won't be a photo, which is why I need the story to expand across the page when there isn't and not be in a specified width (as I had it before).

I've tried every combination out there too (no block div, only one inline div, etc). and I still haven't figured it out.

what coding language do you want this is? basically what you want is to determine whether the picture is present for the article and it it is then float the image to the right of the article, but until we know what language you would like to accomplish this in, we cannot help you. PHP/ASP/Javascript/.NET

you can use css regardless, but judging from your response I am going to assume that this is just a regular html/htm file, which means that you are hand coding all of the content into the page... so what you could do is assign a CSS class to the articles that have an image, and a general CSS style to the articles.

<!-- NewSys(TM), version 3.40.0, Copyright TownNews.com(C) 2002-2005, on web28.ch2.l3.sys.townnews.com -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<base href="http://www.daily-chronicle.com/" />
</head>
<body>
<div class="topstory" style="height:210px;">
<div class="article" style="float:left;width:600px;">
<span class="frontheadline"><a href="/articles/2008/02/29/test2/news02.txt">Towing Toil </a></span><br />
<span class="frontstory">Tracey Falk couldn’t see the car. Falk was called during a January 1979 blizzard that hit the DeKalb County area with about 17 inches of snow — and that was on top of the nearly 15 inches already on the ground from past storms, according to the National Weather Service. A car was stuck on the side of Shabbona Road, on the north end of the village of Shabbona, he said.<br /><br />Falk, who has worked in towing for about 30 years, said he got out of his tow truck right where the caller said he would be — only there wasn’t a vehicle in sight, he said.</span>
<a href="/articles/2008/02/29/test2/news02.txt">More of this story</a></div>
<div class="photo"><script type="text/javascript" src="/shared-content/newsys/common/photo.js"></script><a href="javascript:thumbnailWindow('/articles/2008/02/29//test2//news02.img', 400, 243)"><img alt="Thumbnail" border="0" src="http://images.townnews.com/daily-chronicle.com/content/articles/2008/02/29//test2//news02_thumb.jpg"></a></div>
</div>
</body>
</html>