Forum Moderators: not2easy
<style>
#share_list {
padding: 10px;
font-size: 13px;
color: #FFF;
font-weight: bold;
line-height: 40px
}
#share_list .cell {
display: inline-block;
height: 40px;
padding: 0 2px;
width: 31%;
margin-right: 1%
}
</style>
<div id="share_list">
<div class="cell" style="background:#1D3A7B">
Text
</div>
<div class="cell" style="background:#00A3E0">
Text
</div>
<div class="cell" style="background:#408080">
Text
</div>
</div> // * based on screen width
#share_list .cell {
blah blah blah;
width: 194px;
margin: 0 3px;
}
@media only screen and (max-width: 660px) {
#share_list .cell {
width: 98px !important;
margin: 0 1px;
}
}
as I pointed out in this thread of yours...
[webmasterworld.com ]
...the CSS "display: table" attribute is the ideal choice for
this project of yours. :)
Please do not confuse the CSS "display: table" attribute
with the HTML "table element". :(
The former is a legitimate and well used display method
whereas the latter is the semantic element for displaying
tabular data. ;)
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1">
<title>untitled document</title>
<link rel="stylesheet" href="screen.css" media="screen">
<style media="screen">
body {
background-color: #f0f0f0;
font: 100% / 162% verdana, arial, helvetica, sans-serif;
}
#share_list {
display: table;
width: 100%;
box-sizing: border-box;
border-spacing: 0.625em;
font-size: 0.8em;
font-weight: bold;
color: #fff;
line-height: 2.5em
}
#share_list .cell {
display: table-cell;
padding: 0 0.25em;
}
#share_list .cell:nth-of-type(1) {
background:#1d3a7b;
}
#share_list .cell:nth-of-type(2) {
background:#00a3e0;
}
#share_list .cell:nth-of-type(3) {
background:#408080;
}
@media ( max-width: 30em ) {
#share_list, #share_list .cell {
display:block;
}
#share_list {
padding: 0.625em;
}
#share_list .cell:nth-of-type(2) {
margin: 0.625em 0;
}
}
</style>
</head>
<body>
<div id="share_list">
<div class="cell">
Text
</div>
<div class="cell">
Text
</div>
<div class="cell">
Text
</div>
</div>
</body>
</html>
you may find this article...
The Anti-hero of CSS Layout - "display:table" [colintoh.com]
...to be mildly interesting. ;)
box-sizing: border-box;