gpt4 book ai didi

html - Border-radius 和 box-shadow CSS 无法正常工作

转载 作者:太空宇宙 更新时间:2023-11-04 04:00:54 24 4
gpt4 key购买 nike

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

Demo .

这是我的代码:

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;
}

Screenshot of what I want and what I have

更新感谢 TRiG 的编辑

解决方案 demo :

最佳答案

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

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

http://jsfiddle.net/LrmfU/

关于html - Border-radius 和 box-shadow CSS 无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22078847/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com