Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 27th, 2004, 05:27 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: Johannesburg, , South Africa.
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to acdsky
Default Set width on empty select box?

Hi

Probably a stupid question but how do you set the default width on a empty select box without adding an option? I have got a empty box that will get populated by the client from another selection but it looks out of porportion to the others when its so small when its empty.
What I have got is:

<code><select name="CompValues" size="7"id="Values" title="AA">
              </select></code>

Regards
Marnus
Reply With Quote
  #2 (permalink)  
Old July 27th, 2004, 05:35 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Marnus,

A couple of options are:

in a stylesheet...
Code:
#Values{
    width: 200px;
}
or inline...
Code:
<select name="CompValues" style="width: 200px;" size="7" id="Values" title="AA">
HTH,

Chris


Reply With Quote
  #3 (permalink)  
Old July 27th, 2004, 05:38 AM
Friend of Wrox
Points: 1,288, Level: 14
Points: 1,288, Level: 14 Points: 1,288, Level: 14 Points: 1,288, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2004
Location: Stockholm, Sweden
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default

Dear Marnus
for this you can use style sheet mean CSS and in CSS

.box{
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    width: 23mm;
}
 and

<select name="select" class="box" >
        </select>

Numan
--------------------------------------------------
Love is the most precious thing of this world. So find and grab it!
Reply With Quote
  #4 (permalink)  
Old July 27th, 2004, 05:41 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: Johannesburg, , South Africa.
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to acdsky
Default

That was quick! Thanks all, perfect.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Set Column width in Gridview as constant. aarunlal ASP.NET 2.0 Professional 4 April 24th, 2011 12:48 PM
How to set Column width harapraveen XSLT 2 October 23rd, 2007 03:14 AM
Text Box width toshi ASP.NET 1.0 and 1.1 Basics 9 March 30th, 2006 02:20 PM
How to Set TAB width in RichText? myjpa General .NET 0 September 7th, 2004 09:43 PM
Set Column Width Programmatically ritag Excel VBA 1 July 1st, 2004 01:00 PM



All times are GMT -4. The time now is 10:47 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.