Nov 21, 2009
Pages: 1, 2

Need Help With Using Css - to format a SELECT list

free web hosting

Read Latest Entries..: (Post #12) by iGuest on Oct 22 2008, 05:13 AM.
To apply css on select tag Need Help With Using Css Hello allI want to know that how could I apply the css on select tag. The problem is that I have a list of option of different sizes. I fixes the size of the select tag, now I m facing the problem in IE that I does not display the full text but mozilaa shows the full text. So what I do for this. Please help me...
read more.
Read the FIRST post of this Topic. - Express your Opinion! Contribute Knowledge :-).

Open Discussion > MODERATED AREA > Computers > Programming Languages > CSS (Cascading Style Sheets)

Need Help With Using Css - to format a SELECT list

Avalon
I thought I had Cascading Style Sheets (CSS) pretty much under control, but this has me stumped. What I want to do is format a SELECT drop-down list with a drop shadow as a background image, similar to what I have done with the textarea shown below. As you can see, I can't it get to work on the drop-down box.
user posted image
I can change the font color, font type, width and background color but I can't seem to use a background image like I can for an INPUT box.

I have tried various things without success, can someone please show me a working example of where they have managed to put an image in the background of a SELECT list? I'm getting very frustrated by it.

I had a similar problem trying to put a drop shadow image on a TEXTAREA, but I managed to overcome that one by using a discreet style tag in the textarea tag like this.
CODE
<textarea cols=36 rows=3 name="alt_text" style="width: auto; height: auto; border-style: inset; border-width: 1px; background-color: #FFFFFF; font-size: 10pt; background-image: url('img/drop_shadow.gif'); padding-left: 4px; color: #000000; font-family: Verdana,Arial,'Trebuchet MS'"></textarea>
I tried, but that doesn't work on the SELECT list either. sad.gif

 

 

 


Comment/Reply (w/o sign-up)

Lozbo
Greetings Avalon, I'm not sure if that is possible, i have never seen a css background set for a select list...

But if you could post the link to the site itself that you are developping it would be nice (and if you have seen something like the shadow you are trying to achieve around, post a link too).

I have a link to a site that has a lot of examples of how to achieve a full css formatted forms, with a tableless layout, I mean, pure (x)html divs and spans:

http://jeffhowden.com/code/css/forms/

Also, if someone is interested I have a link to a site which shows lots of ways of displaying tabular data with different kinds of CSS designs, I know it does not have to do a lot with this thread but I thought it might be helpful too:

http://icant.co.uk/csstablegallery/index.php?css=35

Comment/Reply (w/o sign-up)

Avalon
My site is http://www.mudmall.com and it's on the Custom Search page that I want to format the select box. The site still uses a lot of tables, I haven't got my head around a pure CSS site yet, I will in time.

The other problem I had was trying to use a change of opacity effect on a mouseover that would work in both Firefox and IE. I managed to find the answer to that problem thanks to jlhaslip via this link http://www.mandarindesign.com/opacity.html You can see the effect on the any of the thumbnails in my site.

I have searched high and low for an answer to my problem with select lists, but I don't think it is possible. Thanks for trying. smile.gif

Comment/Reply (w/o sign-up)

Tyssen
Form elements are very hard to style across browsers. In fact, this article suggests you can't achieve cross-browser compatability.
But aside from that, are you applying your background image to the select or option element?

Comment/Reply (w/o sign-up)

Avalon
I am trying to apply a background image to a <select> element... i.e. a drop-down list of values, not a file select control. Something similar to the one shown below, (the post color selection list from the shoutbox here) as you can see, font colors can be changed, as can font face, size and background color, but I can't put a background image in it.

user posted image

The link you provided does not seem to cover background images which do work in <input> boxes and <textarea> boxes which I have shown in my original post.

Comment/Reply (w/o sign-up)

adly3000
is there a css code to change the background of that select or of its scroller?

Comment/Reply (w/o sign-up)

Lozbo
Nice article Tyssen, some one took a lot of time to test this... I come to the conclusion that you dont HAVE to format it exactly the same for everybrowser, It would take too much time to fix little differences and if in the end is still usable, why should we worry that much?

adly300 There is a css code to change it, it would be like this:

CODE

select {background: white url(select-bg.gif) top left no-repeat;}


And for good browsers you can add a :hover pseudoattribute to the rule, and even a :focus...

Comment/Reply (w/o sign-up)

Tyssen
QUOTE(Lozbo @ Feb 9 2006, 12:29 PM) *

I come to the conclusion that you dont HAVE to format it exactly the same for everybrowser, It would take too much time to fix little differences and if in the end is still usable, why should we worry that much?

Exactly - the only people who are gonna look at your site in multiple browsers are web designers/developers.

Comment/Reply (w/o sign-up)

Avalon
QUOTE(Tyssen @ Feb 10 2006, 09:13 AM) *

Exactly - the only people who are gonna look at your site in multiple browsers are web designers/developers.

Even so, I would still like my site to look pretty much the same no matter which browser is used. Because of this I will try to avoid using formatting that is only applicable to one browser.

Comment/Reply (w/o sign-up)

Tyssen
QUOTE(Avalon @ Feb 10 2006, 08:56 PM) *

Even so, I would still like my site to look pretty much the same no matter which browser is used. Because of this I will try to avoid using formatting that is only applicable to one browser.

I'm not saying you shouldn't and I go to great lengths to get everything to look as similar as possible across browsers, but at the end of the day, if you're banging your head against a wall over just the tiniest details, then maybe you gotta step back and ask yourself how much it's worth to be exactly the same.

Comment/Reply (w/o sign-up)

Latest Entries

iGuest
To apply css on select tag
Need Help With Using Css

Hello all

I want to know that how could I apply the css on select tag. The problem is that I have a list of option of different sizes. I fixes the size of the select tag, now I m facing the problem in IE that I does not display the full text but mozilaa shows the full text. So what I do for this. Please help me

Comment/Reply (w/o sign-up)

iGuest
Replying to Avalon
Hi, I am looking to do exactly this on my own site. Http://www.Partfinder.Ie. But without much success to date I'm afraid, so I've had to use normal select box. I'd really appreciate some tips on this.
Regards, Rev.

Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Pages: 1, 2
Similar Topics

Keywords : Css Format


    Looking for css, format, select, list

Searching Video's for css, format, select, list
See Also,
advertisement


Need Help With Using Css - to format a SELECT list

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com