PC Review


Reply
Thread Tools Rate Thread

Align Radio Button text and button

 
 
tshad
Guest
Posts: n/a
 
      18th Nov 2009
How do you get the text to line up with the button when it is small text?

I have a button:

<asp:RadioButton id="rdbClients" GroupName="SetupDisplay" style=" font-size:
11px " runat="server" />

If the button is the default size where the text is large, it lines up so
the button is at the middle of the text. But when you change the text to a
small font, it is still positioned in the same place but since the text is
smaller, the button is now aligned with the top of the text because the text
is now shorter.

Is there a way to get the text move up so that the button is aligned with
the middle of the text?

Thanks,

Tom


 
Reply With Quote
 
 
 
 
Gregory A. Beamer
Guest
Posts: n/a
 
      18th Nov 2009
"tshad" <(E-Mail Removed)> wrote in
news:uR3VGL$(E-Mail Removed):

> How do you get the text to line up with the button when it is small
> text?
>
> I have a button:
>
> <asp:RadioButton id="rdbClients" GroupName="SetupDisplay" style="
> font-size: 11px " runat="server" />
>
> If the button is the default size where the text is large, it lines up
> so the button is at the middle of the text. But when you change the
> text to a small font, it is still positioned in the same place but
> since the text is smaller, the button is now aligned with the top of
> the text because the text is now shorter.
>
> Is there a way to get the text move up so that the button is aligned
> with the middle of the text?


If I am reading you correctly, you have a need to vertically align the
text? If so, you can do this in the tag, or if you are using CSS (as in the
image/table problem), you can use the vertical-align attribute:
http://www.w3schools.com/Css/pr_pos_vertical-align.asp

Peace and Grace,
Greg

--
Vote for Miranda's Christmas Story
http://tinyurl.com/mirandabelieve

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
Reply With Quote
 
Alexey Smirnov
Guest
Posts: n/a
 
      18th Nov 2009
On Nov 18, 2:59*am, "tshad" <t...@pdsa.com> wrote:
> How do you get the text to line up with the button when it is small text?
>
> I have a button:
>
> <asp:RadioButton id="rdbClients" GroupName="SetupDisplay" style=" font-size:
> 11px " runat="server" />
>
> If the button is the default size where the text is large, it lines up so
> the button is at the middle of the text. *But when you change the text to a
> small font, it is still positioned in the same place but since the text is
> smaller, the button is now aligned with the top of the text because the text
> is now shorter.
>
> Is there a way to get the text move up so that the button is aligned with
> the middle of the text?
>
> Thanks,
>
> Tom


You can try to specify positioning, like

style="position:relative; top:-5px;"
 
Reply With Quote
 
tshad
Guest
Posts: n/a
 
      18th Nov 2009

"Gregory A. Beamer" <(E-Mail Removed)> wrote in message
news:Xns9CC76852ACFBBgbworld@207.46.248.16...
> "tshad" <(E-Mail Removed)> wrote in
> news:uR3VGL$(E-Mail Removed):
>
>> How do you get the text to line up with the button when it is small
>> text?
>>
>> I have a button:
>>
>> <asp:RadioButton id="rdbClients" GroupName="SetupDisplay" style="
>> font-size: 11px " runat="server" />
>>
>> If the button is the default size where the text is large, it lines up
>> so the button is at the middle of the text. But when you change the
>> text to a small font, it is still positioned in the same place but
>> since the text is smaller, the button is now aligned with the top of
>> the text because the text is now shorter.
>>
>> Is there a way to get the text move up so that the button is aligned
>> with the middle of the text?

>
> If I am reading you correctly, you have a need to vertically align the
> text? If so, you can do this in the tag, or if you are using CSS (as in
> the
> image/table problem), you can use the vertical-align attribute:


I already tried that:

<asp:RadioButton id="rdbClients" GroupName="SetupDisplay" style=" font-size:
11px; vertical-align: top " runat="server" />

but the text is still at the bottom.

Tom

> http://www.w3schools.com/Css/pr_pos_vertical-align.asp
>
> Peace and Grace,
> Greg
>
> --
> Vote for Miranda's Christmas Story
> http://tinyurl.com/mirandabelieve
>
> Twitter: @gbworld
> Blog: http://gregorybeamer.spaces.live.com
>
> *******************************************
> | Think outside the box! |
> *******************************************



 
Reply With Quote
 
tshad
Guest
Posts: n/a
 
      18th Nov 2009

"Alexey Smirnov" <(E-Mail Removed)> wrote in message
news:adf3e931-7425-4b75-a51a-(E-Mail Removed)...
On Nov 18, 2:59 am, "tshad" <t...@pdsa.com> wrote:
> How do you get the text to line up with the button when it is small text?
>
> I have a button:
>
> <asp:RadioButton id="rdbClients" GroupName="SetupDisplay" style="
> font-size:
> 11px " runat="server" />
>
> If the button is the default size where the text is large, it lines up so
> the button is at the middle of the text. But when you change the text to a
> small font, it is still positioned in the same place but since the text is
> smaller, the button is now aligned with the top of the text because the
> text
> is now shorter.
>
> Is there a way to get the text move up so that the button is aligned with
> the middle of the text?
>
> Thanks,
>
> Tom
>
>You can try to specify positioning, like
>
>style="position:relative; top:-5px;"


This only works (same with Gregs suggestion) if you use a separate control
such as a Label and then put the style on that. But then the text is about
a couple of characters to the right and not right up to the button as it is
if the text is part of the control.

Neither way works if the text is part of the RadioButton control.

Thanks,

Tom


 
Reply With Quote
 
Gregory A. Beamer
Guest
Posts: n/a
 
      18th Nov 2009
"tshad" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> I already tried that:
>
> <asp:RadioButton id="rdbClients" GroupName="SetupDisplay" style="
> font-size: 11px; vertical-align: top " runat="server" />
>
> but the text is still at the bottom.


Brain went on vacation for a bit there.

There is no real control over alignment between the selection circle (the
button part) and the text (or at least none that I know of). This is not an
ASP.NET exclusive problem either, as this is an HTML construct.

Peace and Grace,
Greg

--
Vote for Miranda's Christmas Story
http://tinyurl.com/mirandabelieve

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
Reply With Quote
 
Alexey Smirnov
Guest
Posts: n/a
 
      26th Nov 2009
On Nov 18, 7:27*pm, "tshad" <t...@pdsa.com> wrote:
> "Alexey Smirnov" <alexey.smir...@gmail.com> wrote in message
>
> news:adf3e931-7425-4b75-a51a-(E-Mail Removed)...
> On Nov 18, 2:59 am, "tshad" <t...@pdsa.com> wrote:
>
>
>
>
>
> > How do you get the text to line up with the button when it is small text?

>
> > I have a button:

>
> > <asp:RadioButton id="rdbClients" GroupName="SetupDisplay" style="
> > font-size:
> > 11px " runat="server" />

>
> > If the button is the default size where the text is large, it lines up so
> > the button is at the middle of the text. But when you change the text to a
> > small font, it is still positioned in the same place but since the textis
> > smaller, the button is now aligned with the top of the text because the
> > text
> > is now shorter.

>
> > Is there a way to get the text move up so that the button is aligned with
> > the middle of the text?

>
> > Thanks,

>
> > Tom

>
> >You can try to specify positioning, like

>
> >style="position:relative; top:-5px;"

>
> This only works (same with Gregs suggestion) if you use a separate control
> such as a Label and then put the style on that. *But then the text is about
> a couple of characters to the right and not right up to the button as it is
> if the text is part of the control.
>
> Neither way works if the text is part of the RadioButton control.
>
> Thanks,
>
> Tom- Hide quoted text -
>
> - Show quoted text -


Tom,

the funny thing is that it is a Label. If you look at the source code
generated, you will see something like this

<input id="rdbClients" type="radio" name="SetupDisplay"
value="rdbClients" /><label for="rdbClients">This is a text string</
label>

Where text from the Text property goes between Label HTML tags. This
means that you need to add CSS style as I told you above

<style>
label
{
position: relative;
top: -5px;
}
</style>

and this should fix the issue. Please try it.

It was not clear from the beginning where your text is since your
sample tag doesn't include Text property....
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Align Text in Command button Wanna Learn Microsoft Excel Misc 2 26th Oct 2008 12:22 PM
Command button align text Wanna Learn Microsoft Excel Misc 0 18th Jul 2008 03:48 PM
Errors when selecting a Button and a Text Field, when trying to Align for example. acs68 Microsoft Access Form Coding 0 17th Mar 2005 12:45 AM
link button and left align text with a margin. Possible? José Joye Microsoft Frontpage 1 24th Apr 2004 10:52 AM
Left Align Text In Server Button DM Microsoft ASP .NET 6 19th Feb 2004 08:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:44 AM.