Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New Coder
    Join Date
    Feb 2004
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Division Background color only shows in IE...Why?

    Some items of importance on our home page our highligted.
    The color shows fine in IE, but Mozilla, FireFox, Opera and NS seem to ignore it.
    I created different classes for different colors,
    Example:<div class="highlight"> SomeText </div> will give the color assigned to 'highlight" in IE, but is totally ignored in other browsers.
    Is there a work around for this?

  • #2
    Regular Coder
    Join Date
    Jul 2004
    Location
    engoku no anime
    Posts
    354
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Um, could we possibly obtain a URL or see some code?

    It sounds like you did everything right:

    Code:
    div.highlight {
    background-color: #00f; /* just an example */
    }

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Ames, IA, USA
    Posts
    373
    Thanks
    0
    Thanked 0 Times in 0 Posts
    As gohankid77 says, it's hard to say without seeing the code. But my first guess is that you've used an uppercase letter in naming your class but used all lower case in the HTML. All the browsers you list as not showing the background color require that the class name match exactly, both case and letters.
    Need more emoticons?
    Visit Catman's Private Stock

  • #4
    Senior Coder
    Join Date
    Feb 2003
    Location
    Ontario, Canada
    Posts
    1,223
    Thanks
    0
    Thanked 0 Times in 0 Posts
    And if the text is inline, you ought to be using a <span> :P

  • #5
    New Coder
    Join Date
    Feb 2004
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    http://www.kpft.org


    <span> tag cuts of at the end of the sentence, and makes the display look ugly, hence the <div>.
    Code:
      body {text-decoration:none; font-family:Verdana, Arial, Helvetica, sans-serif;  font-weight:normal; font-size:11px;  }
    .maintext{
    	position:relative;
    	left:11px;
    	overflow: scroll;
    	visibility: visible;
    	z-index: auto;
    
    }
    .sidemenu{ position:relative;left:5px}
    table {text-decoration:none; font-family:arial, sans-serif;  font-size:11px;  }
    td {text-decoration:none; font-family:arial, sans-serif;  font-size:11px;  }
    .menutext {font-family: Arial, Helvetica, sans-serif;color: #FFFFCC;font-size: 11px;}
    a:link {text-decoration:none; font-family:Verdana, Arial, Helvetica, sans-serif;  font-size:11px; font-color=#333333; }
    a:visited {text-decoration:none; font-family:Verdana, Arial, Helvetica, sans-serif;  font-size:11px; font-color: #800040;  }
    A:hover {color: #dedeca ; font-family:Verdana, Arial, Helvetica, sans-serif;  font-size:11px; text-decoration: underline; background-color: #330000;  }
    .class.special{ background-color: #cccccc; } 
    .class.background{ background-color: #cccc99; } 
    .class.highlight{ background-color: #9affbc; } 
    .class.bgone{ background-color: #ffcc99; } 
    .class.bgtwo{ background-color: #ffcccc; } 
    .class.bgthree{ background-color: #9999ff; } 
    .class.bgfour{ background-color: #bbf888; } 
    .class.bgfive{ background-color: #ffc18c; } 
    .class.bgsix{ background-color: #d9bddb; } 
    .class.bgseven{ background-color: #f887bd; } 
    .class.bgeight{ background-color: #c9f69d; }
    .class.bgnine { background-color: #7bbd2e; }
    .class.marker { background-color: lime; } 
    .class.frontpage { background-color: #21176f; }
    .class.maincontent { background-color: #304e72; }
    .class.congrats { background-color: #b2a860; }

  • #6
    Senior Coder
    Join Date
    Feb 2003
    Location
    Ontario, Canada
    Posts
    1,223
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Remove .class for your class names...

    The proper syntax for a class selector:

    .className {}

    That would select class="className". Why you have .class.className, I have no idea...

  • #7
    Regular Coder
    Join Date
    Jul 2004
    Location
    engoku no anime
    Posts
    354
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Perhaps solyluna is used to scripting? I don't know since I don't script (much).

  • #8
    Senior Coder
    Join Date
    Feb 2003
    Location
    Ontario, Canada
    Posts
    1,223
    Thanks
    0
    Thanked 0 Times in 0 Posts
    She got .sidemenu and .maintext right, though... Heh. Unless it was a collaborative style sheet.

  • #9
    New Coder
    Join Date
    Feb 2004
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks!
    That's what you get for not looking at Everything when you let some one else work on a collaborative effort. Since it worked in IE I never paid a lot of attention to the syntax.
    Thanks for putting me straight - IE is WAAAYYY too forgiving...

  • #10
    New Coder
    Join Date
    Feb 2004
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Everything looks right now in ALL browsers, except Netscape 4.8.
    Thanks again!


  •  

    Posting Permissions

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