The Wayback Machine - https://web.archive.org/web/20090212225643/http://www.webreference.com:80/html/tutorial10/7.html


spacer

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

Boxing with CSS, Part II: No Margin For Error

Exercises


Developer News
Open Source ECM Growing Up
Android's Second Act, G2 Rumors Heat Up
Eclipse Rolls Out PHP Development Tools 2.0

This concludes our two-part introduction to the CSS visual formatting model. By now, you know how to control the box model properties, and how to do simple layout of block elements one after the other. The following excercises will help you get the bigger picture of how these methods are put into action despite browser bugs.

Explorer Challenge

Take the document below, and try to make it look like it should if it had the following style sheet:

BODY {
  margin: 1em;
  padding: 1em;
}
DIV {
  padding: 1em;
  margin: 1em;
  border: 1em solid green;
  background: cyan;
}
P {
  padding: 1em;
  margin: 1em;
  border: 1em solid blue;
  background: magenta;
}

The style sheet you use should be legal CSS, and not create any bizarre effects if tried on Navigator or according to the specification. Any one who manages to do this, tell me how and you'll get an honorary mention in this tutorial.

<BODY>

<DIV>

<P>Acme Computer Corporation is a technology-based 
company that seeks to offer its customers the latest 
in technological innovation. Our products are created 
using the latest breakthroughs in computers and are 
designed by a team of top-notch experts.</P>

<P>We are based in Acmetown, USA, and have offices 
in most major cities around the world. Our goal is to 
have a global approach to the future of computing. Have 
a look at our product catalog for some examples of our 
innovative approach.</P>

</DIV>

</BODY>

Netscape Coloring

Take the document above, and make both paragraphs have a square green background, with a white background on the body, without any borders showing.

Front Page1234567

http://www.internet.com

Produced by Stephanos Piperoglou

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Copyright 2008 Jupitermedia Corporation All Rights Reserved.

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

webref The latest from WebReference.com Browse >
Introducing the ASP.NET Ajax Frameworks · Windows Forms: Applications · Building a Client-Side Ajax Cache
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Verizon's Versatile VoIP Hub · Show Us the Money: What the Stimulus Bill Can Do for Wi-Fi · The Acer Aspire One Enters the Next Generation


All Rights Reserved. Legal Notices.

URL: http://www.webreference.com/html/tutorial10/
Created: Dec 2, 1998
Revised: Jan 27, 1999

Morty Proxy This is a proxified and sanitized view of the page, visit original site.