Web Design Summary 2
XHTML: Giving Structure to Content
Topic 1: Web Standards
Web standards are important for achieving consistent display among computers and browsers, though every browser is still not going to have the same exact response to your website code. You have your content, which includes type, images, sounds, files, and then you have XHTML to give structure to that content. It gives structure by allowing you to define the content through the use of markup/tags. E.g. <header> or <p>. After defining elements in XHTML, you would then define the presentation of the content using CSS. Adopting web standards allows you to improve your website's performance while using less code.
Topic 2: The Times They Are A-Changing
Before web standards were adopted, web builders used many workarounds for creating structure such as nested tables, spacers, and excessive line breaks/non-breaking spaces. Before web standards were adopted, many structures took lots of extra code in order to create certain results. Separating content from presentation is a thing that was starting to become newly adopted at the time. XHTML is used for the content, and CSS is used for the presentation. Different style sheets can be used for different devices—your website could use one style sheet for a laptop and an alternative style sheet for smartphones.
Topic 3: XHTML and How To Write It
XHTML is an improved version of HTML using the free-form structure of XML. You can make a page that works well on many devices with longevity by using well-formed and valid XHTML. To do this there are a few important things to know. First, you should declare a DOCTYPE (choose between strict, transitional, or frameset.) DOCTYPE tells the browser what combination of HTML and XHTML the page contains. Second, you should declare an XML namespace. Third, you should declare your content type. Fourth, you should close every tag. Fifth, you should make sure tags are correctly nested. One more important note is to make sure tags are spelled in lowercase.