# Radio buttons causing line-breaks

**URL:** <https://www.ruby-forum.com/t/radio-buttons-causing-line-breaks/77031>\
**Category:** Rails\
**Created:** [November 23, 2006, 4:33pm UTC](https://www.ruby-forum.com/t/radio-buttons-causing-line-breaks/77031 "2006-11-23T16:33:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dawillis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@dawillis](https://www.ruby-forum.com/u/dawillis)\
**Post date:** [November 23, 2006, 4:33pm UTC](https://www.ruby-forum.com/t/radio-buttons-causing-line-breaks/77031/1 "2006-11-23T16:33:42Z")

</div>

Hello there - I’m pretty much a newbie to Rails and a complete newbie to  
this forum.  
I’ve had a quick look for a FAQ for the forum but seem unable to find  
one. If I’ve committed any major faux-pas, please forgive me 🙂

My problem is with a form that (I believe) is being generated at least  
partially by some Rails magic.

Some radio buttons in this form are pushing the accompanied text  
downwards, so rather than it looking like this:

o Text1  
o Text2

It looks more like this:

o  
Text1  
o  
Text2

The code that generates this bit is as below, lurking in  
views/addresses/\_addresses\_list.rhtml

\<% address\_id\_param = params["#{address\_name}\_id"] %\>  
\<% if @addresses and !@addresses.empty? %\>

```
<% for address in @addresses %>
    <%= address_radio_button_tag address, address_name, 

```

address\_id\_param.to\_i %\>  
\<%= address.city %\>: \<%= address.line\_one %\>

```
<% end %>
<%= new_address_radio_button_tag address_name, address_id_param %>
Add a new address<br/>

```

\<% else %\>  
\<%= render :partial =\> ‘/addresses/form’, :locals =\> { :address\_name  
=\> address\_name } %\>  
\<% end %\>

The layout of this section is styled by a a CSS element:  
#form\_container. I suspect, from reading some other posts on here, that  
a display: inline; line in the right place should get the text behaving  
the way it ought to.

Sadly, I’m pretty new to CSS too, so while I’ve spent a large part of  
the afternoon trying various things, I’ve yet to hit on the solution.

I hope this wasn’t too long a post - any advice / pointers to some  
reading would be very gratefully appreciated.

Thank you for your time,

Dave

---

<div class="post-metadata">

**Author:** ![dawillis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@dawillis](https://www.ruby-forum.com/u/dawillis)\
**Post date:** [November 23, 2006, 7:18pm UTC](https://www.ruby-forum.com/t/radio-buttons-causing-line-breaks/77031/2 "2006-11-23T19:18:05Z")

</div>

I would look at the output HTML. Certain elements have a line break  
like you are talking about. (DIV and SPAN are a couple fo examples.)  
Spend a few minutes following the simple tutorial here:

> **[CSS Tutorial](https://www.w3schools.com/css/default.asp)**
>
> W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

I expect that setting a display:inline with the correct selector should  
fix your problem.

---

<div class="post-metadata">

**Author:** ![dawillis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@dawillis](https://www.ruby-forum.com/u/dawillis)\
**Post date:** [November 24, 2006, 9:43am UTC](https://www.ruby-forum.com/t/radio-buttons-causing-line-breaks/77031/3 "2006-11-24T09:43:04Z")

</div>

Sorted - thank you very much for your advice, Steve.

Regards,

Dave
