spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / authoring / style / sheets / beginners / chap11 / 1 current pageTo page 2To page 3To page 4To page 5To page 6
[next]

CSS: A Beginner's Guide

Developer News
Microsoft Shows Some Ankle With Visual Studio
Gentoo Linux Cancels Distribution
It's Official: Windows 7 at PDC, WinHEC

Understand the Visual Model

Normally, when people think of Web pages they think of the kind of pages you view on a computer monitor. In other words, they think in terms of a visual medium. Although the Web is now moving into many different types of media, its roots go back to a visual presentation. In CSS, this is known as the visual model. If you want to use CSS to design Web pages in the traditional sense of the word, you must learn how to work with the visual model. A key part of the visual model is the concept of box generation.

Box Generation

In the CSS visual model, every element is assumed to generate a box in which its contents are placed. You can manipulate the size, appearance, and position of the box by adding padding, borders, and margins. (To review the box properties, see Module 9.) As the following illustration demonstrates, padding adds space inside the box, borders are drawn around the outside of the box, and margins govern the space around the box.

The CSS Box Model

By learning how to control the positioning of boxes, you can create sophisticated page layouts and designs. If you have worked with a desktop publishing program, greeting card software, or even a word processor, you are probably familiar with the idea of arranging text and image boxes on a page. CSS layout works in much the same way. However, you need to learn how the various boxes on a page relate to one another before you learn how to position them.

Containing Blocks

Every box is contained within another box, usually referred to as the containing block. The position, width, and other aspects of most boxes will be determined by the size and position of the containing block. The "master" containing block on a Web page is the root element. The root element is the element from which all the other elements on the page descend. All of the other elements on the page are considered to be inside this initial containing block. As the following illustration shows, the width of each of the boxes is the same as the containing block (in this case, the entire window).

An HTML document with many boxes

Tip: In an HTML document the actual "root" element is the <html> element. However, for design purposes you should consider the root to be the <body> element.


home / authoring / style / sheets / beginners / chap11 / 1 current pageTo page 2To page 3To page 4To page 5To page 6
[next]



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
Avaya Article: Call Control XML - Powerful, Standards-Based Call Control
Internet.com eBook: The Pros and Cons of Outsourcing
Go Parallel Article: Scalable Parallelism with Intel(R) Threading Building Blocks
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
Go Parallel Article: James Reinders on the Intel Parallel Studio Beta Program
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Go Parallel Article: Getting Started with TBB on Windows
HP eBook: Storage Networking , Part 1
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Go Parallel Video: Intel(R) Threading Building Blocks: A New Method for Threading in C++
HP Video: Is Your Data Center Ready for a Real World Disaster?
Microsoft Partner Portal Video: Microsoft Gold Certified Partners Build Successful Practices
HP On Demand Webcast: Virtualization in Action
Go Parallel Video: Performance and Threading Tools for Game Developers
Rackspace Hosting Center: Customer Videos
Intel vPro Developer Virtual Bootcamp
HP Disaster-Proof Solutions eSeminar
HP On Demand Webcast: Discover the Benefits of Virtualization
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Microsoft Download: Silverlight 2 Software Development Kit Beta 2
30-Day Trial: SPAMfighter Exchange Module
Red Gate Download: SQL Toolbelt
Iron Speed Designer Application Generator
Microsoft Download: Silverlight 2 Beta 2 Runtime
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
IBM IT Innovation Article: Green Servers Provide a Competitive Advantage
Microsoft Article: Expression Web 2 for PHP Developers--Simplify Your PHP Applications
Featured Algorithm: Intel Threading Building Blocks - parallel_reduce
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES
webref The latest from WebReference.com Browse >
Controllers: Programming Application Logic - Part 2 · How to Use JavaScript to Validate Form Data · Controllers: Programming Application Logic
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Sprint Launches Mobile WiMAX Network · Albatron Downsizes with the KI780G Mini-ITX Motherboard · Can't Find a Wi-Fi Network? Make Your Own.

Created: July 8, 2002
Revised: July 8, 2002


URL: http://webreference.com/authoring/style/sheets/beginners/chap11/1/