I have this code .infobox { background-color: #EFF3FC; margin: 5px; padding: 5px; border-top: 1px solid #2657CA; border-right: 5px solid #2657CA; border-bottom: 1px solid #2657CA; border-left: 5px solid #2657CA; } Code (markup): if I put in an external file like <link rel="stylesheet" href="css/1.css" type="text/css" media="screen,projection" /> in ie it works fine but in firefox it doesn't.If I leave it in the page with <style>code</style> it works fine in ff and ie.What should I do ?
ok here it is : I want to look similar to this : http://www.rsgsm.com/ex.htm and now here is the file with the problem : http://www.rsgsm.com/ex2.htm
You're missing the <head> Code (markup): element. You need: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Site Title</title> <link href="css/1.css" rel="stylesheet" type="text/css"> </head> Code (markup):
Sorry that should be <link href="css/1.css" rel="stylesheet" type="text/css"/> Code (markup): Make sure the page is valid and then I 'll give you a hand from there: http://jigsaw.w3.org/css-validator/validator?profile=css2&warning=2&uri=http://www.rsgsm.com/ex2.htm. What maybe happening is that the CSS file is invalid and could easily be causing some problems.
The external css file has some significant errors that will prevent the selectors at the bottom of the file from being recognised. move the .infobox class to the top of the file and you may see it work. In particulare each block of three selectors for the headers has an extra closing curly brace. You also need the self closing slash in your link tag when declaring xhtml.
These are the errors reported by the w3cs css validator * Line: 20 Context : #wrapper Invalid number : width Parse Error - this.width > 320 ? "320px" : this.width) * Line: 27 Context : * html #wrapper Invalid number : width Parse Error - document.documentElement.clientWidth > 1200 ? "1200px" : "auto") * Line: 426 Context : h7 Invalid number : font-size only 0 can be a length. You must put an unit after your number : 9 * Line: 428 Parse error - Unrecognized : } * Line: 431 Context : h8 Invalid number : font-size only 0 can be a length. You must put an unit after your number : 12 * Line: 433 Parse error - Unrecognized : } * Line: 469 Parse error - Unrecognized : }