jlindblom Posted October 11, 2012 Share Posted October 11, 2012 Hey! I have a question, maybe CSS is not enough to resolve this problem. I tried to make some different sections on my website, like they have done on this site http://www.spelltower.com (the several sections/divs with different backgrounds which fills up the browser window to 100%, both height and width). But can't figure it out. Can anyone help how to do this? Hope you understand how I mean. Otherwise, feel free to ask questions and I will answer! Thanks for your kind helping! B r,J Link to comment Share on other sites More sharing options...
Ingolme Posted October 11, 2012 Share Posted October 11, 2012 Applying the background-size property on the html or body element will work. Background-size was introduced in CSS3 and won't work in older browsers. Link to comment Share on other sites More sharing options...
jlindblom Posted October 11, 2012 Author Share Posted October 11, 2012 Thanks Foxy Mod. But there will be more than 1 div in this page, with height 100%. Background-size won't fix this problem, or will it? If it does, how? Because when you resize the browser, I want the section to still be 100% of the browser. And when scrolling down, the next section will start right under the lower browser border. Exactly as it done at www.spelltower.com. Understand how I mean? Link to comment Share on other sites More sharing options...
Ingolme Posted October 11, 2012 Share Posted October 11, 2012 You just need a set of <div> elements one after another, each with height:100% Be sure that the <body> and <html> element heights are also set to 100%. Link to comment Share on other sites More sharing options...
jlindblom Posted October 11, 2012 Author Share Posted October 11, 2012 Hello again! Thanks. So like this; https://dl.dropbox.com/u/101235437/test.html ? But it's only working in IE8 right now, also test Safari, Firefox and Chrome. Do you know why? Link to comment Share on other sites More sharing options...
Ingolme Posted October 11, 2012 Share Posted October 11, 2012 Class names and IDs must start with a letter. Link to comment Share on other sites More sharing options...
jlindblom Posted October 12, 2012 Author Share Posted October 12, 2012 Oh! Thanks for your kind help Foxy Mod! Now it works! Have a nice day! 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