eduard Posted November 11, 2010 Share Posted November 11, 2010 Who can explain to me how I add a DOCTYPE to my html document? Link to comment Share on other sites More sharing options...
niche Posted November 11, 2010 Share Posted November 11, 2010 http://www.w3schools.com/tags/tag_doctype.asp Link to comment Share on other sites More sharing options...
dink Posted November 11, 2010 Share Posted November 11, 2010 Who can explain to me how I add a DOCTYPE to my html document?The doctype declaration should be the very first thing in an HTML document, before the <html> tag.The doctype declaration is not an HTML tag; it is an instruction to the web browser about what version of the markup language the page is written in.The doctype declaration refers to a Document Type Definition (DTD). The DTD specifies the rules for the markup language, so that the browsers can render the content correctly.This is a great place to start DocType Infodink Link to comment Share on other sites More sharing options...
eduard Posted November 11, 2010 Author Share Posted November 11, 2010 The doctype declaration should be the very first thing in an HTML document, before the <html> tag.The doctype declaration is not an HTML tag; it is an instruction to the web browser about what version of the markup language the page is written in.The doctype declaration refers to a Document Type Definition (DTD). The DTD specifies the rules for the markup language, so that the browsers can render the content correctly.This is a great place to start DocType InfodinkI am sorry, but it isn¨t! In this example they use url (like all other examples!) and my document is´nt yet! Link to comment Share on other sites More sharing options...
Synook Posted November 11, 2010 Share Posted November 11, 2010 Try not to create too many threads, or else people will just get confused - for example, from your thread here it would appear you got your DOCTYPE markup declaration working. At least modify the thread title to indicate it's solved.Anyway, the URL specified in the DOCTYPE is the location of the DTD (in this case, the HTML or XHTML one), and not the location of your website. Link to comment Share on other sites More sharing options...
gabrielebr Posted November 11, 2010 Share Posted November 11, 2010 Who can explain to me how I add a DOCTYPE to my html document?if you haven't time to learn how to write the doctype declarations perhaps you can visit other websites (more than one...) and view the source.What you should add at the beggining of your pages is what you find BEFORE the </head> tag. But be careful because there could be more than what you need and there could be some reference to something that you don't have in you web site (css file, for example).for example the code of this page (http://www.w3.org/QA/2002/04/valid-dtd-list.html) is like this:<!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" xml:lang="en" lang="en"> <head><meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>W3C QA - Recommended list of Doctype declarations you can use in your Web document</title> <meta name="Keywords" content="qa, quality assurance, conformance, validity, test suite, QA, quality, validation, html, validator, tools" /> <meta name="Description" content="W3C QA - List of valid Doctype declarations you can use in your document" /> <link rel="schema.DC" href="http://purl.org/dc" /> <meta name="DC.Subject" lang="en" content="QA, quality, validation, html, validator, tools" /> <meta name="DC.Title" lang="en" content="How to achieve web standards and quality on your website?" /> <meta name="DC.Description.Abstract" lang="en" content="A series of things to improve and achieve quality on your website." /> <meta name="DC.Date.Created" content="2002-04-08" /> <meta name="DC.Language" scheme="RFC1766" content ="en" /> <meta name="DC.Creator" content="Karl Dubost" /> <meta name="DC.Publisher" content="W3C - World Wide Web Consortium - http://www.w3.org" /> <meta name="DC.Rights" content="http://www.w3.org/Consortium/Legal/copyright-documents-19990405" /> <style type="text/css" media="all"> @import "/QA/2006/01/blogstyle.css"; </style></head>gabriele Link to comment Share on other sites More sharing options...
Synook Posted November 11, 2010 Share Posted November 11, 2010 Err, you don't really have to add everything you see in the <head> element of a document - the only required sub-element is <title>. Link to comment Share on other sites More sharing options...
eduard Posted November 11, 2010 Author Share Posted November 11, 2010 Thank you for all your answers about a DOCTYPE, but I still don´t know what do I have to write in my HTML document! Link to comment Share on other sites More sharing options...
thescientist Posted November 11, 2010 Share Posted November 11, 2010 Thank you for all your answers about a DOCTYPE, but I still don´t know what do I have to write in my HTML document!what are you talking about? and why are you making a new thread for this exact same topic? yessh....don't you have a webpage already made that you've been asking us about? What else are you looking for? didn't you get links for making a doctype? I believe I gave you an example of one in that thread; it's right in my signature. Link to comment Share on other sites More sharing options...
eduard Posted November 11, 2010 Author Share Posted November 11, 2010 what are you talking about? and why are you making a new thread for this exact same topic? yessh....don't you have a webpage already made that you've been asking us about? What else are you looking for? didn't you get links for making a doctype? I believe I gave you an example of one in that thread; it's right in my signature.Thanks! I have seen this topic several times, but in the examples they use URL´s and I need a DOCTYPE for my html document! Link to comment Share on other sites More sharing options...
thescientist Posted November 11, 2010 Share Posted November 11, 2010 Thanks! I have seen this topic several times, but in the examples they use URL´s and I need a DOCTYPE for my html document!that's what they are. just use it and try it. Link to comment Share on other sites More sharing options...
niche Posted November 11, 2010 Share Posted November 11, 2010 As I implied in your last topic, on this subject, do the tutorial and all will be answered guaranteed.http://www.w3schools.com/tags/tag_doctype.asp Link to comment Share on other sites More sharing options...
eduard Posted November 11, 2010 Author Share Posted November 11, 2010 I have put a DOCTYPE, but my website looks horrible! Link to comment Share on other sites More sharing options...
jeffman Posted November 11, 2010 Share Posted November 11, 2010 This often happens when developers design a page with no doctype and then add one AFTER they design the page. Browser manufacturers have agreed that pages with no doctypes should be rendered in the way it would have been rendered when HTML was new, way back in the 1990's. If you add a doctype to an old-style document, it will be rendered using the rules of the new doctype. The differences can be big. Internet Explorer certainly will render pages VERY differently than Firefox or Chrome. One of the reasons (not the best reason, but a very good one) for using a doctype is to make sure pages are rendered similarly by all browsers.The lesson here is this: add the doctype to your document BEFORE you write any HTML or CSS. You will get much better results than adding a doctype AFTER. Link to comment Share on other sites More sharing options...
gabrielebr Posted November 11, 2010 Share Posted November 11, 2010 I have put a DOCTYPE, but my website looks horrible!What is the url of your web site ?how can we see the problem ? Link to comment Share on other sites More sharing options...
eduard Posted November 11, 2010 Author Share Posted November 11, 2010 What is the url of your web site ?how can we see the problem ?That´s the problem! I want to upload my website, but I cannot (because of the DOCTYPE)My code:<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"<html><head><title>Eduard Lid</title><link rel>="stylesheet" type="text/css"href="ex1.css"/></head><body><div class="header"><a href="websites/book/mine.html">Libro</a><a href="http://www.viadeo.com/es/profile/eduard.lid">Perfil</a></div><div id="main"><img src="images/me.jpg" alt="me" align="right" width="373" height="279"</div><div class="footer"><p class="sansserif">Eduard Lid</p><h6>Este sitio web es hecho por Eduard Lid ©</h6></div></body></html> Link to comment Share on other sites More sharing options...
jeffman Posted November 11, 2010 Share Posted November 11, 2010 Doctype should have no relationship to the uploading process, so I'm not sure what you mean by that. You should know that the DTD you just posted is incomplete. The correct form looks like this:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">You need both lines, and certainly you need to close the DOCTYPE tag. Link to comment Share on other sites More sharing options...
eduard Posted November 11, 2010 Author Share Posted November 11, 2010 Doctype should have no relationship to the uploading process, so I'm not sure what you mean by that. You should know that the DTD you just posted is incomplete. The correct form looks like this:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">You need both lines, and certainly you need to close the DOCTYPE tag.You are right! The doctype wasn´t good! I corrected it, but I still have this problem!Code<!DOCTYPE html PUBLIC"-//W3C//DTD HTML 4.01 Transitional/EN""http://www.w3.org/TR/html4/loose.dtd><html><head><title>Eduard Lid</title><link rel>="stylesheet" type="text/css"href="ex1.css"/></head><body><div class="header"><a href="websites/book/mine.html">Libro</a><a href="http://www.viadeo.com/es/profile/eduard.lid">Perfil</a></div><div id="main"><img src="images/me.jpg" alt="me" align="right" width="373" height="279"</div><div class="footer"><p class="sansserif">Eduard Lid</p><h6>Este sitio web es hecho por Eduard Lid ©</h6></div></body></html> Link to comment Share on other sites More sharing options...
thescientist Posted November 11, 2010 Share Posted November 11, 2010 You are right! The doctype wasn´t good! I corrected it, but I still have this problem!Code<!DOCTYPE html PUBLIC"-//W3C//DTD HTML 4.01 Transitional/EN""http://www.w3.org/TR/html4/loose.dtd><html><head><title>Eduard Lid</title><link rel>="stylesheet" type="text/css"href="ex1.css"/></head><body><div class="header"><a href="websites/book/mine.html">Libro</a><a href="http://www.viadeo.com/es/profile/eduard.lid">Perfil</a></div><div id="main"><img src="images/me.jpg" alt="me" align="right" width="373" height="279"</div><div class="footer"><p class="sansserif">Eduard Lid</p><h6>Este sitio web es hecho por Eduard Lid ©</h6></div></body></html>well, what's the problem? Did you try validating your code? Link to comment Share on other sites More sharing options...
eduard Posted November 11, 2010 Author Share Posted November 11, 2010 well, what's the problem? Did you try validating your code?IT LOOKS HORRIBLE IN MY COMPUTER (APPLE MACINTOSH MACBOOK MAC OS X 10.4.11) Link to comment Share on other sites More sharing options...
gabrielebr Posted November 11, 2010 Share Posted November 11, 2010 That´s the problem! I want to upload my website, but I cannot (because of the DOCTYPE)My code:<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"<html><head><title>Eduard Lid</title><link rel>="stylesheet" type="text/css"href="ex1.css"/></head><body><div class="header"><a href="websites/book/mine.html">Libro</a><a href="http://www.viadeo.com/es/profile/eduard.lid">Perfil</a></div><div id="main"><img src="images/me.jpg" alt="me" align="right" width="373" height="279"</div><div class="footer"><p class="sansserif">Eduard Lid</p><h6>Este sitio web es hecho por Eduard Lid ©</h6></div></body></html>there is an error in the <link rel.....I corrected it as follows<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><title>Eduard Lid</title><link rel="stylesheet" type="text/css" href="ex1.css"/></head><body><div class="header"><a href="websites/book/mine.html">Libro</a><a href="http://www.viadeo.com/es/profile/eduard.lid">Perfil</a></div><div id="main"><img src="images/me.jpg" alt="me" align="right" width="373" height="279"</div><div class="footer"><p class="sansserif">Eduard Lid</p><h6>Este sitio web es hecho por Eduard Lid ©</h6></div></body></html> does it corrsponds to what you were expecting ?regardsGabriele Link to comment Share on other sites More sharing options...
jeffman Posted November 11, 2010 Share Posted November 11, 2010 Dude, look at this a few seconds:<link rel>="stylesheet" type="text/css"href="ex1.css"/> Link to comment Share on other sites More sharing options...
eduard Posted November 11, 2010 Author Share Posted November 11, 2010 there is an error in the <link rel.....I corrected it as follows<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><title>Eduard Lid</title><link rel="stylesheet" type="text/css" href="ex1.css"/></head><body><div class="header"><a href="websites/book/mine.html">Libro</a><a href="http://www.viadeo.com/es/profile/eduard.lid">Perfil</a></div><div id="main"><img src="images/me.jpg" alt="me" align="right" width="373" height="279"</div><div class="footer"><p class="sansserif">Eduard Lid</p><h6>Este sitio web es hecho por Eduard Lid ©</h6></div></body></html> does it corrsponds to what you were expecting ?regardsGabrieleThank you very much! That was indeed the error. Link to comment Share on other sites More sharing options...
boen_robot Posted November 12, 2010 Share Posted November 12, 2010 << "DOCTYPE #?" Topics merged >>Posting several topics for the same issue, and declining to accept the answer isn't going to change the answer. Keep posting in this topic if you have other issues in the understanding of how DOCTYPE works and why it fails with your current experiements. Link to comment Share on other sites More sharing options...
DerekvG Posted November 13, 2010 Share Posted November 13, 2010 Arguments of !DOCTYPE: This is my doctype statement : <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"> What does the EN stand for at the en of the 3rd argument of !DOCTYPE. does it have any bearing on the language of the site If I want another language test do I need to change the EN there tooDerekvG Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.