| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Registered User
Join Date: Aug 2006
Posts: 17
|
Help needed in resolving browser anomalies
I need help to resolve the display differences between IE6 and Firefox 2. The following code displays a simple horizontal line referencing a css style declaration in the header. When viewed with Firefox, it is displayed properly. When viewed with IE6, it looks horrendous. The only way to display this properly in both browsers is to eliminate the css and use deprecated declarations in the <hr> tag. Being new to HTML, I would like to avoid deprecated declarations and base my knowledge on the current HTML 4.01 standard. Am I being too naive? Comments are greatly appreciated. ineuw <html> <head> <style type="text/css"> div.hr { color: #ff0080; background-color: #ff0080; height: 5px; width: 100%; } </style> </head> </body> <br> <div class="hr"></div> </html> |
|
|
|
|
|
#2 (permalink) |
|
shiro
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,007
|
You need conditional comments |
|
|
|
#4 (permalink) |
|
shiro
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,007
|
create a conditional comment for IE6 below the rest of your CSS sheet attachments, then set element styles within that sheet until your site looks proper in IE6. If someone does it for you, you will never figure out how to do it. Try it out and if you are having troubles, post your code and ask for help. But getting someone to do it for you isn't going to do anything, because you wont learn anything that way. edit: Upon re-reading your post, I realized that you apparently didn't understand what conditional comments do. They add a separate CSS sheet that applies only to the browser mentioned in the comment, and not to other browsers. So since you are having troubles with IE6, you should do what I said above - create a stylesheet just for IE6 and then play with it until your site looks right in IE6. |
|
|
|
#5 (permalink) |
|
Senior Member
Join Date: Oct 2006
Posts: 2,060
|
Conditional Comments can be used for much more than merely linking to another stylesheet. Any (X)HTML can be added between the conditional tags. About Conditional Comments I have had problems with HR's looking different, or just crap, when using them in the past, and as I like to prefer to code using XHTML Strict 1.0, I don't think you can use the "noshade" attribute. To solve this I usually used a div, and gave it a height and a image background - looks much nicer. |
|
![]() |