DIV Based Layout with CSS / PDF
DIV Based
Layout with CSS
DIV Based
Layout with CSS - The table-based approach
DIV Based
Layout with CSS - The mighty DIV tag
DIV Based
Layout with CSS - Fixed layout design with fixed boxes
DIV
Based Layout with CSS - Three-column fixed layout
DIV
Based Layout with CSS - Fixed layout design with floating boxes
DIV Based Layout with CSS - Adding a right
column
DIV Based Layout with CSS - Liquid design with
floating boxes
DIV Based Layout with CSS - Three-column liquid
layout with floating boxes
---------------------------------------------------
Sample of the pdf document :
DIV Based Layout with CSS
Most Web page designers use a table-based layout to achieve a coherent and consistent look. There's a different way to achieve the same look. Using CSS and DIV tags reduces markup code, speeds up page downloads, separates content from its visual presentation, and brings your code closer to Web standards compliance--all while making your website more appealing to search engine spiders. Alejandro Gervasio explains how it's done, with copious examples.
We see it every day. As we surf the huge network of the Web, we are able to appreciate several page layouts through different websites. They run the gamut from classical but highly effective two and three-column designs, to those exotic and certainly uncommon designs which seem not to fall into a specific category.
For many years, Web designers have been sticking firmly to table-based layouts, achieving coherent and consistent looks by the use of complex table nesting techniques, gif spacers and other well-known design processes. Currently, table layout still continues to have a strong presence on the Web, since it provides wide cross-browser compatibility. Tables are pretty well supported elements for browsers, and that’s an extremely powerful reason to use them for Web page layouts. But this strong compatibility comes with an extra cost. Most of the time, nested tables introduce lots of additional markup, and increase file size, download times and server requests when using graphics as spacers, even if they are cached later.
Extra HTML pushes the important content farther down in the source code, making it less likely that a search spider will give Web pages a high relevance score for the keywords. With the use of CSS and DIV tags, we can achieve the same table-based layout effects, reduce our markup code noticeably, get faster page downloads, and separate content from its visual presentation. We are getting closer to standards-compliant code, and our Web pages are more appealing to search engine spiders.
Now, is everything good about CSS? No, unfortunately. The major drawback with CSS is that browsers don’t display reliably some CSS rules because most of them are not completely compliant with Web standards. Still, the advantages of using CSS and DIV tags for page layout are numerous, and certainly are appealing to many Web designers, as modern browsers add more reliable support.
With the pros and cons in our hands, let’s see the basics of how table design works.
DIV Based Layout with CSS - The table-based approach
One of the most common page layouts using tables is easy to do with the ALIGN attribute. This is a left-hand navigation bar with a larger content section, directly to the right of it, building only two tables.Here is the code:
<table align=”left” width=”20%” height=”100%” border=1>
<tr>
<td valign=”top”>Navigation links are placed here</td>
</tr>
</table>
<table align=”right” width=”80%” height=”100%” border=1>
<tr>
<td valign=”top”>Main content is placed here</td>
</tr>
</table>
We build this simple two-column layout, placing the tables as mentioned above: one is located to the left and the other is located to the right. The ALIGN attribute helps us to turn complex tables into simpler ones.
We can use this technique with nested tables too, to keep our layout easier to maintain and display, while it’s still quite appealing to search engines spiders.
A note about this: the attributes ALIGN, WIDTH and HEIGHT are deprecated elements in HTML 4.01 (they are marked for deletion in future versions), but they aren’t likely to disappear any time soon. Currently, all browsers recognize these attributes.
From this point on, we could attach an external style sheet that contains all the proper style declarations for each table, continuing to improve the code like this:
<table id=”content” width=”80%” align=”right” height=”100%”>
<tr>
<td valign=”top”>Main content is placed here</td>
</tr>
</table>
<table id=”leftnavigation” width=”20%” height=”100%”>
<tr>
<td valign=”top”>Navigation Links are placed here</td>
</tr>
</table>
The layout is the same as before, but note the ID attribute for each table. Assigning ID contextual selectors from an external style sheet allow us to build the visual appearance for data contained into each table.
So far, this is a simple sample for table-based layout. It can be easily expanded to more complex layouts, adding nested tables techniques and so. However, I would strongly recommend using DIV tags and CSS for page layout, as we shall see in a moment. Trust me........
Click here for Download PDF / FREE
html language with samples for webmasters
RépondreSupprimerhtml code paragraph tag font family size