Forum Moderators: phranque
I have a few questions.
Q.1. I was wondering if i built up pages with the extension .htm and then have one page with the extension .html (home page) does it matter?
>Any problems with doing that? Will it still work ok?
>>**Or should i change them all to one extension?
(I have a main page that states it is:
<doctype... xhtml 1.0 transitional>
the rest of my pages are not.)
Q.2. Do i use the <doctype html... html 4.1...transitional>
for the rest if they are not xhtml standards?
Q.3. Also i've read that people should start learning
how to code using xhtml. Is that really necessary?
Q.4. If i don't start coding my pages with xhtml, will i need to change them in the future? I have
read that xhtml will replace html in the future.
Q.5. If i don't change them now, will the pages be affected later by browsers not being able to display them because of the replacement of html with xhtml?
Q.6. If i have some html tags such as the <img> tag,
should i add the closing forward slash even if my
pages are not totally xhtml?
Q.7. Will this work for or be *valid* for closing the tag if i use the:
<doctype html....blahblah...transitional...>
at the top of the webpage?
*Example of <img> tag:
<img src="abc.jpg" alt="..." />
Please answer each question:)
Thank you very much for your help.
frenzy77
q2: yes
q3: yes
q4: maybe. presumably if you use a depreciated doctype, you can continue using "old-style" HTML. However there is no promise and we can't assume that new devices (PDAs, cellphones) will support old quirks
q5: probably not. new browsers will still want to be able to display pages made in the 1990s - see q4
q6: can't hurt, so why not?
q7: yes
If you're using strict, well then that's another ball game.
But you know, you only have to close your tags if you want your document to validate. I recently changed a whole site to STRICT just to make my CSS positioning problems go away. I didn't go through every page and end all my <br>s.
though some day when I have the time, I will. :)
I know those pages won't validate by W3C standards, but now they render identically in all browsers without any "quirks". No browser I know of will crash if your <p>s don't have </p>s
So until you're a CSS superstar, I'd say go for transitional. If you want your page to validate, you'll just need to add the ending tags to your elements as previously mentioned and make sure you specify alt tags for everything.
Good luck.