Home arrow Style Sheets arrow Page 3 - Styling Headers, Paragraphs and Main Columns of DIV-Based CSS Tables
STYLE SHEETS

Styling Headers, Paragraphs and Main Columns of DIV-Based CSS Tables


If you’re a web designer who uses a few divs to create the layouts of the pages that comprise your web sites, then this group of articles might be useful to you. You'll be particularly interested if you want to keep up with the new trends of modern web development. In this article series, you’ll find an approachable guide to using CSS tables to build table-less web document layouts, without floating containers or negative margins.

Author Info:
By: Alejandro Gervasio
Rating: 4 stars4 stars4 stars4 stars4 stars / 3
January 13, 2009
TABLE OF CONTENTS:
  1. · Styling Headers, Paragraphs and Main Columns of DIV-Based CSS Tables
  2. · Review: building a basic three-column web page layout with CSS tables
  3. · Styling main divs, paragraphs, and headers
  4. · The complete source code of the three-column web page

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Styling Headers, Paragraphs and Main Columns of DIV-Based CSS Tables - Styling main divs, paragraphs, and headers
(Page 3 of 4 )

As I explained in the previous section, my intention here is simply to add some additional CSS styles to certain elements of the sample web page created earlier to improve its visual appearance. In simple terms, I’m going to style the <h2> headers, paragraphs and main divs of the page in question, a process that’s performed by the following CSS code:


body{

padding: 0;

margin: 0;

background: #fff;

}

h2{

margin: 0;

font: bold 14pt Arial, Helvetica, sans-serif;

color: #036;

}

p{

font: normal 11px Tahoma, Arial, Helvetica, sans-serif;

color: #333;

}

#tablewrapper{

border-collapse: collapse;

display: table;

table-layout: fixed;

}

#navbar, #maincol, #sidebar{

display: table-cell;

}

#navbar{

width: 20%;

padding: 15px;

background: #ccf;

}

#maincol{

width: 50%;

padding: 15px;

background: #eee;

}

#sidebar{

width: 30%;

padding: 15px;

background: #9cf;

} 


As you can see, in this case I modified the styles that correspond to the <h2> headers, paragraphs and main divs of the sample layout created previously, making its visual presentation a bit more appealing.

The final result of this styling process can be seen more clearly in the following image:



That wasn’t rocket science, right? However, now the web document constructed with CSS tables looks a bit more appealing! Of course, there’s plenty of room to experiment here, and naturally you’re free to style each element of this sample web page to suit more specifically your personal preferences.

Well, at this point, I have shown you how to apply a few basic CSS styles to certain elements of this basic web document, which has been laid out with CSS tables. Next I will show you how to tie the styles to the structural markup of the document.

This last hands-on example will be developed in the section to come, so jump forward and keep reading.


blog comments powered by Disqus
STYLE SHEETS ARTICLES

- CSS Combinators: Working with Child Combinat...
- CSS Combinators: Using General Siblings
- Intro to CSS Combinators
- CSS Semicircles and Web Page Headers
- Drawing Circular Shapes with CSS3 and Border...
- More CSS Pagination Link Templates
- CSS Pagination Links
- Animated CSS3 Image Gallery: Advanced Transi...
- CSS3 Animated Image Gallery: Transitions
- CSS3 Properties: Fixed Heights with box-sizi...
- CSS3 Properties: Altering Strokes and 3D Eff...
- CSS3 Properties: Text-Stroke
- CSS3 Transitions: Width and Height Properties
- Creating a Drop Down Menu in CSS3
- Intro to CSS Transitions

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 4 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials