Improve Site Performance Increase Site Traffic Monitor Site Uptime Webmaster Resources NetMechanic Home Looking For Help? Partner Programs Privacy Policy Contact Us Press Room
NetMechanic Home LOGIN | HELP | ABOUT US | PRODUCTS | SITE MAP
NetMechanic Menu
Over 52 Million Web Pages Tested!     
 

Search for:


Your Email:

I would like to receive my newsletter in:
HTML format
Text format



Volume 8 (2005)
   September
   June
   April
   March
   January

Volume 7 (2004)
   November
   September
   July
   June
   May
   April
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 6 (2003)
   December
   November (Part 2)
   November
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June (Part 2)
   June
   May (Part 2)
   May
   April (Part 2)
   April
   March (Part 2)
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 5 (2002)
   December (Part 2)
   December
   November (Part 2)
   November
   October (Part 2)
   October
   September (Part 2)
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June (Part2)
   June
   May (Part 2)
   May
   April (Part 2)
   April
   March (Part 2)
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 4 (2001)
   December (Part 2)
   December
   November (Part 2)
   November
   October (Part 2)
   October
   September (Part 2)
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June (Part 2)
   June
   May (Part 2)
   May
   April (Part 2)
   April
   March (Part 2)
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 3 (2000)
   December (Part 2)
   December
   November (Part 2)
   November
   October (Part 2)
   October
   September (Part 2)
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June
   May
   April
   March
   February
   January

Volume 2 (1999)
   December
   November
   October
   September
   July
   June
   May
   April
   March
   February
   January

Volume 1 (1998)
   December
   November
   October
   September

 

CSS Tip:
Cross-Browser Backgrounds

by Tom Dahm,
Chief Operations Officer,
NetMechanic, Inc.

  
March 1999
Vol. 2, No. 3
 • Search Tip
 • CSS Tip
 • Design Tip
  

If you use Cascading Style Sheets to set the background color of parts of your page, be aware that Netscape Navigator has a bug in its rendering engine that may cause a compatibility problem.

Style sheets give you the ability to apply a background color to a page element. You can do this through the following style rule:

<style>
.myclass   { background-color : yellow }
</style>
<div class="myclass">
This has style
</div>

Unfortunately, Netscape Navigator and Microsoft Internet Explorer apply this style differently. MSIE applies the color to the entire page element; Navigator applies the color only to the background of the text. As shown in the image below:

Navigator and Internet Explorer Apply the Style Differently

Who's right? Since our style rule doesn't explicitly define a width for the page element, it should span the entire line by default. Internet Explorer correctly applies the style; Navigator's rendering is wrong..

You can get around this problem by changing the style rule as follows:

<style>
.myclass {background-color: yellow; 
                    margin: 0px; 
                    border: none;}
</style>

This should correct the problem by making Navigator apply the background to the entire line. You can also achieve this effect by setting "width : 100%." This is less reliable, though, so we recommend using the method shown above.

This tip courtesy of Stephan Nedregård
http://www.micropop.com/workshop/



Rate This Tip:
Not Useful Useful Very Useful   
 
NetMechanic Tools
HTML Toolbox
Browser Photo
Server Check
Search Engine Starter
Search Engine Tools
GIFBot
Newsletter
HTML Tutorial and Tips
Search Engine Tutorial
Accessibility Information
Browser Problem Tutorial

Company Info
Products
About Us
Contact
Advertise
Link To Us
Jobs
Privacy Policy
Partner Programs
Press Room
RSS Feed
Support
 



Powered by Overture!

 
     
 
   
 
     


Keynote Home
Copyright © 1996-2007,
Keynote NetMechanic
All rights reserved.