How to Build a Basic CSS Layout

Designing without tables by using CSS layouts is fast becoming the new standard on the Web because of the benefits mentioned in my previous article. Web browsers used these days are now able to render web pages proficiently. In this article I will endeavor to create a basic 2 column CSS layout which you can use for future design projects.

Web Page: http://www.isitebuild.com/css/css-layout.html Style Sheet: http://www.isitebuild.com/css/stylesheet.htm

1. Divide your page into sections - the div id tags allows you to create distinct divisions on your web page. They are identified with a unique id. You can then add a style (css selector) that specifically applies to the div of that id. Remember to include the DOCTYPE (to render your page accurately in the browsers) and meta tags (enables search engines to spider your pages).

wrapper: is the div that wraps around all the other divs like a container for the page elements. header: defines the top banner of the page main: defines the main content of the page nav: defines the navigation of the page footer: defines the footer and sub-navigation of the page

2. Create the CSS code - the CSS code styles the page as a centered 2 column CSS layout with a navigation bar and a footer. The div#wrapper style creates the centered box which acts as a container for the rest of the page content. The width: 80% rule sets the width of the div. The background-color:#FFFFFF rule creates a white background for the div. The margin-top: 50px and margin-bottom: 50px rules create a space of 50 pixels for the top and bottom margins for the div itself.

The proper way to center a block-level element with CSS is to set margin-left: auto and margin-right: auto. This instructs the browser to automatically calculate equal margins for both sides, thus centering the div. The border: thin solid #000000 rule adds a border around the outer div. The rest of the CSS code styles the divs for the header, footer, nav, and main content.

The div#header and div#footer styles set margins and padding for those divs. In addition, div#header includes the text-align: center rule to center the header text, and div#footer includes the border-top: thin solid #000000 rule to create a border along the top edge of the div to replace the horizontal rule above the footer in the table-based layout.

The div#nav and div#main styles create the two columns in the middle of the centered box. In the div#nav style, the float: left rule pushes the div to the left side of its parent element (the wrapper div), and the width: 25% rule sets the div's width to 25 percent of the parent element. With the nav div floated to the left and limited to a set width, it leaves room for the main div to move up to the right of the nav div, thus creating the two-column effect. The div#main style includes the margin-left: 30% rule to keep the main text aligned in a neat column instead of spreading out below the nav column. The main div's left margin is set to a value slightly larger than the width of the nav div.

Style Sheet http://www.isitebuild.com/css/stylesheet.htm

If links are placed elsewhere on the page they will inherit the same properties as above..a blue link that hovers to red. What if you wish to create another set of links that are a different color and on passing your mouse over them they are underlined.

4. Create the bottom navigation - to include this in the section of the page, I use div#footer and code each link accordingly. To make the list go horizontally I use: display: inline;

Now that I have finished creating my style sheet I want to shorten the code on page by linking it to my external style sheet. Here's how:

4. Create an external style sheet - copy and paste all the css code (without these tags: ) into notepad and label it something like "style sheet". Place this style sheet between the head tags of your web page.

This will reduce the code on your page so it will load fast plus the search engines can more easily spider your web page.

4. Add content to your page - after you have got your page looking correctly, you can add more content to it. Adjustments can easily be made to any style on the page (or your whole site) by simply editing one style sheet.

5. Upload your files - be sure to upload your web pages and style sheet to the root directory of your server.

6. Validate your code - be sure to validate your xhtml code: http://validator.w3.org/ and css code: http://jigsaw.w3.org/css-validator/ and make corrections where necessary.

7. Check browser compatibility and screen resolution - check that your page renders well in the popular browsers (IE6, NN7, Firefox)

If you are beginning with CSS layouts, implement then slowly by making small changes to your pages i.e. creating a style sheet for your main headers and fonts only. As you become more familiar with CSS you may eventually build all your future sites with CSS layouts.

Resources:

Basic CSS layout
http://www.isitebuild.com/css/css-layout.html

CSS Style Sheet
http://www.isitebuild.com/css/stylesheet.htm

Benefits of CSS
http://www.isitebuild.com/css/index.htm

Herman Drost is the Certified Internet Webmaster (CIW) owner and author of http://www.isitebuild.com Affordable Web Site Design and Web Hosting. Subscribe to his "Marketing Tips" newsletter for more original articles. mailto:subscribe@isitebuild.com. You can read more of his in-depth articles at: http://www.isitebuild.com

bedroom cleaning professionals Bannockburn ..
In The News:

The Blackdot AI tattoo machine is quiet. It's steady. And according to early users, it hurts a lot less.
Attackers have started to exploit the very signals that users assume will keep them safe when it comes to add-ons to improve productivity or entertainment.
Located on Cerro Pachón in Chile, the world's most powerful digital camera is set to transform how we see the universe.
The innovative DQ Tower stands 28 feet tall with 420 square feet of living space, featuring floor-to-ceiling windows and premium amenities in a prefabricated design.
A new mmWave imaging system allows warehouse robots to scan and create 3D models of objects inside sealed containers, potentially revolutionizing shipping processes.
Family fraud endangers seniors when relatives exploit their trust, but removing personal data online and monitoring identity can prevent financial harm to aging parents.
A study analyzing 500,000 customer service interactions shows chatbots struggle with complex issues while human agents excel at matching customer communication styles.
Aigen's Element robot uses solar power and AI to provide farmers with a sustainable alternative to herbicides, working efficiently in cotton and soy fields.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
Cybercriminals accessed Medicare data of more than 100,000 Americans by creating fraudulent accounts, prompting CMS to deactivate accounts and issue new Medicare cards.
China's battery swap technology from CATL lets electric vehicle owners exchange batteries in under two minutes, with plans to expand to 1,000 stations across 31 Chinese cities by 2025.
Analysts at Silent Push have uncovered a widespread scam that uses counterfeit retail websites to steal the credit card information of online shoppers.
Chrome users need to update their browsers immediately as Google addresses a critical vulnerability that hackers are actively exploiting. Additional security measures are recommended.
A study found teens glance at phones for dangerous two-second intervals while driving, using devices primarily for entertainment, texting and navigation despite crash risks.
Security researchers uncovered a flaw in Windows 11 that allows attackers to disable Secure Boot using Microsoft-signed tools, requiring manual updates to protect against bootkits.
Carnegie Mellon's noninvasive brain technology allows users to move robotic fingers by thinking about the motion, offering new possibilities for people with motor impairments.
Multi-factor authentication (MFA) adds an extra layer of protection to your accounts. Instead of relying only on a password, MFA requires you to verify your identity using two or more methods.
Scientists from Duke, Harvard, and the University of Otago have unveiled a game-changing tool called DunedinPACNI. It uses a single AI brain scan to reveal how fast a person is biologically aging.
A disturbing wave of fake agent phone scams is sweeping across the United States, catching people off guard and draining their savings.
Emojis aren't just playful add-ons; they're powerful tools for building stronger connections in our increasingly digital world.
Google has taken a major step toward the future of clean energy by partnering with Commonwealth Fusion Systems (CFS), an MIT spin-out working to build one of the world’s first commercial fusion reactors.
If you create and share art online, you might have seen messages warning that Facebook's parent company, Meta, claims the right to use or even sell anything you post, whether it's pictures, poems, or artwork.
Cybercriminals hit Qantas in a major data breach that exposed information from up to six million customers.
Having reliable, loud, and timely emergency alerts on your phone or device is important because when severe weather strikes, every second counts.
Here's how your daily brew is becoming the foundation for greener buildings.

Free Software - Powerful Alternatives to Budget-Busting Software

When you buy a computer, it most likely comes with... Read More

Professional XP Style Icons in Software and Website Development

Using professional icons in your application or website can bring... Read More

Microsoft CRM for Large Corporation ? Security

Microsoft Business Solutions CRM proved to be reliable solution in... Read More

How To Choose A Fire Wall Software Program

In the real world a "fire wall" is a fireproof... Read More

Benefits of Integrating Online Chat Software with CRM

Customer Relationship Management (CRM) is a strategy and processes used... Read More

The Tools and Features of Adobe Photoshop

Adobe Photoshop is one of the world's leading graphics editing... Read More

Microsoft Great Plains IV: Inventory Management

Great Plains Inventory Management (IV) module gives your business a... Read More

Passwords Used In Microsoft Word Documents

You would like to protect your documents, wouldn't you? Reasons... Read More

How To Develop Software For Your Business

Software development is a risky business.Many software developers are barely... Read More

Microsoft Great Plains - Payroll & HR Inexpensive Solution? Not Any More

Microsoft Great Plains is main Microsoft Business Solutions accounting package... Read More

Hubris - Definition: Microsofts Passport

Before September of 1995, Microsoft ignored the Internet because their... Read More

Cisco Certification: Introduction To ISDN, Part V

The major reason I recommend getting your hands on real... Read More

Mapping Software: Putting Data Visualization on the Map

Mapping Software Improves Data VisualizationFrom the outset, it is important... Read More

Best Practices In Choosing Network Monitoring Software

Blue Cross and Blue Shield of Hawaii (HMSA) found itself... Read More

Great Plains Dexterity Customization Options ? Overview For Developers

Looks like Microsoft Great Plains becomes more and more popular,... Read More

The Top 5 Wrong Reasons For Not Hiring Testers

Considering whether or not your software company should hire a... Read More

Mozilla Vs. Firefox

For those who are unclear on the differences between the... Read More

Four Desktop Tools To Drastically Increase Your Productivity

Sticky Noteshttp://www.deprice.com/stickynote.htmWith StickyNote 9.0, you can create beautiful 3D notes... Read More

These Items Are A Must Before Making The Decision To Purchase Any Off-The-Shelf Software

1. What determines the software price? Is it Per Seat... Read More

Bill of Lading ? Custom Reporting for Microsoft Great Plains ? Overview for Consultant

Bill of Lading is required report for Logistics and Freight... Read More

Spyware, What is it?

Spyware, what it is and what it does. Basically, spyware... Read More

Microsoft Great Plains POP: Purchase Order Processing ? Overview For Consultants

Great Plains Purchase Order Processing (POP) module makes up one-third... Read More

C++ Function Templates

C++ Function templates are those functions which can handle different... Read More

Examining the Substance of Studio MX

To all web designers out there, this article is for... Read More

Microsoft Business Solutions Customization Options - Overview for Programmer

Several years ago Microsoft purchased Great Plains Software, then Navision... Read More

Airbnb cleaning service Bannockburn ..