View Full Version : PHP CSS W3.org

08-20-2007, 05:22 PM
I have a blog and on the main page of my site off to the side i have my most recent post. I use a loop to display the blogs. I display 5 blogs total on the page and each blog has 3 items date, title, blog each in different div tags. The problem Im having is validating my HTML since w3 validation doesnt like you to have the same id for 2 divs the only way ive come up with an idea is to copy and past the div tag css and give it a name 1-5 then use a loop to place the number at the end of a div.


date 1 gets id 1
date 2 gets id 2
date 3 gets id 3 ect.

and the same for title and blog.

or is there another way?


i dont want the entire blog to be displayed. Im using longtext in my database for the blog but is there a query i can do that will only display say 5 or so words. Just supposed to be a teaser.


08-20-2007, 07:01 PM
Unless those ID's needs different CSS, just replace the ID with a CSS class.

Old HTML: <div id="something">
Old CSS: #something {}
New HTML <div class="something">
New CSS: .something {}

08-20-2007, 07:09 PM
alright alright ill try jeez :p

thanks man

08-20-2007, 08:09 PM
oops some duplicate posts there, sorry 8) I'll remove them