2013-04-07 136 views
0

我有這3盒CSS陰影的圖像

enter image description here

哪些是通過以下方式構建:

<ul class="home_boxs"> 
     <li class="home_box light_blue"> 
     <div class="news clearfix"></div> 
     </li> 
     <li class="home_box blue"> 
     <div class="news clearfix"></div> 
     </li> 
     <li class="home_box dark_blue"> 
     <div class="news clearfix"></div> 
     </li> 
    </ul> 

我尋找現在要做的是增加一個小的陰影圖像(自定義png)在每個框下面。什麼是實現這一目標的最佳方式?一些建議將非常感激。

見樣本:

enter image description here

+0

看到此:http://nicolasgallagher.com/css-drop-shadows-without-images/demo/以及如何http://nicolasgallagher.com/css-drop-shadows-without-images/ – KF2 2013-04-07 06:28:31

回答

1

你可以做這樣的事情:

ul { 
    list-style: none; 
} 
li { 
    float: left; 
} 
.home_box { 
    position: relative; 
    width: 150px; /* to change with your size */ 
    height: 100px; 
    /* To add more styling according to your needs */ 
} 
.home_box:before { 
    content:' '; 
    position: absolute; 
    width: 100%; 
    height: 10px; 
    background: url(//placehold.it/150x10); /* placeholder */ 
    border-radius: 50%; 
    bottom: -20px; 
} 

,或者,如果你不想使用圖片:

.home_box:before { 
    content:' '; 
    position: absolute; 
    width: 100%; 
    height: 10px; 
    background-color: #999999; 
    border-radius: 50%; 
    bottom: -20px; 
    box-shadow: 0 0 10px #999999; 
} 

Example與圖像 - Example沒有圖像

+0

這是oustanding - 非常感謝你@Ragnarokkr – DaveMilan 2013-04-07 07:19:57

+0

不客氣。很高興有幫助。 – Ragnarokkr 2013-04-07 12:44:09