如何删除div容器之间的空格(在底部div上有红色边框)?下面是我的片段,我使用materializecss
mackbook
/*############################ LOGIN STYLE ############################*/
body{
font: normal 15px "Roboto", sans-serif;
font-size: 15px;
padding: 0px;
margin: 0px;
background: #ebebeb;
}
a{text-decoration: none;}
h1, h2, h3, h4, h5{font-family: 'mpsemibold', sans-serif;}
a, .transation{
-webkit-transition: all 200ms ease-in-out;
-moz-transition: all 200ms ease-in-out;
-ms-transition: all 200ms ease-in-out;
-o-transition: all 200ms ease-in-out;
transition: all 200ms ease-in-out;
}
.extend{max-width: 100%;max-height: 100%;}
.clear{clear: both; float: none;}
.center{margin-left: auto; margin-right: auto;}
.thehide{display: none;}
.align_left{float: left;}
.align_right{float: right;}
.display_table{display: table;}
.inline{display: inline-block;}
.bgwhite{background: #fff;}
/* ###################### start ###################### */
/* header */
#topheader{
background: #7d7d7d;
padding: 15px;
}
.logo_wrapper, .menu_wrapper{
width: 80%;
}
.logo{
display: table;
margin-bottom: 10px;
}
/* navigation */
#topnav{
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
#topnav li{
float: left;
}
#topnav li a{
display: block;
padding: 5px 8px;
color: #e5e5e5;
text-transform: uppercase;
}
#topnav li a span{
float: left;
display: block;
}
#topnav li a span:first-child{
margin-right: 3px;
}
#topnav li a span:last-child{
padding-top: 2px;
}
#topnav li a.active_menu, #topnav li a:active, #topnav li a:hover{
color: #fff;
}
#mobile_nav{
top: 80px;
left: 20px;
position: fixed;
z-index:99999;
}
/* dropdown */
#topnav .dropdown_menu{
z-index: 999;
position: absolute;
background: #263238;
padding: 10px;
margin-top: 15px;
border-top: 2px solid #fff;
}
#topnav .dropdown_menu li{
clear: both;
float: none;
}
#topnav .dropdown_menu a{
clear: both;
float: none;
display: block;
padding: 5px 8px;
font-size: 13px;
}
.side-nav li a{
text-transform: uppercase;
}
/* dropdown */
#topnav .dropdown_menu{
}
#topnav .dropdown_menu li{
clear: both;
float: none;
}
#topnav .dropdown_menu a{
clear: both;
float: none;
}
/* right option */
.right_option_wrapper ul{padding: 0px; margin: 0px;}
.right_option_wrapper ul li{
float: left;
margin: 0px 5px;
}
.right_option_wrapper ul:first-child{
margin-right: 15px;
}
.right_option_wrapper ul li a{
color: #fff;
font-size: 25px;
}
#idty a{
font: normal 15px 'Roboto', sans-serif;
color: #fff;
padding-top: 7px;
display: block;
}
#idty a span{
float: left;
}
#idty a span:first-child{
margin-right: 3px;
}
.right_option_wrapper img{
-webkit-border-radius: 5000px;
-moz-border-radius: 5000px;
border-radius: 5000px;
}
/* boxes */
#boxes{
padding: 7px;
}
.box{
background: #76b729;
margin: 5px;
width: 23%;
color: #fff;
padding: 10px 15px;
height: 90px;
}
.box_content_container{
padding-top: 7px;
}
.box .icon{
font-size: 4em;
color: #fff;
display: block;
margin-right: 10px;
}
.box h1, h2{text-transform: uppercase; text-align: left; color: #fff; clear: both;}
.box h1{
padding: 0px;
margin: 0px 0px 3px 0px;
font: 400 30px 'Roboto', sans-serif;
}
.box h1 span{
float: left;
font: 400 30px 'Roboto', sans-serif;
display: block;
}
.box h1 span:last-child{
color: rgba(255,255,25,0.5);
font: 300 15px 'Roboto', sans-serif;
padding-top: 3px;
}
.box h2{
margin: 0px;
padding: 0px;
font: 400 10px 'Roboto', sans-serif;
}
/* announcement and workflow */
#second_container .s6{
width: 49.5%;
padding: 7px;
}
#second_container .col:first-child{
margin-right: 5px !important;
}
.title_header{
font: 500 18px 'Roboto', sans-serif;
padding: 3px 5px;
color: #263238;
overflow: auto;
margin: 0px;
border-bottom: 1px solid #76b729;
display: table;
position: relative;
color: #76b729;
}
.title_header span{
float: left;
display: block;
padding: 0px;
}
.title_header span:first-child{
margin-right: 7px;
}
.content{
border-top: 1px solid #ccc;
margin-top: -1px;
padding: 0px;
}
.content_content{
border-bottom: 1px solid #ccc;
padding: 5px;
padding: 0px;
margin: 0px;
}
.content_content h1{
font: 500 15px 'Roboto', sans-serif;
color: #6c6c6c;
padding: 0px 0px 3px 0px;
text-align: left;
border: 1px solid red;
overflow: auto;
}
.content_content h1 span{
float: left;
display: block;
text-align: left;
}
.content_content h1 span:first-child{
margin-right: 3px;
}
.content_content p{
font: 300 13px 'Roboto', sans-serif;
color: #6c6c6c;
padding: 5px;
text-align: left;
}
答案 0 :(得分:0)
最简单的答案:设置为display: inline-block
的元素最终会产生间距。一个简单的解决方法是让第一个结束标记与下一个打开标记位于同一行:
<div>
...
</div><div>
...
</div>