Forum Moderators: open
<input type="radio"> Text1<br />
<input type="radio"> Text2
It will print out two radio-inputs and a text to the right of them. The thing is that the text will be like 2-4 pixels below the center of the radio-input.
So I wonder if there is any way to center the text vertically so it will look like it's on the same "row" as the radio-input?
Like this:
O Text 1
O Text 2
Perhaps your problem is due to CSS, or is browser specific. Try creating an html page with the following code and testing it in more than one environment and see if your problem persists:
code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head><body>
<input type="radio"> Text1<br />
<input type="radio"> Text2</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style> body{font-size:11px;}</style>
</head><body>
<input type="radio"> Text1<br />
<input type="radio"> Text2
</body>
</html>
keyplyr: Where should I add that code? For it to work?
This sort of illusion could happen with larger fonts. The radio button is centered in relation to lowercase text. If your text starts with an uppercase letter (like in your example) then it creates an illusion that the button is off.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style> body{font-size:11px;}</style>
</head><body>
<table>
<tr><td><input type="radio"></td><td>Text1</td></tr>
<tr><td><input type="radio"></td><td>Text2</td></tr>
</table>
</body>
</html>
But it's not working 100% in FF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style> body{font-size:11px;}</style>
</head>
<body>
<table>
<tr><td style="vertical-align:middle;" ><input type="radio"></td><td>Text1</td></tr>
<tr><td style="vertical-align:middle;" ><input type="radio"></td><td>Text2</td></tr>
</table>
</body>
</html>