View Full Version : Keeping html and formatting apart


Merike
11-20-2004, 05:35 PM
Right now my blog looks like that:

<div class="title">Blog</div>
<p><div class="title">Date</div>
Entry</p>
<p><div class="title">Date</div>
Entry</p>

The problem is that it won't validate. It can't stand <div> in <p>.
But if I move <p> after <div> then there will be empty line between date and entry which I don't want.
I was thinking of joining date and entry into one <p> without a div. Then I could put <b> tags around date but I don't want formatting in html. So, how can I have date formatted with css as I now have with class?

COBOLdinosaur
11-20-2004, 06:54 PM
<div class="title">Blog</div>
<p><span class="title">Date</span>
Entry</p>
<p><span class="title">Date</span>
Entry</p>

Merike
11-20-2004, 07:12 PM
That's exactly what I needed. I remember there was smth similar to <p> but <span> didn't across my mind.
Thank you.

Monkey Bizzle
11-21-2004, 02:34 AM
just wondering but if your date, title and entry are all formatted using the class for title, then why not just put the whole thing in a span or div tag... just wondering...