Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何用按钮画一条线的中心_Html_Css - Fatal编程技术网

Html 如何用按钮画一条线的中心

Html 如何用按钮画一条线的中心,html,css,Html,Css,我想在CSS中画一条线。在中间有一个按钮,中间的那条线。那么如何在css中实现这种效果呢?将页边距底部减为按钮。这样写: button{ margin-bottom:-20px; position:relative; } CSS HTML .button-holder{display:block; height:30px; border-bottom:1px solid #ff0000; position:relative; text-align:center;} input{pos

我想在CSS中画一条

线。在中间有一个按钮,中间的那条线。那么如何在css中实现这种效果呢?

页边距底部
减为
按钮
。这样写:

button{
 margin-bottom:-20px;
 position:relative;
} 
CSS

HTML


.button-holder{display:block; height:30px; border-bottom:1px solid #ff0000; position:relative; text-align:center;}
input{position:absolute; bottom:-13px;}
<div class="button-holder">
    <input type="button" value="button in the middle of HR" />
</div>