html - How do I do a website with more than 1 background color? -
this got, 1 background color fill 90% of screen. have color under.
position: fixed; top: 0px; left: 0px; width: 100%; height: 90%; background-color: #20a2d6;}
you can find example of i'd here
http://www.spelltower.com/ using html section tags colored backgrounds. it's not single element multiple background colors. javascript used resize each section browser window resized.
html
<div> <section id="first_section">first section</section> <section id="second_section">second section</section> <section id="third_section">third section</section> </div>
css
#first_section { background_color: blue; } #second_section { background_color: red; } #third_section { background_color: green; }
javascript
//when browser window resized... $(window).resize(function() { // new window height var windowheight = $(window).height(); //determine height want each section, in //case don't want less 600 pixels tall var newheight = windowheight; if(newheight<600) newheight = 600; $('section').css('height', newheight); });
Comments
Post a Comment