[英]Semi border around div
您使用<fieldset>
和HTML元素<legend>
見下面的例子
fieldset { border-radius: 5px; }
<fieldset> <legend>Contact:</legend> Name:<input type="text"> <br> Email:<input type="text"> </fieldset>
您可以在容器周圍應用邊框並填充文本的背景,以使輪廓被切除,如下所示:
<html> <style> #text { position: absolute; background: white; top: -15px; left: 10px; padding: 5px; } #con { margin: 20px; width: 300px; height: 500px; position: relative; border: 5px solid red; border-radius: 5px; } </style> <body> <div id="con"> <div id="text"> SEMI BORDER ? </div> </div> </body> </html>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.