W3C

HTML & CSS

HTML (the Hypertext Markup Language) and CSS (Cascading Style Sheets) are two of the core technologies for building Web pages. HTML provides the “structure” of the page. CSS is a powerful language for describing the (visual and aural) display of pages, for a variety of devices. Along with graphics and scripting, HTML and CSS are the basics of building Web pages and Web Applications. Learn more below about:

What is HTML?

HTML is the language for describing the structure of Web pages. HTML gives authors the means to:

  • Publish online documents with headings, text, tables, lists, photos, etc.
  • Retrieve online information via hypertext links, at the click of a button.
  • Design forms for conducting transactions with remote services, for use in searching for information, making reservations, ordering products, etc.
  • Include spread-sheets, video clips, sound clips, and other applications directly in their documents.

With HTML, authors describe the structure of pages using “markup.” The "elements" of the language label pieces of content such as “paragraphs,” “lists,” “tables,” and so on.

What is XHTML?

XHTML is a variant of HTML that uses the syntax of XML, the Extensible Markup Language. XHTML has all the same elements (for paragraphs, etc.) as the HTML variant, but the syntax is slightly different. Because XHTML is an XML application, you can use other XML tools with it (such as XSLT, a language for transforming XML content).

What is CSS?

CSS is the language for describing the presentation of Web pages. This includes colors, layout, and font information, as well as how to change the presentation on different types of devices, such as those with large screens, small screens, or printers. CSS is independent of HTML and can be used with any XML-based markup language. The separation of HTML from CSS makes it easier to maintain the code, share style sheets across pages, and tailor pages to different environments. This is referred to as the separation of structure (or content) from presentation.

Examples

The following very simple example of a portion of an HTML document illustrates how to create a link within a paragraph. When rendered on the screen (or by a speech synthesizer), the link text will be “final report”; following the link will cause the browser to retrieve the resource identified by “http://www.example.com/report”:

    <p class="moreinfo">For more information see the 
    <a href="http://www.example.com/report">final report</a>.</p>
  

The class attribute on the paragraph’s start tag (“<p>”) can be used to add style to all such paragraphs that have that attribute value. For instance, to italicize the text of all “moreinfo” paragraphs using CSS, one could write:

    p.moreinfo { font-style: italic }
  

By placing that rule in a separate file, the style may be shared by any number of HTML documents.

More Information

For more information about HTML and CSS, see tutorials for HTML and CSS.

Current Status of Specifications

Learn more about the current status of specifications related to:

These W3C Groups are working on the related specifications:

Use It

Validators

Logos