[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

how to give height to  <select ?

Posted on 2009-06-30
7
Medium Priority
?
535 Views
Last Modified: 2012-05-07
i am giving style to select but it's not taking the height
.form{height:33px; margin-top:-1px;}
 
.form select{width:199px; height:60px; border-color:#919191; border-width:1px; background-color:#ffffff; border-style:solid; padding-left:12px; padding-top:5px; color:#000000;}
 
 
---------
<div class="form"><select>
<option selected="selected">select</option>
<option value="Corporate Advisory">Corporate Advisory</option>
<option value="Executive Search">Executive Search</option>
</select>
</div>

Open in new window

0
Comment
Question by:arunprasher
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 29

Expert Comment

by:David H.H.Lee
ID: 24752571
Hi arunprasher,
Just assign the <select>'s size property to 2 and check the different.
eg:
<select size=2>
0
 

Author Comment

by:arunprasher
ID: 24753397
here i want to show only one row (select) i just want to increase the height not to show two entries

just (select)  should be thier
(two should not be their)
0
 
LVL 29

Expert Comment

by:David H.H.Lee
ID: 24759986
That CSS's height overridden effect may be vary based on different browser and I don't think I.e is support that changes. Probably you need to build custom control that similar to <select> control using some components like <div> or <span> combine with client script such as javascript, then you can adjust the control's height easily. But, this may consume a lot of efforts to do that.  
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 24770406
arunpasher,

xcom is correct: "I don't think [IE] is support that changes."

You can't apply a height to a <select> as IE won't render it.  Firefox will, but no browser will show two options for a drop-down...it goes against the HTML specs.



0
 
LVL 29

Accepted Solution

by:
David H.H.Lee earned 1000 total points
ID: 24868204
The closer/simpliest solution is using existing <select> control and set its height as preferred. Then, use some client script to make it run as single selection using <select> control.
<select multiple style="height:76px" onchange="javascript:onlyone
 
(this);">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
 
<script>
function onlyone(obj){
 var intTotal=0;
 
for(i=0;i<obj.length;i++){
   if(intTotal>=1){
     obj[i].selected=false;
   }
 
   if(obj[i].selected){
     intTotal+=1;
   }
 }
}
</script>

Open in new window

0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 24875046
x_com,

What is that code supposed to do?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question