<html><head><style type="text/css">p.one {border-style: solid;border-width: 15px;border-left-color:red;min-height:50px;}</style></head><body><p class="one">...</p></body></html>
两种办法,一种是直接插入一个明标签,另外一种是用after这个选择器。
<!DOCTYPE html><html><head> <style type="text/css"> p.one{ border-style: solid; border-width: 15px; min-height:50px; position:relative; } p i{ position:absolute;min-height:80px;width:15px;top:-15px;left:-15px;background:red;} p:after{ content:'';position:absolute;min-height:80px;width:15px;top:-15px;right:-15px;background:red; } </style></head><body><p class="one"><i></i>...</p></body></html>这种效果,使用CSS3的方式就简单多啦
如果不嫌麻烦,嵌套一层,兼容新旧浏览器:
...
HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号