css控制水平衡线hr标签样式去掉其阴影效果

前端技术 2023/09/03 CSS
html中水平衡线hr默认高度是两个像素,其中border-top高1px,且颜色为黑,border-bottom高1px颜色为灰,这时看着是阴影效果

去掉阴影效果很简单,只需在css里把border-bottom或border-top属性设置一个为none即可。

复制代码
代码如下:

<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
<html>
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">
<title>Insert title here</title>
<style type = \"text/css\">
.hrtest{
height:20px;
width:50px;
border-top:1px solid red;
border-left:none;
border-right:none;
border-bottom:none;
}
</style>
</head>
<body>
<hr class = \"hrtest\">
</body>
</html>

本文地址:https://www.stayed.cn/item/8358

转载请注明出处。

本站部分内容来源于网络,如侵犯到您的权益,请 联系我

我的博客

人生若只如初见,何事秋风悲画扇。