Results 1 to 3 of 3

Thread: layer-background-color question

  1. #1
    Join Date
    Apr 2012
    Location
    Central New Jersey
    Posts
    286
    Thanks
    95
    Thanked 3 Times in 3 Posts

    Default layer-background-color question

    A moderator pointed out a css error in the following code:

    [CODE]

    <style type="text/css">
    .intro{
    position:absolute;
    left:0;
    top:0;
    layer-background-color:#ffff00;

    /* #ffff00 = yellow */

    background-color:black;
    border:8.0px solid blue;
    z-index:10;
    }
    </style>

    [CODE]

    Acting on his suggestion, I will be eliminating the layer-background-color line (not w3c approved), and substituting w3c-approved background-color: #ffff00; in the background-color line. So far, so good. But verily one thing puzzles me: The background on the page in question displayed as yellow (which is happens to be the color I wanted). However, the w3c-accepted parameter specified "black". Further, the background-color line * followed * the layer-background-color line. Given those facts, I do not understand why the background color actually displayed the yellow that I wanted, rather than black. And this was so both in Firefox and Explorer.

    A.
    Last edited by marain; 07-31-2012 at 01:50 PM. Reason: Change "color" to "background-color"

  2. #2
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    Well what happens when you take layer-background-color out? Personally, I've never come across this CSS rule, but as a guess, Id say that the layer-ackground-color is higher and therefore on to of the background-color.
    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    As I explained when I pointed this out, the reason it doesn't affect the page background is that the selector:

    Code:
    .intro
    appears nowhere in the markup of the page.

    Because of that, I suggested that the entire section:

    Code:
    <style type="text/css">
     .intro{
     position:absolute;
     left:0;
     top:0;
     layer-background-color:#ffff00;
    
     /* #ffff00 = yellow */
    
     background-color:black;
     border:8.0px solid blue;
     z-index:10;
     }
     </style>
    could be removed.

    The only reasons for updating it to standards and keeping it would be if it's also used on another page with a class="intro" element, or if there's a possibility that a class="intro" element will be added to the page later.

    As further explanation, the layer-background-color property was required for very early Netscape browsers. No browser that requires that is in use today. If it were, it would have many more problems in rendering the typical modern web page than getting the background color right.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •