html - 如何用百分比条制作边框
问题描述
我什至不知道如何描述它,所以这是图片。
是的,类似的东西。我的意思是圆形边框,但好像只有一部分是红色的。另外,我不希望它被动画或任何东西,所以是否可以只用 CSS 和 HTML 制作它,而不用 JavaScript?
很想在这里得到一些帮助!
解决方案
我认为这可以帮助你。
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
body{
background:yellow;
}
.image{
height:100px;
width:100px;
margin:auto;
border-radius:50%;
border:10px solid red;
border-left:10px solid transparent;
padding:15px;
transform:rotate(45deg);
}
img{
width:100%;
height:100%;
border-radius:50%;
transform:rotate(-45deg);
}
</style>
</head>
<body>
<div class="image" >
<img src="img.jpg" />
</div>
</body>
</html>
推荐阅读
- ansible - Ansible playbook 未循环通过 device_list
- antlr - 我可以在解析器程序中获得原始的 Token 模式吗?
- c++ - 将带有 std::ref 的向量传递给线程似乎不会更新实际向量,而是线程仅更新本地向量副本
- iis - HTTP 请求未经客户端身份验证方案“基本”授权。从服务器收到的身份验证标头是“Basic realm="xyz"'
- node.js - 为什么我不能使用 imap 多次阅读电子邮件?
- r - 多个字符向量的随机生成器
- android - 为什么 Flutter Doctor 找不到名为“android --licences”的选项
- google-apps-script - 为什么 Google AppScript 中的 DriveApp `FileIterator.next` 会一遍又一遍地获取相同的文件?
- python - Python PyTorch Pyro - 多元分布
- r - 在 R 中使用正则表达式将空白替换为数字