Basic Xhtml Template Transitional

/ Comments off

If you're getting started with HTML5 you'll want to learn how to to develop a basic HTML5 template. HTML 4.01 Transitional. HTML/CSS content on SitePoint.

Organize Content with HTML — Display it with CSS When I write an article-or any web page, for that matter-I like to begin with basic, and documents I know contains valid code. After reading this tutorial, you will be able to use this approach, too.

Basic

Below are two types of basic, standards-based documents. The first is a basic XHTML document with a of XHTML 1.0 Transitional, much like WordPress uses. The second is a basic HTML document with a Document Type Definition(DTD) of HTML 4.01 Transitional.

The syntax rules for HTML and XHTML are different in some ways. You must use the correct syntax for the DTD you use or your code will not pass at W3C. This is so even though the browser you use might display your page as expected: browsers are very forgiving with respect to non-standard code. It is very common to find that online web pages fail W3C validation with a massive number of errors. Sometimes this is because the wrong DTD is specified for a page; at other times, the failure is due to using non-standard or deprecated code.

If you start with a valid, basic template and correct any validation errors that show up, your pages will always be 'in the green' when they are published to the Web. If I am writing content for, I generally use the WordPress editor's 'Visual' input mode and WordPress converts my text-only input to valid XHTML code. My WordPress blog also has a 'Valid XHMTL' link on the home page for validating the content. For the articles on my web site, I use the HTML 4.01 Transitional DTD because I am comfortable with its syntax.

I will use this DTD for the rest of the tutorial. The basic HTML document below has some added text. I have replaced the default title, for one thing. In addition, I have added a couple of extra tags in the header. These include tags for a, and. I have also added comments which are bracked with

All Rights Reserved. You can copy and paste this HTML code into a text editor, save it, and then use it as a starting point for your own HTML template. I saved a copy as 'my-html-template.txt' and also saved a copy as 'my-html-template.html'. I created a folder called 'my-template' in which to save the HTML files and, later, an associated CSS file.

Note that I have added HTML line-break tags, so that when the HTML file is opened in a browser, the text elements will not run together. If you save the text with a.html file extension and then, the various parts of the body text will be neat and tidy but not very pretty. We'll use CSS to fix this. Copy and paste the CSS code below into your text editor. Save it as 'my-template.css' in the same folder in which you saved your HTML template file.

If you now file in a browser, you will begin to see some pretty nice formatting. The page content is now centered in about the middle half of the page, there is a nice background color, and the text is verdana.

This is all due to the specifications in the CSS code for 'body.' The 'body' code determines the overall appearance of the page. You can also validate your CSS code. Just copy the CSS code and paste it in the and click the 'Check' button. You will find that the code above passes 'in the green,' as it should.

In order to apply display formatting, the text to receive the formatting must be identified. For certain HTML tags, like and, no class or id names are required. The formatting will be applied automatically when a browser sees these tags. The browser will check the CSS file and apply any formatting specified there or use its own defaults. Other content can be bracketed with HTML tags which contain either the class or id names in the CSS file.

Examples of these tags are the and tags. One way to identify text for special formatting is to use the tags to bracket the text. For example, if you wanted the first few words in the first paragraph of the enhanced template file to be bold, you would place the text between span tags like this.

Vestibulum dapibus. Donec at neque non libero consequat dignissim. Cras eget libero id odio posuere faucibus.

Sed sed ipsum. Pellentesque quis dui. Proin nec erat. Duis vel dolor vitae nisl vestibulum tempus. Aenean nibh purus, pellentesque vel, lacinia sed, scelerisque ac, lorem. Nunc at erat nec velit laoreet venenatis. Donec commodo ultricies quam.

Suspendisse quis magna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec in odio pulvinar diam pharetra adipiscing. Donec viverra, sem sed adipiscing elementum, ipsum libero faucibus mi, quis ullamcorper ligula nisi eu neque.

Proin in turpis. Etiam nisi lorem, fringilla eget, vehicula a, blandit in, lacus. Sed nibh purus, malesuada ut, imperdiet sed, laoreet sit amet, nulla. Nullam metus nisl, tincidunt id, ultrices nec, pulvinar bibendum, sem. Sed eleifend tincidunt quam. Vestibulum lacinia, sapien pellentesque blandit bibendum, velit velit laoreet erat, sed aliquet ante metus vitae purus.

Aliquam blandit nibh et urna. Sed turpis lectus, dapibus quis, interdum at, tincidunt quis, leo. Donec vel lacus sed risus varius varius. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras suscipit sollicitudin lorem. Integer commodo, justo sit amet hendrerit elementum, metus sem adipiscing elit, nec vulputate arcu velit in ligula.

Basic Xhtml Template Transitional

Nam ut dolor et justo dictum posuere. In luctus tincidunt nisi. Vestibulum feugiat posuere felis. Pellentesque pede. Aliquam at sem ut mi feugiat interdum.

Quisque et tortor in magna malesuada porta. Nunc at urna ac dui gravida pretium. Sed id ipsum. Ex4 to mq4 decompiler software store. Maecenas id odio sit amet ante eleifend sollicitudin. Maecenas sollicitudin.

Donec eu est id purus consectetuer vulputate. Fusce ligula turpis, feugiat in, ultrices quis, adipiscing eget, arcu. Sed nisi ipsum, pretium non, luctus et, ornare id, diam. Mauris nec urna.

Suspendisse potenti. Aliquam vulputate tortor ut nunc.

Curabitur massa tortor, adipiscing in, convallis aliquet, pharetra in, neque. Fusce in augue. I hope you enjoyed this article, Aenean Lacinia © Copyright 2008 by Aenean Lacinia. All Rights Reserved. For additional information on HTML and CSS, be sure to visit. A great introductory tutorial on HTML and CSS is. I hope you enjoyed this article.

Here’s a few simple steps to help make your web layouts XHTML (The Extensible HyperText Markup Language) Transitional compliant. For more information on these xhtml web standard consult for further information. To begin this process without embarking on the making of a full layout. Lets open up ImageReady CS, start a new document of any preset size. Next, go ‘Window/Actions’ to bring the Actions Palette to the foreground, if it isn’t already. Now, create a simple layout from a ‘Make Website’ action preset from the actions list. Activate the ‘Make Website’ then hit the ‘Play’ action playback button on the bottom of the Actions Palette, as I have captured below.

Click above image for a larger view! Click above image for a larger view! This action creates a ready made layout design, complete with 2-state roll-over navigational buttons and with slices.

(As indicated by the blue/green border areas) An Important Note with this template to be aware of is that once you ‘Save Optimized As’ to generate the html file for the browser, this template generates not only one html file, but 6 html files. One for the ‘File Name’ preference you give it in the ‘Save Optimized As’ dialog box. The remaining 5 html files are automatically created for each button navigational item. This is a preference item that has to be set before you go to the ‘Save Optimized As’ command feature. To locate this preference, go to the far upper right of the ‘Optimized View’ document window, and click the ‘Output Settings’ menu button (Highlighted in Red below), and from the list choose ‘Other’. (Notice I have my own output settings in the list ‘heathrowe1’). Now with this feature active, the next time you go to ‘Save Optimized As’, ImageReady will include these xhtml transitional compliant elements into the.html pages of the above template.

For further explanation on the guidelines inherent to xhtml transitional consult the above W3C link at the top of this page. For items pertinent to ImageReady output settings, they include:. Tags Case:. Attribute Case:. Indent:.

Line Endings:. Encoding:. Always Add Alt Attribute:. Always Quote Attributes:.

Close All Tags:. Include Zero Margins on Body Tag:Any other further editing of the html files in your favorite editor will also have to meet those standards. Note: Make sure to change the ‘Output Settings’ from ‘XHTML’ to default for future layouts that don’t require it.