Forum Moderators: not2easy
<!DOCTYPE HTML>
<html>
<head>
<style type='text/css'>
#mydiv {
background-color: red;
vertical-align: middle;
text-align: center;
height: 200px;
width: 200px;
display: table-cell;
}
#myspan1 {
font-size: 40px;
}
#myspan2 {
font-size: 14px;
}
</style>
</head>
<body>
<div id='mydiv'>
<span id='myspan1'>FOO</span>
<br />
<span id='myspan2'>BAR</span>
</div>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<style type="text/css">
div {
display:table-cell;
vertical-align:middle;
text-align:center;
height:200px;
width:300px;
margin:auto;
background:red;
border:1px solid #f00;
}
span {
display:inline-block;
vertical-align:middle;
padding:0 10px;
font-size:40px;
}
span + span { font-size:14px; }
</style>
</head>
<body>
<div> <span>100</span> <span>This is the desc</span> </div>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<style type="text/css">
div {
display:table-cell;
vertical-align:middle;
text-align:center;
height:200px;
width:300px;
margin:auto;
background:red;
border:1px solid #f00;
}
span {
display:inline-block;
vertical-align:middle;
font-size:40px;
width:49%;
}
span + span { font-size:14px; }
</style>
</head>
<body>
<div> <span>100</span> <span>This is the description that runs to 2 lines</span> </div>
</body>
</html>
but then you have to ask the question; why not just use a table...
@media screen and (max-width: some-small-number-here)
{
span.thing-that-used-to-be-cell-like {display: block}
}
[edited by: incrediBILL at 6:01 am (utc) on Jun 4, 2013]
[edit reason] remioved SIG see TOS [/edit]