Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.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_Bootstrap 4 - Fatal编程技术网

Html 在两个内联块元素之间添加间距

Html 在两个内联块元素之间添加间距,html,css,bootstrap-4,Html,Css,Bootstrap 4,我在标题旁边有一个模式按钮,两个元素都有display:inline块。我试图使间距和按钮去进一步的权利,并保持标题元素居中 我试着调整物品容器的填充物,但仍然不起作用 .btn.btn-info.btn-md{ 背景#104723; 边框颜色:#104723; 边界半径:3px; 浮动:对; 显示:内联块; 位置:绝对位置; } .btn.btn信息.btn md:活动{ 背景#104723; 边框颜色:#104723; 边界半径:3px; 浮动:对; 显示:内联块; 位置:绝对位置; 右边

我在标题旁边有一个模式按钮,两个元素都有
display:inline块。我试图使间距和按钮去进一步的权利,并保持标题元素居中

我试着调整物品容器的填充物,但仍然不起作用

.btn.btn-info.btn-md{
背景#104723;
边框颜色:#104723;
边界半径:3px;
浮动:对;
显示:内联块;
位置:绝对位置;
}
.btn.btn信息.btn md:活动{
背景#104723;
边框颜色:#104723;
边界半径:3px;
浮动:对;
显示:内联块;
位置:绝对位置;
右边距:-40px;
}
pageheadh先生{
字体大小:30px;
字体大小:粗体;
颜色:黑色;
文本对齐:居中;
显示:内联块;
}
.pageheadp{
文本对齐:居中;
颜色:黑色;
字体大小:粗体;
}
.中心{
调整项目:基线;
证明内容:中心;
文本对齐:居中;
右边填充:10px;
}

健身跟踪器
奖品广场
&时代;
接近

单击任何选项卡以跟踪您在该类别中的进度


您可以将绝对位置添加到按钮:

.btn.btn-info.btn-lg {
            background: #104723;
            border-color: #104723;
            border-radius: 3px;
            float: right;
            display: inline-block;
            position: absolute;
            right:15px;
            top: 10px;
        }
也许再加一句

<br>

首先将
位置:相对
添加到
。居中
,以使用绝对定位正确定位按钮

并为
.btn.btn info.btn md
选择器添加此规则集:

top: 0;
bottom: 0;
height: 40px;
margin: auto auto auto 50px;
.btn.btn-info.btn-md{
背景#104723;
边框颜色:#104723;
边界半径:3px;
浮动:对;
显示:内联块;
位置:绝对位置;
排名:0;
底部:0;
高度:40px;
保证金:自动50px;
}
.btn.btn信息.btn md:活动{
背景#104723;
边框颜色:#104723;
边界半径:3px;
浮动:对;
显示:内联块;
位置:绝对位置;
右边距:-40px;
}
pageheadh先生{
字体大小:30px;
字体大小:粗体;
颜色:黑色;
文本对齐:居中;
显示:内联块;
}
.pageheadp{
文本对齐:居中;
颜色:黑色;
字体大小:粗体;
}
.中心{
调整项目:基线;
证明内容:中心;
文本对齐:居中;
右边填充:10px;
位置:相对位置;
}

健身跟踪器
奖品广场
&时代;
接近

单击任何选项卡以跟踪您在该类别中的进度


元素之间应该有多少距离?按钮应该在最右边吗?@s.kuznetsov不太多,我仍然想要相对于桌子的按钮。第一个答案在页面的右上角,它把它放在离它很远的地方。你必须更具体地说:
我需要一些距离
->
多少距离
->
不太远
。。。因此,你要避免使用anwser。不太多,这意味着100像素吗?50像素?20像素?20%? 10%?.... 具体点!这正是我要找的@比鲁斯德夫,请看一下我的答案描述。我很乐意帮忙。
<button type="button" class="btn btn-info btn-lg ml-5" data-toggle="modal" data-target="#myModal" >Prize Plaza</button>
.btn.btn-info.btn-lg {
            background: #104723;
            border-color: #104723;
            border-radius: 3px;
            float: right;
            display: inline-block;
            position: absolute;
            right:15px;
            top: 10px;
            margin-right: 50px;
        }
top: 0;
bottom: 0;
height: 40px;
margin: auto auto auto 50px;