473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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
Jul 20 '05 #1
4 11893
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Steve Wright | last post by:
I have a select box with a lot of entries in it, some of which start with the same letter. I want the user to be able to type the first few letters into the select box and have the list "move"...
5
by: Brian Foley | last post by:
Hello, I am used to using the label tag with check boxes and radio buttons in html forms. This allows me to click on the text of the label to activate/deactivate the check box / button, rather...
1
by: Mike | last post by:
My users have to select an value from a fixed selection of values. The obvious choice of control for such a requirement is to use a <select> (i.e. a combo box). My problem is that sometimes,...
1
by: Mad Scientist Jr | last post by:
I'm stuck trying to work with a HTML <SELECT> control and javascript (similar to DualList but that control doesn't offer enough options to totally control the text on the buttons and control, also...
6
by: joseph.lindley | last post by:
Forgive me for I am a bit of a web-dev novice - but I'm not doing too bad. I'm currently working with a bit of javascript to dynamically add <option>s into a select box. My code currently works...
5
by: = poster = | last post by:
Hi all , I have a script which let the user choose between four days : Day: <select name=\"day\" value=\"$day\"> <option value=\"01\">1</option> <option value=\"02\">2</option> <option...
8
by: dkate777 | last post by:
I have a PHP/mySQL database running, and I've realized I'm come across an awkward little bug. I have a form where a user fills out their information using populated drop down boxes. This...
14
mikek12004
by: mikek12004 | last post by:
In a form I have 5 elements (e.g. pictures) and I wish for the user to be able to set the order of appearance. For this I have for each picture a select box (names select1 to select5) with "please...
1
by: sreenathvanmelil | last post by:
Hai, one <select> option in an php form, we select any one , that related values displayed in another one combobox. both <select> option details from database(mySql) ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.