Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/80.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中的两个按钮之间留出空格(无css)_Html_Css_Web - Fatal编程技术网

在html中的两个按钮之间留出空格(无css)

在html中的两个按钮之间留出空格(无css),html,css,web,Html,Css,Web,我制作了两个按钮,并将它们右边的边距设置为显示在页面的右侧,但这些按钮是粘在一起的,它们之间没有空格,我尝试将边距设置为30px,例如,但它们都将边距设置在一起 <button type="button" class="btn btn-primary" style="float: right; margin-right: 30px;">Login</button> <button type="bu

我制作了两个按钮,并将它们右边的边距设置为显示在页面的右侧,但这些按钮是粘在一起的,它们之间没有空格,我尝试将边距设置为30px,例如,但它们都将边距设置在一起

<button type="button" class="btn btn-primary" style="float: right; margin-right: 30px;">Login</button>
<button type="button" class="btn btn-secondary" style="float: right; margin-left: 30px;">Register</button>
登录
登记
这是我做的两个按钮的照片


我猜您正在使用引导。您可以在引导中使用这些类:

<button type="button" class="btn btn-primary float-right">Login</button>
<button type="button" class="btn btn-secondary float-right mr-3">Register</button>
登录
登记

  • 使用
    float right
    类而不是内联样式
  • 使用
    mr-x
    类给出余量(x=>1,2,3,4,5)

为什么不尝试不使用float,你说没有css,但这正是你所使用的我正在使用一个指向引导css的链接,因此我无法编辑它,就像你说的,当移除floatUse时,按钮会转到页面左侧使用
,直到你获得所需的空间为止?或 ;any will doi对这两个按钮都做了
style=“margin right:inherit;”“
,我得到了我想要的空间感谢这对我来说非常有用,现在按钮有了空间,它们位于页面的右侧,就像我想要的那样!