在CSS中使用border-top属性可以在一个声明中设置所有顶部border属性。
您可以尝试运行以下代码以实现border-top属性-
<!DOCTYPE html>
<html>
<head>
<style>
p {
border-style: solid;
border-top: thick dashed #FFFF00;
}
</style>
</head>
<body>
<p>This is demo text</p>
</body>
</html>