css - How can I do multiple backrounds in one div tag? -


first off: http://jsfiddle.net/83fdf/

i have image set "menu's" backround... has blue gradient, rounded corners, , @ bottom has white slight shadow under blue menu.

my image

is possible recreate using pure css on 1 div?

html:

<div class="main_content"></div> 

css:

.main_content {     width:900px;     height:auto;     background:url(http://i.imgur.com/miont7y.jpg) no-repeat center top #fff;     margin:0 auto;     padding:0 0 50px; } 

it indeed possible, note amount of rules required shadows , gradients due different browsers requiring different syntax (-moz- firefox vendor prefix, etc.). here handy tools coming cross-browser gradients , box shadows easily.

read more linear gradients , box shadows here:

jsfiddle

.main_content {     width:100%;     height:auto;     margin:0 auto;     padding:0 0 50px;     /*background-color:#00f;*/      /* add rounded border top left , top right */     border-top-left-radius:6px;     border-top-right-radius:6px;      /* apply gradient background image */     background-image: linear-gradient(bottom, rgb(79,110,189) 0%, rgb(44,188,207) 100%);     background-image: -o-linear-gradient(bottom, rgb(79,110,189) 0%, rgb(44,188,207) 100%);     background-image: -moz-linear-gradient(bottom, rgb(79,110,189) 0%, rgb(44,188,207) 100%);     background-image: -webkit-linear-gradient(bottom, rgb(79,110,189) 0%, rgb(44,188,207) 100%);     background-image: -ms-linear-gradient(bottom, rgb(79,110,189) 0%, rgb(44,188,207) 100%);     background-image: -webkit-gradient(         linear,         left bottom,         left top,         color-stop(0, rgb(79,110,189)),         color-stop(1, rgb(44,188,207))     );      /* apply white shadow on bottom */     -webkit-box-shadow: 0px 4px 10px rgba(255, 255, 255, 0.75);     -moz-box-shadow:    0px 4px 10px rgba(255, 255, 255, 0.75);     box-shadow:         0px 4px 10px rgba(255, 255, 255, 0.75); }  body {     margin:0;     background-color:gray; } 

Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -