- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
i have 4 css boxes lined up. they are contained inside an item #link_container
the issue i have is that i need this container to be the width of the 4 boxes (and not of the browser window):
https://jsfiddle.net/zaahideen/Lu52ho93/
any suggestions?
Easy
#link_container{
background: lightsalmon;
display: inline-block; /* this */
margin: 30px;
padding: 10px;
overflow: auto;
}
brilliant! thanks a million.
one more thing, when the screen is resized then the right-most object moves to the bottom. if the screen is resized more, then then next item moves. all this is fine.
however, how would i make the items centered? i.e. using the
@media screen and (max-width: 655px) {
.link_box{
}
}
what would i need to use so that when the screen is smaller than 655px, the alignment of the first box which moves to the next line is centered?
You mean like this: – https://jsfiddle.net/Lvax46m5/2/
If not, then what I suspect you are after is really hard due to the way wrapping works….and usually requires javascript.
WOW!!!
thanks. exactly what i was after