Odd CSS-related question

Greetings,

I recently needed to take a quiz for front-end development skills and this one of the questions under CSS2:

Write the code used to set the foreground and background colors of a paragraph to the same foreground and background colors of the user's window.

Assuming I understand the question correctly, I was stumped by this.  One thing that confused me was, when it refers to "user's window", I assumed it meant browser window.  If that is the case, I'm not familiar with any CSS2 that would grab background and foreground colors of browser windows.

I then thought this was related to using JavaScript but it was under the CSS2>colors category.  

Anybody know if this is possible to do this using CSS2 standards?
LVL 1
max7Asked:
Who is Participating?
 
elliottbenzleConnect With a Mentor Commented:
I would agree with you. Using only CSS there is no way to pull the current users background color. I also have a problem with the phrase "user's window", is that an element name on the page? Is it referring to the <body> tag or <html> tag. Even if CSS could pull styles from other elements, what element is he referring to?

I think it's a bad question with no correct answer.
0
 
COBOLdinosaurConnect With a Mentor Commented:
auming that by the window they mean the page then the correct answer is probably just to code the paragragh with no color rule and let it natural inherit.  The question is obtuse IMO.

Cd&
0
 
OmniUnlimitedConnect With a Mentor Commented:
The only way I could interpret the question so that it makes any sense at all, would be to interpret "user's window" as the foreground and background of the current theme.
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
max7Author Commented:
Thanks a lot for confirming what I thought was precisely the case!
0
 
Dave BaldwinFixer of ProblemsCommented:
The question is wrong since there is no HTML element called "user's window".  If the question had been about the parent element, then the answer could be 'inherit'.
0
 
max7Author Commented:
Thanks DaveBaldwin ... so even if "user's window" was interpreted as "browser window" even using inherit still would not work for this using only CSS2 standards, right?
0
 
Dave BaldwinFixer of ProblemsCommented:
"browser window" is not an HTML element either.  As far as I know, 'inherit' only works with the immediate parent element.  Since there is no usable definition of the immediate parent element in the question, there can't be a defined answer, just a bunch of guesses like we've done on this page.  'color' and 'background' were defined in CSS1 if that means anything to you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.