html - 金立手机的图像不支持边框半径,当我将边框半径赋予图像时,图像会隐藏
问题描述
金立手机的边界半径问题
border-top-left-radius: 5px;
border-top-right-radius: 5px;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
但这对我不起作用,然后我尝试将图像放入 div 中,然后为
border-radius:5px;
overflow: hidden;
padding: 6px;
border: 4px solid #ffffff;
解决方案
您可以使用此代码
body {
margin: 0;
padding: 0;
}
.items {
border-radius: 10px;
overflow: hidden;
padding: 6px;
border: 4px solid #000000;
width: auto;
display: inline-block;
margin: 50px;
}
.items img {
border-top-left-radius: 30px;
border-top-right-radius: 30px;
border-bottom-left-radius: 30px;
border-bottom-right-radius: 30px;
}
<div class="items">
<img src="https://images.livemint.com/rf/Image-621x414/LiveMint/Period2/2017/04/15/Photos/Processed/gionee-kqBG--621x414@LiveMint.jpg">
</div>
推荐阅读
- reactjs - 反应 Firebase 回调
- c++ - Node.js 和 C++ 之间的集成
- reactjs - React Hooks - Ref 在 useEffect 中不可用
- python - 如何比较两个列表并检查其是否相等?
- express - 在 Mongoose 中使用 Promise
- machine-learning - 神经网络中的偏差单元总是一个吗?
- javascript - 另一个ajax调用中的ajax调用返回未定义
- msal - 如何知道给定用户是否已使用 MSAL 登录?
- c++ - 为什么 std::string_view 没有 assign() 和 clear() 方法?
- python - 如何逐像素绘制正方形(Python,PIL)