這的確是可能的,注意,對於陰影和漸變所需的規則的金額是由於需要不同的語法不同的瀏覽器(-moz-
是Firefox供應商前綴等)。這裏有一些方便的工具,用於輕鬆提出跨瀏覽器漸變和框陰影。
瞭解更多關於線性漸變,在這裏框陰影:
jsFiddle
.main_content
{
width:100%;
height:auto;
margin:0 auto;
padding:0 0 50px;
/*background-color:#00F;*/
/* Add rounded border to top left and top right */
border-top-left-radius:6px;
border-top-right-radius:6px;
/* Apply the gradient as a 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;
}
您可以添加大型描述性評論,以便其他人(以及我,主要是我......)可以從中學習? – user2058041 2013-04-06 05:38:40
詳細介紹了一下,並添加了更多質量的鏈接,它最多隻是供應商的前綴。 – 2013-04-06 05:48:25
'box-shadow:0px 4px 10px #FFF;'在上面的例子中工作正常,它實際上以75%的透明度出現,儘管它有點不同。你不能做十六進制和alpha。 – 2013-04-06 05:52:33