?
Solved

Position RadioButtonList on right edge of window and keep text from overlapping it.

Posted on 2007-11-21
3
Medium Priority
?
744 Views
Last Modified: 2008-02-01
On a Web Form with lots of RadioButtonLists for "_Y _N _N/A" answers to questions I'm trying to position the RadioButtonLists in a straight column on the right edge of the window.

I have them positioned on the right edge okay like this
<style>
.ToRight{position:absolute; right:10px;}
#container {padding-left:80px; padding-right:50px}
</style>

<asp:RadioButtonList CssClass="ToRight" ID="radTraining6Months" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" TabIndex="580">
                        <asp:ListItem>Y</asp:ListItem>
                        <asp:ListItem>N</asp:ListItem>
                        <asp:ListItem>N/A</asp:ListItem>
</asp:RadioButtonList>

The whole form is inside a <div id="container"></div>

The problem is that long questions will go to the 50px right edge before wrapping to the next line even if that makes the sentence overlap the RadioButtonList a bit.
I can move the right edge or margin of the questions over more by increasing the padding-right:50px to padding-right:100px or so, but that is not the effect I want.  
I want want the text to wrap when it encounters the RadioButtonList so I can have the margins set to a reasonable width and still not overlap the RadioButtonLists.

I tried setting the margin-left and padding-left style of the RadioButtonList but that had no effect.

Any suggestions?

Thanks,
David
0
Comment
Question by:megnin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 30

Accepted Solution

by:
Steggs earned 2000 total points
ID: 20331162
Hello,

absolute positioning takes the element out of the flow so it will have no 'relationship/interaction' with the other elements on the page.

You should try floating the radio buttons instead

Steggs
0
 
LVL 1

Author Comment

by:megnin
ID: 20359911
Changing it from
<style>
.ToRight{position:absolute; right:10px;}
</style>

to

<style>
.ToRight{float:right}
</style>

causes the RadioButtonLists to appear a one line below the question and some of them to not line up all the way to the right.  I had tried float first.
0
 
LVL 1

Author Comment

by:megnin
ID: 20397122
I tried floating the radio buttons, but they moved down to the next line.  That just won't do.  I think that adding a "width" attribute may help.
0

Featured Post

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question