rogerio Posted September 2, 2012 Share Posted September 2, 2012 (edited) This only works if added to the .html, how can I get this to work in an external .css? <style type="text/css">/* Remove margins from the 'html' and 'body' tags, and ensure the page takes up full screen height */html, body{ height:100%; margin:0; padding:0; color:white;}/* Set the position and dimensions of the background image. */#page-background{ position:fixed; top:0; left:0; width:100%; height:100%;}/* Specify the position and layering for the content that needs to appear in front of the background image. Must have a higher z-index value than the background image. Also add some padding to compensate for removing the margin from the 'html' and 'body' tags. */#content{ position:relative; z-index:1; padding:10px;}#footer{ font-size:small; text-align:center;}</style><!-- The above code doesn't work in Internet Explorer 6. To address this, we use a conditional comment to specify an alternative style sheet for IE 6 --><!--[if IE 6]><style type="text/css">html{ overflow-y:hidden;}body{ overflow-y:auto;}#page-background{ position:absolute; z-index:-1;}#content{ position:static; padding:10px;}</style><![endif]--> Edited September 2, 2012 by rogerio Link to comment Share on other sites More sharing options...
niche Posted September 2, 2012 Share Posted September 2, 2012 (edited) See the heading "External Style Sheet" in http://www.w3schools...s/css_howto.asp Edited September 2, 2012 by niche Link to comment Share on other sites More sharing options...
rogerio Posted September 2, 2012 Author Share Posted September 2, 2012 Doesn't cover the problem. The issue is that the IE6 portion fails... Link to comment Share on other sites More sharing options...
dsonesuk Posted September 2, 2012 Share Posted September 2, 2012 Insert css styling for ie6 in separate style sheet IE6crap.css then use <link rel="stylesheet" href="pathtocss/normalbetter.css" type="text/css" /><!--[if IE 6]><link rel="stylesheet" href="pathtocss/IE6crap.css" type="text/css" /><![endif]--> below stylesheet link to normal stylesheet styling 2 Link to comment Share on other sites More sharing options...
rogerio Posted September 2, 2012 Author Share Posted September 2, 2012 thanks... Link to comment Share on other sites More sharing options...
niche Posted September 2, 2012 Share Posted September 2, 2012 Very informative. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now