Stylin' with CSS - Chapter 1: XHTML Giving Structure to Content

Jenna Rowe | ART 354 Web Design | January 28th, 2022



Web Standards

Separating a document's stucture and content from the style is important when the content needs to be portable and durable. Meaning, when it needs to be used on a computer vs. an iPhone or tablet.

XHTML is written as: <p> the content inside of this would be paragraph style </p>

CSS is writting as: main{ content }


Standard-based coding is the perfect way to ensure a site will function smoothly on all browsers.

Other benefits of standard-coding include:

    ~ Fluid pages

    ~ Confirm code is correct

    ~ Streamline produciton

    ~ Distribute content more easily

    ~ Less work


The Times They Are A-Changing

Separating the content from the presetenation is the way to future-proof a new website.

A style sheet is how to define the difference of style on different devices. "How should my website look on an iPhone vs a laptop?"

This newer style of code is what makes a website truly portable, flexible, and ready for the future.


XHTML and How To Write It

Well-formed:   XHTML is structured correctly

Valid:   A page only uses tags that are defined in the DTD that is associated with every modern webpage by the webpage's DOCTYPE tag


Coding Requirements:

    1. Declare a DOCTYPE

    2. Declare an XML namespace

    3. Declare your content type

    4. Close every tag

    5. All tags bust be nested correctly

    6. Inline tags can't contain block level tags

    7. Write tags in entirely lowercase

    8. Attributes must have values and must be quoted

    9. Use encoded equivalents for a left good angle bracket and ampersand within content