Martin skrev:
> Hej, er der en der gider forklare hvilke DOCTYPE man skal
> validere HTML kode efter, hvis man bruger så meget CSS som
> muligt ?
Det er dit valg - men til et nyt site ville jeg bruge XHTML 1.0
(evt. 1.1) strict.
> Hvad betyder disse typer og hvad er forskelllen:
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "
http://www.w3.org/TR/html4/strict.dtd">
Prøv at klikke på den URI der er en del af DOCTYPE-deklarationen.
,-------- [ strict.dtd (uddrag) ]
| This is HTML 4.01 Strict DTD, which excludes the presentation
| attributes and elements that W3C expects to phase out as support
| for style sheets matures. Authors should use the Strict DTD when
| possible, but may use the Transitional DTD when support for
| presentation attribute and elements is required.
`--------
W3 anbefaler altså at benytte Strict, men giver mulighed for at
benytte Transitional hvis man fx skal opgradere ældre sider. Strict
tillader ikke brug af uønskede (deprecated) elementer, mens de
slipper fint igennem i Transitional. Se også følgende citat fra W3
vedr. valg af Doctype:
bq2:
Three "flavors" of XHTML 1.0 [1]
-
XHTML 1.0 is specified in three "flavors". You specify which of
these variants you are using by inserting a line at the beginning
of the document. For example, the HTML for this document starts
with a line which says that it is using XHTML 1.0 Strict. Thus, if
you want to validate the document, the tool used knows which
variant you are using. Each variant has its own DTD - Document Type
Definition - which sets out the rules and regulations for using
HTML in a succinct and definitive manner.
XHTML 1.0 Strict - Use this when you want really clean structural
mark-up, free of any markup associated with layout. Use this
together with W3C's Cascading Style Sheet language (CSS) to get the
font, color, and layout effects you want.
XHTML 1.0 Transitional - Many people writing Web pages for the
general public to access might want to use this flavor of XHTML
1.0. The idea is to take advantage of XHTML features including
style sheets but nonetheless to make small adjustments to your
markup for the benefit of those viewing your pages with older
browsers which can't understand style sheets. These include using
the body element with bgcolor, text and link attributes.
XHTML 1.0 Frameset - Use this when you want to use Frames to
partition the browser window into two or more frames.
#
Noter:
======
[1]
http://www.w3.org/MarkUp/#recommendations
--
Jens Gyldenkærne Clausen
MF (medlem af FIDUSO -
www.fiduso.dk)
I ovenstående tekst benyttes nyt komma.