473,847 Members | 1,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CSS Border only showing in IE6, not FireFox 3, Opera

jkmyoung
2,057 Recognized Expert Top Contributor
I seem to be missing the borders from div.level1 and div.level2 when viewed in FireFox or Opera. Simplified version of the code.
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  3. <HTML>
  4.     <head>
  5.         <title>Useful Links</title>
  6.         <style type="text/css">
  7.                     body{background-color: #000000;
  8.                             margin:0px;
  9.                             border:0px;
  10.                             padding:10px;}
  11.                     div.level1 {border: medium double rgb(200,200,200)
  12.                                   margin: 0px;
  13.                                   padding:10px;}
  14.                     h1        {font-size:150%;
  15.                                 color: #0000FF;
  16.                                 margin:0px;
  17.                                 border:0px;
  18.                                 padding:0px;}
  19.                     div.level2 {padding:0px, 10px;
  20.                                   border: medium groove rgb(111,111,111)
  21.                                   margin: 0px;}
  22.                     h2        {font-size:130%;
  23.                                 color: #11EE11;
  24.                                 margin:0px;
  25.                                 border:0px;
  26.                                 padding:0px;}
  27.                     div.link {margin:3px, 10px;}
  28.  
  29.                     a            {font-weight: bold;}
  30.                     a:link     {color: #FFFFFF;}
  31.                     a:visited     {color: #FFFFFF;}
  32.                     a:hover     {color: #0000FF;}
  33.                     a:active     {color: #FF0000;}
  34.                     a.new     {font-size: 60%;}
  35.  
  36.                 </style>
  37.     </head>
  38.     <body>
  39.         <div class="level1">
  40.             <h1>Admin</h1>
  41.             <div class="level2">
  42.                 <h2>Applications</h2>
  43.                 <div class="link"><a href="http://www.google.ca" class="main">Google</a>  <a href="http://www.google.ca" target="_blank" class="new">New Window</a></div>
  44.             </div>
  45.         </div>
  46.     </body>
  47. </HTML>
  48.  
Am I declaring border styles incorrectly? Mostly just copied examples from w3schools.

Versions used:
IE 6.0 sp2
Firefox 3.0.3
Opera 9.5.1
Oct 16 '08 #1
3 4690
lgiuliari
27 New Member
I'm no expert but after a quick look I noticed you forgot to add a semicoln after your borders in the declaration.

Expand|Select|Wrap|Line Numbers
  1.  <?xml version="1.0" encoding="UTF-8"?> 
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
  3. <HTML> 
  4.     <head> 
  5.         <title>Useful Links</title> 
  6.         <style type="text/css"> 
  7.                     body{background-color: #000000; 
  8.                             margin:0px; 
  9.                             border:0px; 
  10.                             padding:10px;} 
  11.                     div.level1 {border: medium double rgb(200,200,200);
  12.                                   margin: 0px; 
  13.                                   padding:10px;} 
  14.                     h1        {font-size:150%; 
  15.                                 color: #0000FF; 
  16.                                 margin:0px; 
  17.                                 border:0px; 
  18.                                 padding:0px;} 
  19.                     div.level2 {padding:0px, 10px; 
  20.                                   border: medium groove rgb(111,111,111);
  21.                                   margin: 0px;} 
  22.                     h2        {font-size:130%; 
  23.                                 color: #11EE11; 
  24.                                 margin:0px; 
  25.                                 border:0px; 
  26.                                 padding:0px;} 
  27.                     div.link {margin:3px, 10px;} 
  28.  
  29.                     a            {font-weight: bold;} 
  30.                     a:link     {color: #FFFFFF;} 
  31.                     a:visited     {color: #FFFFFF;} 
  32.                     a:hover     {color: #0000FF;} 
  33.                     a:active     {color: #FF0000;} 
  34.                     a.new     {font-size: 60%;} 
  35.  
  36.                 </style> 
  37.     </head> 
  38.     <body> 
  39.         <div class="level1"> 
  40.             <h1>Admin</h1> 
  41.             <div class="level2"> 
  42.                 <h2>Applications</h2> 
  43.                 <div class="link"><a href="http://www.google.ca" class="main">Google</a>  <a href="http://www.google.ca" target="_blank" class="new">New Window</a></div> 
  44.             </div> 
  45.         </div> 
  46.     </body> 
  47. </HTML> 
  48.  
I added them in and it seems to work in the browsers you mentioned for me.
Oct 16 '08 #2
jkmyoung
2,057 Recognized Expert Top Contributor
Ah,ok thanks. can't believe it was something that stupid. Error didn't show when I validated with w3c. Curse IE6 for rendering invalid pages.
Oct 16 '08 #3
drhowarddrfine
7,435 Recognized Expert Expert
Another problem you will have is that you are using the xml declaration on the first line. It is correct to do this but only modern browsers understand it while IE6 will go into quirks mode and not attempt to perform like a modern browser.

Also, case matters in XHTML. Your closing tag </HTML> will be flagged by the validator. Not that is matters because you aren't serving XHTML anyway and no version of IE handles XHTML either.
Oct 17 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1849
by: Red | last post by:
This is apparently an ie display bug, I can't seem to figure out which ie bug this is. a 3 sided border is created by wrapping the 'inner' box in the 'middle' box and padding the 'middle' box 1px on 3 sides. It looks the same in firefox and ie. Then the same box is wrapped in yet another box with a red border on the bottom. In Firefox the 'middle' box still has padding on only 3 sides, and the red border is showing on the bottom. In...
1
7551
by: Trent L | last post by:
Hello, I'm having a problem where a style for a <a> tag isn't working in IE: border : 1px solid red; If you use my code below, you'll see what I mean. In IE6 on WinXP, I'm not seeing a red top and bottom border. My HTML validates. It looks
1
6939
by: Vegard Beider | last post by:
This works fine in Opera and IE, but in Firefox 1.0 there seems to be a problem. With border-collapse set to collapse, it indents the table 1px to the left. Any ideas how to resolve this without any browser specific hacks? <?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">...
24
2456
by: Alexander Mueller | last post by:
Hi, the following div is 38 pixels high in IE and Opera, however 42 pixels in Firefox (apparently it calculates the height exclusively the border width) <div style="background-color: #000000; height: 38px; border: 2px solid #FF0000;"></div> Now, I dont know which of them is right, but I would like to know
4
6861
by: Andreas König | last post by:
Hello group, this is my first message to a newsgroup so I hope I've done everything right ;-) My problem is that I'd like to have a border via css. This seems to be working on the IE, but not on my favourite Browser Firefox ;-) Firefox shows the border if the site in the frame has not been loaded yet. But if the site shows up the border seems to be overwritten..
3
2650
by: Rhino | last post by:
Yesterday, I reworked the index on my site - http://sfl.london.on.ca - so that they used list markup and I'm quite pleased with them. However, I'm having a problem with one small aspect of the menu and could use some help in fixing it. The problem is that I want the index to always highlight the link for the content which is currently being displayed on the right hand side of the page. This behaviour should be over and above the...
1
5031
by: jason.m.ho | last post by:
Has anyone run into the problem of firefox 'border-collapse: collapse' rendering a table 1-pixel too far to the left? In IE and Opera it will render fine...Does anyone know if this is a bug? This property only holds true in standards compliance mode (quirks mode firefox renders it fine). For example, if you had the following code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
22
2315
by: petermichaux | last post by:
Hi, I would like to display a message to Internet Explorer clients to encorage them to get Firefox. Yes they may like Internet Explorer but it is my site :) http://www.explorerdestroyer.com/ uses navigator.userAgent If ((ua.indexOf('msie') != -1) && (ua.indexOf('opera') == -1) &&
7
1155
by: =?Utf-8?B?TG91IDYy?= | last post by:
010498007741048 This number pops up in search boxes at intermittent times..I have no idea why it does or how to delete it. Could it be some kind of malware or virus/spyware running in the background? I am using Windows XP on an old Dell Dimension, with Opera as my browser. Any ideas on how to find out what is causing this to show up? How to delete it ? and how to prevent it from happening again?
0
9734
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10718
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9493
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7888
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7061
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5729
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4130
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3168
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.