繁体   English   中英

Border-radius和box-shadow CSS不能正常工作

[英]Border-radius and box-shadow CSS is not working as I'd like

我在创建这个布局时遇到了一些问题。

演示

这是我的代码:

HTML

<!DOCTYPE html>
<html>
    <head>
        <script src="http://code.jquery.com/jquery.min.js"></script>
        <link href="http://getbootstrap.com/dist/css/bootstrap.css" rel="stylesheet" type="text/css" />
        <script src="http://getbootstrap.com/dist/js/bootstrap.js"></script>
        <meta charset="utf-8">
        <title>JS Bin</title>
    </head>
    <body>
        <div class="row " style="">
            <div class="col-md-6  news_basic_style">
                <div class="newsproducts_style">
                <img src="http://placehold.it/150x150">
              </div>

            </div>
            <div class="col-md-6  news_basic_style">
                <div class="newsproducts_style">
                <img src="http://placehold.it/150x150"></div>

            </div>
        </div>
        <div class="row">
            <div class="col-md-6  news_basic_style">
                <div class="newsproducts_style">
                <img src="http://placehold.it/150x150"></div>

            </div>
            <div class="col-md-6  news_basic_style">
                <div class="newsproducts_style">
                <img src="http://placehold.it/150x150"></div>

            </div>
        </div>



    </body>
</html>

CSS

body{
  background-color:#99B3FF;
}  
.news_basic_style{
  border-radius: 20px;
box-shadow:5px 5px 10px rgba(0,0,0,0.65);

}

.news_basic_style{
  background-color:white;
  width:170px;
  margin:20px;
}

我想要的和我拥有的截图

更新感谢编辑TRiG

解决方案演示

border-radiusbox-shadow直接应用于图像并删除背景,如下所示:

img{
    border-radius: 20px; 
    box-shadow:5px 5px 10px rgba(0,0,0,0.65);    
}

http://jsfiddle.net/LrmfU/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM