Two Linked Css Files Not Working
<linktype="text/css" href="css/main.css" media="screen" />
<linktype="text/css" href="css/custom.css" media="screen" />
It also might be that because you are not using any doctype and also you are not closing your link tags, something related to that might be your problem. So try this:
<!DOCTYPE htmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"dir="ltr"lang="en-US"><head><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8" /><title></title><linktype="text/css"href="css/main.css"media="screen" /><linktype="text/css"href="css/custom.css"media="screen" /></head>
Solution 2:
There's a two places that I think may be the problem:
The
href
for custom.css currently points to a location in the current directory of the HTML file. If custom.css is in the /css directory like main.css, you'd have to add that. The file is included when you use an@import
tag because the@import
is relative to main.css, and it can find custom.css in the same directory as main.cssThere's an unclosed CSS tag or something that is breaking all the CSS coming after it; this is pretty unlikely, but you can verify your CSS with the W3.org CSS validator.
Solution 3:
This might be due to the way CSS handles style precedence, but might as well be caused by bad markup. Try validating your document or using an absolute path for the custom.css
stylesheet.
Solution 4:
GaVra, you were right about the doctype, etc. We should have known that, given the HTML5 doctype was being used and probably isn't quite ready for action.
Thanks!
Post a Comment for "Two Linked Css Files Not Working"