Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
|
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
 
Old July 27th, 2004, 05:27 AM
Friend of Wrox
 
Join Date: Nov 2003
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
 
Old July 27th, 2004, 05:35 AM
Friend of Wrox
 
Join Date: Jul 2003
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


 
Old July 27th, 2004, 05:38 AM
Friend of Wrox
 
Join Date: Jun 2004
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!
 
Old July 27th, 2004, 05:41 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to acdsky
Default

That was quick! Thanks all, perfect.





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





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