473,385 Members | 1,333 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

CSS & <OPTION // "Class" Related Question

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

Aug 23 '07 #1
4 2030
re********@gmail.com wrote:
<style>
<style type="text/css">

I hope you have it within the `head' element.
#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'.
</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.
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
Aug 23 '07 #2
On Aug 23, 9:02 am, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
rebecca...@gmail.com wrote:
<style>

<style type="text/css">

I hope you have it within the `head' element.
#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'.
</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.

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.

Aug 23 '07 #3
re********@gmail.com wrote:
[...] Thomas 'PointedEars' Lahn [...] wrote:
>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.
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.
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?
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
Aug 23 '07 #4
Thomas 'PointedEars' Lahn said the following on 8/23/2007 10:02 AM:
re********@gmail.com wrote:
<snip>
>>
<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.
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.
>
>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/
Aug 23 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Eric A. Forgy | last post by:
Hello, I am just learning Java and am trying to write a method that does something like //=========================================== public Static List find(double array,double val,String...
4
by: Jian H. Li | last post by:
Hello, What's the essential differences between the two ways of "class::member" & "object.member"(or object_pointer->member)? class C{ public: void f() {} int i; };
3
by: Alexander Farber | last post by:
Hi, does anyone have an idea, why do I get the following error (I have to use g++296 on RedHat Linux as compiler): In file included from r_dir.cpp:9: r_obey.h:262: declaration of `const...
4
by: barney | last post by:
Hello, I' m using .NET System.Xml.XmlDOcument. When I do the following: XmlDocument xml = new XmlDocument(); xml.Load("blah"); .... xml.Save("blub"); I've got the problem that the following...
5
by: martin | last post by:
Hi, I would be extremly grateful for some help on producing an xml fragemt. The fragment that I wish to produce should look like this <Addresses> <Address>&qout;Somebody's Name&quot;...
6
by: Chris Fink | last post by:
Does anyone know it is possible to include a small image(.gif .jpeg) within a <SELECT><option> so that the user would see the option text as well as a little image(icon) in the option? I know this...
8
by: cj | last post by:
I've seen examples of web services written with <%@ WebService Language ="Vb" Class=".... at the top. Is it not used in VB 2008?
36
by: Roedy Green | last post by:
The only browser I have encountered that supports <colgroup><col class="behold"></colgroup> to apply a CSS style to a whole column, is Microsoft Internet Explorer. I have been told it SHOULD NOT...
1
by: ismailc | last post by:
Hi, I need help please. Update system to to new version & moved on to .Net2 But now my code that worked in my .Net1 xslt does not work. .Net1 fine: <xsl:stylesheet...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.