Navigate

Home
About
Contact
HELP Forums
Table of Contents
View Shopping Cart

Services

Web Hosting Plans
Web Hosting Features
Domain Registration
GET A BLOG!
Website Maintenance
Shopping Carts
SSL Certificates
Accept Credit Cards!
Affiliate Tracking
SEO Ranking

Information

Payment Options
F.A.Q.
Article Categories
Article Archives
WordPress
RSS

Very Solutions

(offsite links)
Web Designs
Content Development
SEO Copy Writing
Web Page Editing
Website Plan
Business Consulting

Resources

(offsite links)
Learn SEO Today!
R.I.G.H.T.S.


cpanel users guide and tutorial

cPanel: User Guide and Tutorial
Price: $14.99/eBook
FREE w/ Business or BizPlus Hosting!

 

HELP Forums

VerySolutions.com
Latest Active Threads



Divvying up the <div> tags

March 24, 2006

by Heather at OMSH

The <div> tag is a block-level element that should be used to define the alignment and style of certain sections in your HTML document.

By identifying or labeling your <div> tag, it will call to your site’s CSS to grab up your desired formatting for whatever portion of text or block of space you are enclosing within the <div> tags.

 


This website’s left menu is defined by the following <div> tag.

Placed within the web page’s html code:

<div id=“left-menu”>Navigation content</div>

The open <div> tag is named ‘left-menu’ and then, of course, we cannot forget to close the </div> tag.

 

Placed within an external style sheet:

#left-menu {
float: left;
width: 135px;
padding: 0px 0px 0px 5px;
background: transparent;
color: #404040;
font-family: lucida grande, verdana, arial, sans-serif; background: transparent;
}

 

By applying a <div> tag and naming it to call to our site’s CSS we are able to define WHERE it rests on the page, how wide it is, how much padding we want, the background color, text color, and font-family.

Using <div> tags reduces bloated markup, and in addition, allows for quick site-wide changes to any block of text by manipulating the CSS above.

RE: Because the <div> tag is considered a block element, browsers will usually block it off much like the <p> element – with extra line spacing both before and after the tag.

To read up on <div> tags:

 

 

Filed In: Basic HTML and CSS
Link to this Article: Permalink
Read Past Articles: Article Archives
Browse Past Articles by Category: Article Categories


 

I am Ready for a Web Site. What Now?