Please be sure to remove the spaces between the elements when you use display: inline-block
. Or see the pure CSS solution.
Stripping spaces
But this will not (note that I added a line-height:0
to the parent to get rid of the bottom margin) :
.background{
padding:0;
margin:0;
background-color: yellow;
}
.page{
background-color: darkolivegreen;
width:80%;
padding:0;
margin:0;
line-height:0;
}
.title-boss-offset{
background-color: antiquewhite;
width:70%;
}
.title-boss {
width: 30%;
background-color: aqua;
}
.title-boss-offset, .title-boss{
border-width:0;
display:inline-block;
margin:0;
padding:0;
height: 15em;
word-spacing: normal
}
<body class="background">
<div class="page">
<div class="title-boss-offset"></div><!--
--><div class="title-boss"></div>
</div>
</body>
Pure CSS:
You cantake advantage of the table display that strip spaces between cells, by setting the parent style to display: table;
important parts are :
.parent{
display: table;
width: 100%;
table-layout: fixed;
line-height: 0;
word-spacing: -2em; /*cross-browser quirks*/
}
.children{
display: inline-block;
word-spacing: normal; /*cross-browser quirks*/
}
.background{
padding:0;
margin:0;
background-color: yellow;
}
.page{
background-color: darkolivegreen;
width:80%;
padding:0;
margin:0;
display:table;
table-layout:fixed;
word-spacing: -2em;
line-height:0;
}
.title-boss-offset{
background-color: antiquewhite;
width:70%;
}
.title-boss {
width: 30%;
background-color: aqua;
}
.title-boss-offset, .title-boss{
border-width:0;
display:inline-block;
margin:0;
padding:0;
height: 15em;
word-spacing: normal
}
<body class="background">
<div class="page">
<div class="title-boss-offset"></div>
<div class="title-boss"></div>
</div>
</body>