css - Gradient background within a DIV has vertical tiling -


i'm still getting head around use of gradients in css. reason, when try set gradient background main div, background appears odd vertical tiling. have tried combinations of background-repeat property, cannot seem fix this.

here's full code div, there's plenty of commented lines i've tried different code snippets attempt fix - result in same tiling effect:

#centralbox { border: 2px solid black; border-top: none; border-bottom: none; width: 980px; height: 100%;  margin-left: auto; margin-right: auto;  /*background-color: #91c1d1;*/ /*background-repeat: no-repeat;*/   /*background: -webkit-linear-gradient(top, #91c1d1, #91d1c1);*/ /*background: -webkit-linear-gradient(top left, #000000, #ffffff);*/ /*background: -webkit-background-size: auto;*/  background: -webkit-gradient(linear, left top, right bottom, color-stop(0, #ffffff), color-stop(1, #91c1d1));  } 

note, i'm using webkit until can hang of gradient properties, implement other browser support.

this how background renders:

enter image description here

if move exact same code different div, gradient renders correctly, (think) need in div, 1 houses of main site content.


ok, consensus seems code ok , fact rendering works when place code other divs suggests there might else @ large.

here html:

<body> <div id='centralbox'>     <div id='pagetop'>         <div id='header'>             ...         </div> <!-- end of header div -->          <div id='navigation'>             <ul>                 <li class='inactivelink'>home</li>                 <li><a href='about.html'>about me</a></li>                 <li><a href='experience.html'>experience</a></li>                 <li><a href='contact.html'>contact</a></li>             </ul>         </div> <!-- end of navigation div -->     </div> <!-- end of pagetop div -->      <div id='bodycontent'>         ...     </div> <!-- end of bodycontent div -->   </div> <!-- end of centralbox div -->  </body> 

the div trying give gradient centralbox - because div sits in centre of site fixed width , height of 100%. if try use gradient on bodycontent div, works fine, bodycontent smaller div , doesn't fill whole screen.

when first started css3 gradients found site massive help. http://www.colorzilla.com/gradient-editor/ not amazing time saver virtually compatible every browser.

also, code looks fine on side aswell. using webkit browser?


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -