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

Caltha ·
更新时间:2024-09-21
· 588 次阅读

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>



hr CSS

需要 登录 后方可回复, 如果你还没有账号请 注册新账号