html - CSS Bulma容器在边距自动上移动内边框
问题描述
我正在为每个行元素构建一个可折叠的 3 个选项卡,并且在某些分辨率和每个浏览器上的右侧选项卡选择(右边框上的小别名间隙)上都面临对齐问题:
我们使用 flex 和一个简单的 DOM 结构。我们有一个容器(黑色)和两个 div:蓝色的用于处理标签标题,红色的用于处理可折叠内容,如下所示:
问题似乎来自于在蓝色包装器上设置内部 div 的边框。
这是CSS:
* {
outline: none;
}
html * {
box-sizing: border-box;
}
.no-margin {
margin: 0 !important;
}
.container {
position: relative;
width: 100%;
max-width: 993px;
margin: 0 auto;
margin-right: auto;
margin-left: auto;
}
* {
outline: none;
}
html * {
box-sizing: border-box;
}
.no-margin {
margin: 0 !important;
}
.container {
position: relative;
width: 100%;
max-width: 993px;
margin: 0 auto;
margin-right: auto;
margin-left: auto;
}
.inclusive-tab-container {
width: 100%;
margin: 35px auto;
.inclusive-tab {
.inclusive-tab-title {
background-image: url('/static/img/arrow_expand.png');
background-repeat: no-repeat;
background-position: 95% 50%;
&.active {
background-image: url('/static/img/arrow_collapse.png');
}
}
.box-tab {
> div {
position: relative;
cursor: pointer;
border-right: 1px solid $light-grey-four;
border-bottom: 1px solid $light-grey-four;
}
> div.active {
-webkit-animation: fade-in-grey-border $anim-duration-fast both;
animation: fade-in-grey-border $anim-duration-fast both;
border: 1px solid $border-color;
border-bottom: none;
}
.blank {
display: block;
position: absolute;
border: 0;
border-bottom: 8px solid white;
margin: 0;
top: 40px;
width: 100%;
left: 0;
z-index: 999;
}
a {
display: inline-block;
}
}
.box-content-wrapper {
.box-content {
display: none;
padding: 20px;
font-size: 13px;
&.active {
display: block;
border: 1px solid $border-color;
opacity: 1;
z-index: 998;
-webkit-animation: fade-in $anim-duration both;
animation: fade-in $anim-duration both;
}
.addon-selection {
border: none;
}
}
}
}
}
这是可编辑的演示:https ://codepen.io/anthonyvialleton-the-lessful/pen/vaEmoa
它似乎来自 Bulma 容器类的边距自动属性......
解决方案
推荐阅读
- java - 由于在现有项目中导入了特定的库,因此在 Eclipse 中无法解决导入问题
- javascript - 按下按钮时更改全局数组
- reactjs - Redux 即时更新
- android - HttpException:无效响应,原因短语中出现意外 10
- r - 如何将 cat 的输出分配给列表中的对象?
- javascript - 如何制作正则表达式以获取 div 中的字符串?反应原生
- python - 使用 Dash-core-components.Upload 上传一个csv文件,并保存在项目目录中,供其他脚本使用
- ios - 将 switch-as 从 Switch 转换为 Objective-C
- python - 如何更改条的颜色,以便每个条具有不同的颜色并更改图例名称?
- node.js - Nodejs 在 cpanel 中托管时出现 404 错误?