jQuery修改伪元素将红⾊⼩符号改成绿⾊
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
div {
position: relative;
width: 90px;
height: 90px;
jquery在一个元素后追加标签background-color: #ff0;
}
.has:after{
position:absolute;
content:'';
background: #ff514c;
width: 10px;
height: 10px;
border-radius:50%;
top: -.1rem;
right: -.25rem;
display: block;
}
</style>
</head>
<body>
<div>
<a href="sysMessage.html" class="point">
<span class="ico_w has">
</span>
<h6 class="tit">我的消息</h6>
</a>
</div>
<script src="js/jquery-1.8.3.min.js"></script>
<script>
$('.point').append("<style>.has::after{background: #0ff}</style>");
</script>
</body>
</html>
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论