December 17, 201213 yr Hi guys, I'm new to everything around CSS and HTML. I've been dealing with this project at school where we learn some basic css. Mainly I have two issues: 1. Somehow the ID " #nav a:hover,a:active" is affecting all links on my page. Whats wrong? 2. My logo is not displaying in IE, but displays properly in chrome and firefox. What is it that IE don't like and are there any workarounds? (3. Any other things to point out? Maybe you have some tips for solving problems better.) CSS: http://pastebin.com/QEErD7Cz HTML: http://pastebin.com/sJ69yrD1 I'm also uploading all the code files for those of you who prefer that. Looking forward to some feedback. Cheers! project-files.zip Edited December 17, 201213 yr by pedRs
December 17, 201213 yr Where you have styles like this:- #nav a:link,a:visited { #nav a:hover,a:active { } you must repeat the id or class:- #nav a:link, #nav a:visited { #nav a:hover, #nav a:active { } There may be other places where you need to do this, otherwise a simple a:active {} will apply everywhere. I can't see anything wrong with this background to a p tag, but check the path and case, the image filename should be in lower case: #logo p{ text-decoration: none; border: 0; margin: 0; padding: 0; height: 63px; width: 234px; background: url(images/logo.png) no-repeat 0 0; } You could try moving the width, height and background image to the #logo style instead of the #logo p style. I think the link won't work because you have pushed the "a" tag off left with -9999px. This may work:- <p><a href="index.html"><span>2ISFA labs</span></a></p> CSS: #logo a{ display: block; height: 63px; /*text-indent: -9999px;*/ } #logo a span{ display: block; height: 63px; text-indent: -9999px; } Edit: my comment about adding the span tag is unnecessary if you use text-indent, but is necessary if you use margin-left: -9999px for the "a" tag instead. Edited December 19, 201213 yr by Wickham
December 17, 201213 yr Author Where you have styles like this:- #nav a:link,a:visited { #nav a:hover,a:active { } you must repeat the id or class:- #nav a:link, #nav a:visited { #nav a:hover, #nav a:active { } There may be other places where you need to do this, otherwise a simple a:active {} will apply everywhere. Thank you Wickham! This saved my day The problem with IE not displaying the logo also disappeared. The URL works fine even without any changes. Thanks again!
December 18, 201213 yr Good spot Wickham, a little add in for you, when it comes to browser compatibility, we all know that internet explorer is the bain of a web designers life. If you are having cross browser issues, validate your website with xhtml and css validator. it will list the problems in your code that are not at a good web standard, then once you have fixed them you should have no browser issues. Hope thats helpful for the future! Craig
December 18, 201213 yr Author Good spot Wickham, a little add in for you, when it comes to browser compatibility, we all know that internet explorer is the bain of a web designers life. If you are having cross browser issues, validate your website with xhtml and css validator. it will list the problems in your code that are not at a good web standard, then once you have fixed them you should have no browser issues. Hope thats helpful for the future! Craig Great tips! Thank you
Create an account or sign in to comment