When I add: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> to my page, which has messed up the orientation of certain items on my webpage. I managed to manually fix a few of the simpler items, but unable to fix more of the more complicated ones. I feel like all this could be prevented, asI don't see why adding this tag would mess up any of the styling I have done on the site. Is there a way to include this tag, without interfering with the orientation and layout of objects on the site.
XHTML 1.0 Strict is most likely causing your problems, while it is the web standart some thing cant be used, try "XHTML 1.0 Transitional" instead. While it is nice to have a validated page which is up to standarts, in my opinion functionality goes above validation. Ofc can you layout properbly be fixed using strict as well, but for that we need to know what is actually displaying not correctly
Thank you so much for that. I'm not too experienced with web development so wasn't sure what the different doctypes were. I'm okay with using a transitional doctype as opposed to a strict doctype, since my site is a simple portfolio site for myself.
@dpatel, Basti's reply is nothing but pure crap and you need to ignore everything he said. The reason your page changed after you added the doctype is because the doctype is the set of rules you are telling the browser you are following when you created the page. No doctype means you are in quirks mode. With a doctype puts you in standards mode. Change the rules and your page changes along with it. The doctype is the very first thing that goes on every page. It is NEVER an afterthought. In addition, NO new web page has any business using transitional over strict. Transitional doctypes are for pages that contain deprecated (old) markup that's being transitioned to current (modern) markup. Since you should never be using deprecated markup, you should never be using the transitional doctype. And for people like Basti who think functionality over standards is more important, consider this: standards ARE the functionality of browsers and the web! The browser vendors make those standards and follow them as they make the browser. If they follow them, shouldn't you? People like Basti don't know how to do that so they start forcing things and hacking away till they somehow make it work and jump up and down "Look what I done did!!!". If you want your markup to work across all modern browsers, write standard markup and follow the rules.
basti was absolutely correct strict tightens things up a bit. us transitional instead <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Code (markup):
More from the clueless crowd. Strict does NOT tighten ANYTHING up! At least nothing you would know about and definitely wouldn't understand. Essentially, it's for the sake of the validator while the browser does NOT treat the markup any differently. When you don't know what you're talking about, don't respond!
LOL, why you bitch around? think you are the smartest? we dont know his errors, so i simply suggested to change the doctype, since the sctrict tag seem to mess his page up he mostly coded "transitional", if chaging fixes his display errors thats fine, if not can be fixed using strict as well. I myself run a "newly" created website with transitional, on certain things is much more enjoyable than strict. Tell me what you want, but my transitional coding looks the same in every browser. and that count more to me and properbly many others than brutally force yourself to use strict. I didnt said strict is bad thing or not to use it or things cannot be archieved using it, sometimes its simply easier, especially for people new to these things like (maybe) the OP People like you love to mess, iam totally sick of those Well, over and out from me. you would never stop arguing anyway, since this is what you are here for. BB
I always use transitional. There is no doubt that you should be using a doctype. I don't think strict is necessary, in spite of what dr howard up there says
Because you advocate not following standards, using deprecated markup and not validating. I only know I'm smarter than you. His first error would be listening to you. How do you know this? Or are you just guessing cause he never said that You said use transitional cause it might work better than strict. It won't. Absolutely false! Absolutely false! I'm trying to help the OP. You are giving a disservice by giving false information and making him, and others, more confused when what you are saying proves to be false.
Ok, as i guessed the bitching continue, but well think what you want. Didnt i said i dont want to discuss this? hmm, was the last post. this discussion of ours is not helping the OP in any way, should be continued in pm if needed, we both stated our points. Seb
There's nothing to discuss and leaving now will only confuse him. Perhaps the W3C will enlighten you: Or how about one of the HTML Working Group members. Maybe you'll learn something.