I have the following HTML / CSS code in which a line of text is displayed in a green box with a dark green outline. Unfortunately, the text is shown closer to the top of the window. I would like it to be in the vertical middle. What do I need to change to get this effect?
Thanks PaulH
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<style type="text/css">
.foo
{
outline: 1px solid #98BF21;
color: #333333;
background-color: #EEFFCC;
height: 27px;
font-size: 15px;
font-family: "Lucida Console","courier new";
vertical-align: middle;
margin: 1px 0px 0px;
padding: 0px 5px;
overflow: auto;
display: inline-block;
}
</style>
</head>
<body>
<span class="foo">Lorem ipsum dolor sit amet, consectetur adipisicing elit</span>
</body>
</html>
Paulh source
share