Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need to reduce spacing between radio buttons....

Status
Not open for further replies.

fiuPikeOY

Programmer
Jun 14, 2004
143
US
Hello,

Does anybody know how I can reduce the spacing between radio buttons with CSS. They are separated by <br>

I already tried

line-height: 5px;
font-size: 7pt;

anything else I can try???

Thanks
 

You could put them in DIVs and absolutely position them. Of course, given that every browser displays radio buttons differently, if your page is for the internet, then you should probably not be messing with things like that - you may end up obscuring some parts of the radio buttons in some browsers.

Hope this helps,
Dan
 
have you tried applying font-size and line-height to the parent element where buttons reside?
Code:
<form>
 <p style="font-size: 7pt; line-height: 0.8em;">
  <input type="radio" name="radio" /><br />
  <input type="radio" name="radio" /><br />
  <input type="radio" name="radio" /><br />
  <input type="radio" name="radio" /><br />
 </p>
</form>
 
I tried it on the TD and it didn't work. I'll try the DIV to see if it works. Thanks a lot for all your feedback
 
Just apply a [tt]height[/tt] to the <input> elements thus:
Code:
<html>
<head>
<title>Test</title>
<style type="text/css">
.radios input {
   height: 10px;
}
</style>
</head>
<body>
<div class="radios">
  <input type="radio" name="radio" /><br />
  <input type="radio" name="radio" /><br />
  <input type="radio" name="radio" /><br />
  <input type="radio" name="radio" /><br />
</div>
</body>
</html>
I have to say, this is a really bad idea. Different browsers and different operating systems will have different sizes for radio buttons. There's no way you can check that your form looks OK on all possible configurations.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top