spacer
Yehuda Shiran July 5, 2000
Resolving Style Conflicts
Tips: July 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

Now that Cascaded Style Sheets have become popular, you need to pay attention to conflicts in style specifications as it's possible to inadvertently specify conflicting styles to the same element. Here's an example:

<STYLE>
  .kuku { 
    background-color:yellow;
    width:50;
    height:50;
  }
</STYLE>

and now you also specify a table with two cells:

<TABLE BORDER=1>
<TR>
<TD CLASS="kuku" STYLE="background-color:tan">Come back to docjavascript.com for a new tip every day</TD>
<TD CLASS="kuku" BGCOLOR="tan">Come back to docjavascript.com for a new column every two weeks</TD>
</TR>
</TABLE>

which looks like this:

Come back to docjavascript.com for a new tip every day Come back to docjavascript.com for a new column every two weeks

Notice that the left cell colored tan by the local STYLE specifications. The right cell is colored yellow, because there is only a BGCOLOR specification that does not override the global kuku class definition. We can conclude that particular STYLE definitions override global statements, while element attributes take precedence over global STYLEs.


People who read this tip also read these tips:

Look for similar tips by subject:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

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

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business