html - I want to use multiple CSS files -
i have 2 css files:
<link href="css/main.css" rel="stylesheet" type="text/css"> <link href="css/day/style.css" rel="stylesheet" type="text/css">
main.css
#mainheader { position:absolute; top:0; left:0; right:0; width:100%; height:300px; } #contentcontainor { width: 80%; position:absolute; top: 350px; left: 10%; }
style.css
#mainheader { background:green; } #contentcontainor { background: yellow; }
i want 1 position site: main.css , other user chosen style style.css. main.css works correctly style.css dosn't seem working.
i'll honest don't know if possible; i'm experimenting.
if 1 has solution please comment.
what you're stating absolutely possible.
let's have 2 stylesheets, mentioned:
<link href="css/main.css" rel="stylesheet" type="text/css"> <link href="css/day/style.css" rel="stylesheet" type="text/css">
the main.css hold structural (position, dimensions, etc) css, , day/style.css hold design (color, animations, etc) css.
if css/main.css
has following css:
#main_header { position:absolute; top:0; left:0; right:0; width:100%; height:300px; } #content_container{ width: 80%; position:absolute; top: 350px; left: 10%; }
you can append styles (in css/day/style.css
) follows:
#main_header { background-color: #00f; } #content_container{ color: #f00; background-color: #0f0; }
you can override , 'lock' styles (in css/day/style.css
) follows:
#main_header { height: 200px; /* override */ } #content_container{ position: relative !important; /* override , 'lock' */ }
as last note, want make sure css files being loaded , html correctly formatted. use browsers developer tool / firebug make sure css being loaded. example, in chrome, clicking on developer tool (f12) tab called network , reloading page tell whether files being loaded ok (200/304) or whether there issues (ie, 404, 403, 500, etc)
Comments
Post a Comment