Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 10:29 PM
bengee
Guest
 
Posts: n/a
Default Positioning <select> boxes - anchor points

Hi

First off - by the word "anchor" i DON'T mean a link, i.e. <a></a> tags

I'm trying to position a <select> box inside a <div>. I can use relative
positioning to set where the box should appear using "left: ?px; top:
?px;". What i'd like to do though, is set the box so that it's dead
horizontally center inside the <div> (don't forget that the width of the
select box can change depending on what options i have listed in it).

Any ideas on how to change the "anchor point" in the select box? By
default it uses left/top as the anchor point. It'd be good to change it
to center/top or center/center.

TIA

bengee
  #2  
Old July 20th, 2005, 10:29 PM
brucie
Guest
 
Posts: n/a
Default Re: Positioning <select> boxes - anchor points

in post: <news:pGCRb.28336$qx2.3334044@stones.force9.net>
bengee <postmaster@localhost.localdomain> said:
[color=blue]
> I'm trying to position a <select> box inside a <div>.[/color]

div{text-align:center;}


--
brucie - i usenet nude
  #3  
Old July 20th, 2005, 10:29 PM
bengee
Guest
 
Posts: n/a
Default Re: Positioning <select> boxes - anchor points

brucie wrote:[color=blue]
> in post: <news:pGCRb.28336$qx2.3334044@stones.force9.net>
> bengee <postmaster@localhost.localdomain> said:
>
>[color=green]
>>I'm trying to position a <select> box inside a <div>.[/color]
>
>
> div{text-align:center;}[/color]

Cheers brucie, that worked a treat in this case. But for future
reference, do you (or anyone) know if it's posible to change the anchor
point?

  #4  
Old July 20th, 2005, 10:29 PM
Neal
Guest
 
Posts: n/a
Default Re: Positioning <select> boxes - anchor points

On Tue, 27 Jan 2004 23:58:36 +0000, bengee
<postmaster@localhost.localdomain> wrote:
[color=blue]
> do you (or anyone) know if it's posible to change the anchor point?
>[/color]


Never heard of it being possible.
  #5  
Old July 20th, 2005, 10:29 PM
Steve Pugh
Guest
 
Posts: n/a
Default Re: Positioning <select> boxes - anchor points

bengee <postmaster@localhost.localdomain> wrote:[color=blue]
>brucie wrote:[color=green]
>> in post: <news:pGCRb.28336$qx2.3334044@stones.force9.net>
>> bengee <postmaster@localhost.localdomain> said:
>>[color=darkred]
>>>I'm trying to position a <select> box inside a <div>.[/color]
>>
>> div{text-align:center;}[/color]
>
>Cheers brucie, that worked a treat in this case. But for future
>reference, do you (or anyone) know if it's posible to change the anchor
>point?[/color]

div {position: relative;}
select {position: absolute; top: XX; left: XX;}

The XX are now measured from the top, left corner of the DIV.

For elements for which don't know the width and height this is not a
technique that can be used for centering.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <steve@pugh.net> <http://steve.pugh.net/>
 

Bookmarks

Thread Tools

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles