Welcome to WebmasterWorld Guest from

Forum Moderators: incrediBILL

Message Too Old, No Replies

html5 pseudo div

making new elements a div in older browsers

3:38 pm on Oct 31, 2012 (gmt 0)

Preferred Member

5+ Year Member

joined:Dec 19, 2007
posts: 404
votes: 0

trying to put together some css that will give html5 elements div properties in older broswers.

.nav { display:block; margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit;vertical-align: baseline;}

but it helps some elements and not others. Am i missing something to add to the properties?
9:48 pm on Oct 31, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

joined:Apr 9, 2011
votes: 244

Is .nav a class or an element? If it's a class, as the leading . implies, you also have to look at the elements you apply it to, and make sure your css overrides those elements' properties. (Hint: If you are using !important you are doing it wrong.) So not just
but also
p .nav
li .nav
p#superimportantheading .nav
and so on depending on your specific circumstances.

General principle: if you ever need
element1.class1 (for example "td.foobar")

to override
element2.class2 element1 (for example "tr.widget td")

make sure you include, by name,
element2.class2 element1.class1 ("tr.widget td.foobar")
12:06 am on Nov 1, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:May 23, 2005
votes: 0

All browsers implement the html5 elements except IE8 and under so you shouldn't have to do this. If you want to cover those browsers, too, Google for "html5shiv".

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members