Welcome Guest ( Log In | Register)



2 Pages V   1 2 >  
Reply to this topicStart new topic
> Need Help With Using Css, to format a SELECT list
Avalon
post Jan 12 2006, 02:06 PM
Post #1


Privileged Member
*********

Group: Members
Posts: 630
Joined: 12-August 05
From: Melbourne, Australia
Member No.: 10,624



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
Go to the top of the page
 
+Quote Post
Lozbo
post Jan 15 2006, 12:11 AM
Post #2


Super Member
*********

Group: Members
Posts: 282
Joined: 1-September 05
From: Wanatos
Member No.: 11,382



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
Go to the top of the page
 
+Quote Post
Avalon
post Jan 15 2006, 01:16 AM
Post #3


Privileged Member
*********

Group: Members
Posts: 630
Joined: 12-August 05
From: Melbourne, Australia
Member No.: 10,624



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
Go to the top of the page
 
+Quote Post
Tyssen
post Jan 15 2006, 04:47 AM
Post #4



***********

Group: Members
Posts: 1,161
Joined: 9-May 05
From: Brisbane, QLD
Member No.: 6,818



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?
Go to the top of the page
 
+Quote Post
Avalon
post Jan 15 2006, 05:17 AM
Post #5


Privileged Member
*********

Group: Members
Posts: 630
Joined: 12-August 05
From: Melbourne, Australia
Member No.: 10,624



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.
Go to the top of the page
 
+Quote Post
adly3000
post Feb 3 2006, 08:14 PM
Post #6


Member [Level 1]
****

Group: Members
Posts: 58
Joined: 31-January 06
Member No.: 17,937



is there a css code to change the background of that select or of its scroller?
Go to the top of the page
 
+Quote Post
Lozbo
post Feb 9 2006, 02:29 AM
Post #7


Super Member
*********

Group: Members
Posts: 282
Joined: 1-September 05
From: Wanatos
Member No.: 11,382



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...
Go to the top of the page
 
+Quote Post
Tyssen
post Feb 9 2006, 10:13 PM
Post #8



***********

Group: Members
Posts: 1,161
Joined: 9-May 05
From: Brisbane, QLD
Member No.: 6,818



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.
Go to the top of the page
 
+Quote Post
Avalon
post Feb 10 2006, 10:56 AM
Post #9


Privileged Member
*********

Group: Members
Posts: 630
Joined: 12-August 05
From: Melbourne, Australia
Member No.: 10,624



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.

This post has been edited by Avalon: Feb 10 2006, 10:56 AM