By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,867 Members | 1,981 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,867 IT Pros & Developers. It's quick & easy.

Positioning <select> boxes - anchor points

P: n/a
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
Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
in post: <news:pG*********************@stones.force9.net>
bengee <po********@localhost.localdomain> said:
I'm trying to position a <select> box inside a <div>.


div{text-align:center;}
--
brucie - i usenet nude
Jul 20 '05 #2

P: n/a
brucie wrote:
in post: <news:pG*********************@stones.force9.net>
bengee <po********@localhost.localdomain> said:

I'm trying to position a <select> box inside a <div>.

div{text-align:center;}


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?

Jul 20 '05 #3

P: n/a
On Tue, 27 Jan 2004 23:58:36 +0000, bengee
<po********@localhost.localdomain> wrote:
do you (or anyone) know if it's posible to change the anchor point?

Never heard of it being possible.
Jul 20 '05 #4

P: n/a
bengee <po********@localhost.localdomain> wrote:
brucie wrote:
in post: <news:pG*********************@stones.force9.net>
bengee <po********@localhost.localdomain> said:
I'm trying to position a <select> box inside a <div>.


div{text-align:center;}


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?


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 <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.