...

View Full Version : Seting size of listbox



hYph3n
02-07-2007, 10:52 AM
I have created a list box in HTML. I am able to set it's height using the property "size" but i want to set it's width. how can i?

ronaldb66
02-07-2007, 12:54 PM
AFAIK, form controls are inline elements and their width can therefore not be set; it is determined by the element's content. However, floating would implicitly make them block level which should allow a width to be set.

Is there a reason why you want to specify a width different from that set by the content?

hYph3n
02-07-2007, 01:10 PM
AFAIK, form controls are inline elements and their width can therefore not be set; it is determined by the element's content. However, floating would implicitly make them block level which should allow a width to be set.

Is there a reason why you want to specify a width different from that set by the content?

first of all tell me what does AFAIK means ... :confused: secondly, i want to set the width to make the page look good.

ronaldb66
02-07-2007, 04:49 PM
Oh, sorry, blast from the past: As Far As I Know.

This article on HTML Dog may be of help: Laying Out Forms (http://www.htmldog.com/articles/formlayout/).
Again, floating them (or maybe just setting them explicitly to display: block) should enable you to give form controls a specific width.

hYph3n
02-08-2007, 08:47 AM
Oh, sorry, blast from the past: As Far As I Know.

This article on HTML Dog may be of help: Laying Out Forms (http://www.htmldog.com/articles/formlayout/).
Again, floating them (or maybe just setting them explicitly to display: block) should enable you to give form controls a specific width.

mm, thanks man!. i'll read it out :)

btw, i got this too



<select id="someId" name="someName" style="width:200px">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum