Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How Can I apply a css style to a dropdownlist?

Posted on 2004-04-28
12
Medium Priority
?
3,637 Views
Last Modified: 2012-06-27
I am applying a style for my form fields here it is:

cella_form {
font-size: 10px;
border: 1px;
border-color: 4BBA5C;
border-style: solid;
}

I have set the Css Class property for all the controls with the style name,it's showing fine for textboxes but dropdownlists are not affected, I want a solid green border to be shown.
I am using ASP.NET controls.
Can anybody tell me how to apply the style for the dropdownlist?
Thanks.
0
Comment
Question by:JessyEzzy
[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
  • 5
  • 2
  • 2
  • +2
12 Comments
 
LVL 4

Expert Comment

by:BrianPap22
ID: 10942628
A link to your actual page would be nice.

And you should have a period before the class name in the style sheet, eg ".cella_form {"
0
 
LVL 4

Expert Comment

by:BrianPap22
ID: 10942716
Furthermore, "#4BBA5C", not "4BBA5C".
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 10943560
>>Can anybody tell me how to apply the style for the dropdownlist?

Yes, you can't - at least in IE :-)
It's only supported in NS7 and Mozilla
0
Technology Partners: 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!

 

Assisted Solution

by:enscryptor
enscryptor earned 90 total points
ID: 10945784
Strictly speaking standard SELECT dropdown lists don't have borders in the sense that other elements do - you can't set it to none, change its width or apparently color.

The only things I've successfully manipulated are the background and text colors, font attributes and width. The height attribute has no effect either on the closed or opened (dropped) states but you can control the number of lines it drops open to with the HTML size attribute.

If you are really determined you can build your own dropdown list by overlaying a standard text input with a hidden list that you display whenever someone clicks your (fake) dropdown button. The only signifigant advantage to this technique is you can let someone type into the text field values that aren't yet on the list and add them to it dynamically for future quick reference. Which is why I bothered to work this all out ...

Let me know if you really HAVE to make the SELECT borders different and I'll send or post an example. But it is an awful lot of work ...
0
 
LVL 15

Assisted Solution

by:Daydreams
Daydreams earned 60 total points
ID: 10951246
Hi JessyEzzy,

You can style your font-size in IE, but not the border. The border can be styled only in Mozilla, Netsacape, and then only on the options.
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 10951266
I'm sure I've heard that before somewhere :-)
0
 
LVL 15

Expert Comment

by:Daydreams
ID: 10951460
> I'm sure I've heard that before somewhere :-)

sean I noticed your comment (above), I just wanted to add that you CAN add the font-size style for IE, and the border only for option in Mozilla. Just being more specific.. not trying to steal anyone's thunder here:)
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 10951506
That's okay DD, I don't have any thunder to steal - I'm too full of sunshine.
0
 
LVL 3

Author Comment

by:JessyEzzy
ID: 10958853
Here is a link to how the form looks like:

http://JessyEzzy.europe.webmatrixhosting.net/form.aspx
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 10958873
So what would you like to know?
0
 
LVL 3

Author Comment

by:JessyEzzy
ID: 10959268
Actually after what you said about it's not being supported in IE it seems that I can't do anything to it, even though the ones who's going to use the form are using IE, so there is nothing i need to know.
Thanks.
0
 
LVL 31

Accepted Solution

by:
seanpowell earned 150 total points
ID: 10959420
Oh okay :-)
I thought you wre looking for more...

If you ever decide to go the custom dhtml route:
http://webfx.eae.net/dhtml/select/jsGenerated.html

A bit of work for a select box, but it's there in case you need it.

Thanks,
Sean
0

Featured Post

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.

Question has a verified solution.

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

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
Suggested Courses

715 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