Programming css: how to write excellent code
Home
 
BEGINNING WITH THE DOCTYPE DECLARATION

 

 

The first item to consider in a web page is a DOCTYPE (geek-speak for “document type”) declaration. Point your browser to the URL in the DOCTYPE element:

  • http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd

You’ll be presented with a long, complex text document known as the DOCTYPE definition, or DTD. The DTD outlines the rules of the language to which the ensuing markup is supposed to conform. Declaring this DTD at the beginning of our markup signals what language zur darstellung der css fest sie drivecss left frame layout der fest sie drive is used on the page to “user agents,” a blanket term for any device or program that can access our page. It’s not just about graphical desktop browsers anymore. Printers, cellular telephones, and screen readers are all examples of user agents,css alabama dynamic drive css der fest sie and each benefits from knowing what markup language they will encounter on the rest of the page.

Online validation tools are another example of user agents, and they (above all others) benefit from our opening DOCTYPE declaration. This allows them to assess how effectively our code conforms to the DTD — in effect, whether it’s valid or not.

Any given browser will have a different strategy in place for how to “fix” this incorrectly nested markup, which can often yield differing results once the page is rendered. XHTML is a language that explicitly demands structural soundness. By requiring our markup to be well formed when using tools like liquid layouts, this stricter document syntax enables us to combat structural inconsistencies in our own code.

By beginning your document with a DOCTYPE declaration and validating frequently, you can proactively squash layout bugs before they arise. This translates into less debugging time for you, which in turn translates into more time you can spend focusing on your site’s design.

The HTML specification never mandated a particular letter case for our pages’ markup elements. As a result, developers have become accustomed to writing elements and their attributes in any case at all:

<P CLASS=be careful</P>

In XHTML, all elements and their attributes must be written in lowercase. This is because XML is quite case-sensitive. For example, <body>, <Body>, and <BODY> would be considered three different elements. Because of this, the authors of the XHTML specification standardized on lowercase:

<p class=”be”>careful!</p>

You'd better keep the value of Warning intact for our class attribute. This is perfectly acceptable in XHTML because attribute values may be in mixed case (for example, pointing the href of a link to a case-sensitive server).

FashionPCs - quality hardware with design
Online shop for computer distributors specializing in ATX cases, external enclosures, mobile racks and RAID systems 

 

 

 

 

 

 

 

 



Copyright ADVANCED CSS WEB SOLUTIONS    |   All rights reserved