Pretty much every HTML tag can be styled and positioned via CSS. The first example has several probs in it that should have been handled in CSS:
- It's in a table - HTML table code is misused for layout when people are going for a page style that has a grid-like structure, when it's perfectly possible to do this with CSS
- There is a CSS class assigned to the page heading - the <div class="header1"> - this is bad because the <h1> html tag exists to semantically define page headings at this level
- They have put styling markup and unnecessary images into the table as well to give it extra padding - the 1x1transparent.gif and width="150"
So, here's what the correct markup and styling should look like to get the same thing:
In the HTML document:
<h1>Page Heading</h1>
In the associated stylesheet: h1 { margin-right: 151px; }
no subject
- It's in a table - HTML table code is misused for layout when people are going for a page style that has a grid-like structure, when it's perfectly possible to do this with CSS
- There is a CSS class assigned to the page heading - the <div class="header1"> - this is bad because the <h1> html tag exists to semantically define page headings at this level
- They have put styling markup and unnecessary images into the table as well to give it extra padding - the 1x1transparent.gif and width="150"
So, here's what the correct markup and styling should look like to get the same thing:
In the HTML document:
<h1>Page Heading</h1>
In the associated stylesheet:
h1 { margin-right: 151px; }