If i add DOCTYPE at top of the html document, some css does not work. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> HTML: <td class="leftmenu" style="padding-left:12;"> HTML: style="padding-left:12; does not work. What is the problem. what i am doing wrong here. Please help
Don't know if it is the problem but shouldn't the unit be in a unit of measure. I mean shouldn't padding-left: 12; be padding-left: 12px;
<td class="leftmenu" style="padding-left:12px;"> HTML: is correct. you must declare px for pixels in css. This would not be correct in html <td width="300px"> HTML:
Doctypes are NEVER to be added as an afterthought but the very first thing to go on a page before anything else. Also, new web pages have NO need for transitional. ALWAYS use strict.
OMG!!! The "px" had NOTHING to do with your DOCTYPE... All pages should have a WELL THOUGHT OUT DOCTYPE. LISTEN TO THE DOCTOR!! ^^^^^^^^^^^^^
As stated before, I'm just reiterating to beat a dead horse. Doctype had nothing to do with why CSS wasn't working, css wasn't working because no unit of measurement was declared. Doctype is used for validation purposes. It tells the browser what version of coding you are using, that is all.
Actually, yes it does! In quirks mode, when you aren't using a doctype (and no one should ever be in quirks mode), lack of a dimensional unit always meant px.
Hey you learn something knew everyday. Thanks for that info. So common place now days to include doctype, quirks mode fell off the wayside.
Quirks mode came about because Microsoft screwed up Internet Explorer and didn't implement the box model properly. It's the ONLY reason we have to use doctypes at all! So the browser can tell whether you're trying to implement layout properly and not Microsoft's way. Without Microsoft's F-up, there would be no quirks mode and no need for doctypes.
Without Microsoft there wouldn't be a need for a lot of the crap that we have to do for it to display properly