Connecting Tech Pros Worldwide Forums | Help | Site Map

CSS & <OPTION // "Class" Related Question

rebeccatre@gmail.com
Guest
 
Posts: n/a
#1: Aug 23 '07
please help me with this,

<style>
#a, option.message {background-color: green; color: white;}
#b, option.message {background-color: yellow; color: black;}
</style>

<select id="thisselect">
<option id="thisone" class="message">THANK YOU</option>
</select>

please help me change the select option to the B style css above, also
if my syntax could be better elsewhere


Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a
#2: Aug 23 '07

re: CSS & <OPTION // "Class" Related Question


rebeccatre@gmail.com wrote:
Quote:
<style>
<style type="text/css">

I hope you have it within the `head' element.
Quote:
#a, option.message {background-color: green; color: white;}
#b, option.message {background-color: yellow; color: black;}
There is little point in this stylesheet, as the second declaration for the
selector `option.message' supersedes the first one. It is semantically
identical to

#a {background-color: green; color: white;}
#b, option.message {background-color: yellow; color: black;}

But you appear to have no elements with ID `a' or `b' in your markup, so
the first selector does not match, and the second will match only for
`option.message'.
Quote:
</style>
>
<select id="thisselect">
<option id="thisone" class="message">THANK YOU</option>
</select>
>
please help me change the select option to the B style css above,
Sorry, I really don't understand what you mean. If I would have to make
an educated guess, I would assume that you have been testing with Internet
Explorer or another UA that does not support styling form controls the way
you want it.
Quote:
also if my syntax could be better elsewhere
It would have been better posted to
comp.infosystems.www.authoring.stylesheets, as plain CSS questions are
off-topic here.


PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
rebeccatre@gmail.com
Guest
 
Posts: n/a
#3: Aug 23 '07

re: CSS & <OPTION // "Class" Related Question


On Aug 23, 9:02 am, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
Quote:
rebecca...@gmail.com wrote:
Quote:
<style>
>
<style type="text/css">
>
I hope you have it within the `head' element.
>
Quote:
#a, option.message {background-color: green; color: white;}
#b, option.message {background-color: yellow; color: black;}
>
There is little point in this stylesheet, as the second declaration for the
selector `option.message' supersedes the first one. It is semantically
identical to
>
#a {background-color: green; color: white;}
#b, option.message {background-color: yellow; color: black;}
>
But you appear to have no elements with ID `a' or `b' in your markup, so
the first selector does not match, and the second will match only for
`option.message'.
>
Quote:
</style>
>
Quote:
<select id="thisselect">
<option id="thisone" class="message">THANK YOU</option>
</select>
>
Quote:
please help me change the select option to the B style css above,
>
Sorry, I really don't understand what you mean. If I would have to make
an educated guess, I would assume that you have been testing with Internet
Explorer or another UA that does not support styling form controls the way
you want it.
>

Sure, can you respectfully run that script I provided? IE
implemention is just fine :-)


like, build 2 functions


stylesheets 1 (WHTIE)
stylesheets 2 (PURPLE)

function testbed18(){
change to stylesheets 1 attributes for a select option
}

function testbed21(){
change to stylesheets 2 attributes for a select option
}



i hope is this explains better, as long as it functions i will be a
happy camper :-) thank you so much for any help in advance.





Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a
#4: Aug 23 '07

re: CSS & <OPTION // "Class" Related Question


rebeccatre@gmail.com wrote:
Quote:
[...] Thomas 'PointedEars' Lahn [...] wrote:
Quote:
>Sorry, I really don't understand what you mean. If I would have to make
>an educated guess, I would assume that you have been testing with Internet
>Explorer or another UA that does not support styling form controls the way
>you want it.
>
Sure, can you respectfully run that script I provided?
You have posted no script at all. You have posted what looked like a
cascading stylesheet and maybe tag-soup HTML.
Quote:
IE implemention is just fine :-)
If you mean your stylesheet works as described in IE 4+/Win, that is
probably correct. However, the redundancy in the first rule, and the
fact that some controls cannot be fully styled in MSHTML, remains.
Quote:
like, build 2 functions
>
>
stylesheets 1 (WHTIE)
stylesheets 2 (PURPLE)
>
function testbed18(){
change to stylesheets 1 attributes for a select option
}
>
function testbed21(){
change to stylesheets 2 attributes for a select option
}
And now?
Quote:
i hope is this explains better,
Hardly. It would appear that you have to understand CSS first (what it is,
how it works), which is beyond the scope of this newsgroup. Try to
understand what I wrote about it, then try the newsgroup I mentioned before.


PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Randy Webb
Guest
 
Posts: n/a
#5: Aug 23 '07

re: CSS & <OPTION // "Class" Related Question


Thomas 'PointedEars' Lahn said the following on 8/23/2007 10:02 AM:
Quote:
rebeccatre@gmail.com wrote:
<snip>
Quote:
Quote:
>>
><select id="thisselect">
><option id="thisone" class="message">THANK YOU</option>
></select>
>>
>please help me change the select option to the B style css above,
>
Sorry, I really don't understand what you mean.
What they mean is what they asked. "Please help me change the select
option to the B style above". Seems pretty straightforward in that they
are wanting to change the style of a select element via Javascript.
Quote:
If I would have to make an educated guess, I would assume that you have
been testing with Internet Explorer or another UA that does not support
styling form controls the way you want it.
Your guess, whether right or wrong, is irrelevant as you didn't
understand the original question/desire of the OP.
Quote:
>
Quote:
>also if my syntax could be better elsewhere
>
It would have been better posted to
comp.infosystems.www.authoring.stylesheets, as plain CSS questions are
off-topic here.
The question had nothing to do with CSS other than manipulating CSS
styles via JS.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Closed Thread