General Question

Link's avatar

What's the code at the very top of every HTML document?

Asked by Link (327points) April 9th, 2009

What’s the code at the very top of every transitional HTML document? What does it mean? Is it absolutely needed? Don’t be shy with the detail folks. Thanks.

Observing members: 0 Composing members: 0

14 Answers

catinthehat's avatar

You mean the namespace declaration?

Any chance you could copy & paste an example here?

ru2bz46's avatar

<!DOCTYPE html PUBLIC ”-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>

You mean that one? It defines the document type in XHTML (EXtensible HyperText Markup Language). It can be Strict, Transitional, or Frameset, and it basically defines the rules for the code on the page. Use strict for the cleanest code using CSS for presentation. Transitional is good if you want clean code, but still want to use some HTML presentation stuff. Frameset is for when you want to use HTML frames.

larsalan's avatar

<!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”>

larsalan's avatar

Absolutely needed? not so much in html

ru2bz46's avatar

@larsalan Right. It is not needed in HTML, but it is a requirement for XHTML.

larsalan's avatar

^ fo sho. for any further semi useless questions consult the w3 at
http://www.w3.org/

Link's avatar

Okay so it’s the same code every time? And it’s needed in every XHTML document?

Link's avatar

Oh and by the way the code that LARSALAN provided is different than the one RU2BZ46 provided. Which one of you guys got it right?

ru2bz46's avatar

@Link They are both the same, but I did not include the <html> tag with the namespace attribute. It is the same code every time, but there are options (strict, transitional, frameset). There is a good basic (free) course on XHTML at http://www.w3schools.com/xhtml/default.asp, which can answer most of your questions in less than an hour.

larsalan's avatar

@link use ms frontpage or adobe dreamweaver and don’t worry about it.
p.s. don’t buy either TPB ftw!

Link's avatar

Thanks again dudes. Right now I’m using QuarkXPress8 to design my sites. The first site came out so-so, but no major issues. A lot of people have told me that it’s better to know HTML so I’m learning it at www.w3school.com. I’m also learning it on Lynda.com which has been helpful.

@Larsalan, what is TPB ftw? lol

larsalan's avatar

@Link
http://thepiratebay.org/ forTheWin

have you tried drupal or joomla? they are not the same as designing your own html pages, or so I’ve heard. They say drupal is user friendly and it’s open source!

Link's avatar

No I’m using QuarkXPress 8 and Notepad ++. Drupa and Joomal are WYSIWYG?

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther