html - 边界半径奇怪的轮廓
问题描述
有什么解决方案可以从图像中去掉这个轮廓?
body {
background: #000
}
.s {
width: 200px;
height: 200px;
border-radius: 50%;
border: 8px solid #FFF;
overflow: hidden
}
.s img {
width: 100%
}
<div class="s">
<img src="https://i.imgur.com/v9f1nS2.jpg" />
</div>
解决方案
不要使用边界实体来制作这样的东西。您应该半径 div 类,并添加填充。之后,您也为图像制作边框半径。这只是我个人的选择,但我希望这会有所帮助..
body {
background:#000
}
.s {
width:200px;
height:200px;
border-radius:50%;
overflow:hidden;
padding:20px;
background:#fff;
}
.s img {
width:100%;
border-radius:50%;
}
<div class="s">
<img src="https://i.imgur.com/v9f1nS2.jpg"/>
</div>
推荐阅读
- php - cakephp 使用 ldap 进行身份验证并匹配到本地用户(或创建一个)
- sql - 如何在 SQL 中执行循环
- java - JavaFX:有没有办法在 LineChart 中添加中断?
- r - 计算两列中的值都为真的行数
- visual-studio-code - “rm:无法删除'wslServer.sh':没有这样的文件或目录”
- javascript - 我的按钮只能点击一次。我希望能够重复多次搜索
- python - 如何将 kivy 中的 Dropdow 列表与主按钮的中心对齐?
- javascript - 立即调用的函数调用 setTimeout 调用循环
- vb.net - Stream.Read 上的 exe 文件
- keras - 微调自定义keras模型