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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A little rusty, paragraph forming

Status
Not open for further replies.

Lochness30

Programmer
Jun 9, 2004
23
CA
Little rusty on my html. Can anyone remind me how to create a radio button so that the paragraph text don't fall under the radio button when it wraps around?

ie
. This is some text
for a form

instead of

. This is some text
for a form

Thanks!
 
Since radio button and its label text are two separate elements, there's no default way to do what you want. I would float both the button and the label next to each other. That way label will stay in its floated area.

___________________________________________________________
[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
Actually I managed to make it work. With the use of CCS. Notice the negative value on the text-indent.
Code:
.cIndent {
	text-indent: -25px;
	padding-left: 25px;
	padding-right: 10px;
}
and then applied the class to the following
Code:
<input name="radiobutton" type="radio" value="radiobutton" />
    This is text inside of a box with wraparound abilities.

But it's such a hassle I might just use tables! :)
 
I'd do something along these lines:
Code:
<input class="radio" id="foo" name="foo" type="radio" value="bar" />
<label class="radlabel" for="foo">
   This is text inside of a box with wraparound abilities.
</label>
with this CSS
Code:
   .radlabel {
      display: block;
      margin-left: 30px; /*or whatever*/
   }

   .radio {
      float: left;
      clear: left;
   }


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

Part and Inventory Search

Sponsor

Back
Top