Reputation: 19
I am working on a site that looks similar to this:
http://rogerdudler.github.io/git-guide/
I can't seem to figure out how this individual has kept each sections DIV's touching each other. I have looked through every line of his CSS, to no avail. His margin is set to 0, but so is mine, yet it still has spacing.
Mine seem to be spaced. I can fix this by coloring and adjusting border sizes of my own DIV, but I don't think that would be best practice.
Using bootstrap and my own custom css:
html {
overflow-y: scroll;
}
body {
font-size: 30px;
text-align: center;
margin: 0;
padding: 0;
}
#blocks {
position: relative;
margin: 0;
width: 100%;
color: white;
padding-top: 80px;
padding-bottom: 80px;
font-family: 'Quicksand', sans-serif;
}
div {
display:block;
}
.coherence-principle {
background-color:#348fd4;
}
.signalling-principle {
background-color:#9DDFFF;
}
.redundancy-principle {
background-color:#5B51CC;
color:white;
}
Upvotes: 0
Views: 54
Reputation: 19
I think I answered my own question. I did this:
div {
display:block;
float:left;
width:100%;
}
The float:left is what removes spacing (margins) between the DIV's. I had to add the 100% width to the DIV after the float or else white-spacing existed. Must be a CSS trick?
Upvotes: 1