Solved

Odd CSS-related question

Posted on 2012-03-29
7
359 Views
Last Modified: 2012-03-29
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?
0
Comment
Question by:max7
7 Comments
 
LVL 4

Accepted Solution

by:
elliottbenzle earned 200 total points
ID: 37782963
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
 
LVL 53

Assisted Solution

by:COBOLdinosaur
COBOLdinosaur earned 200 total points
ID: 37783240
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
 
LVL 17

Assisted Solution

by:OmniUnlimited
OmniUnlimited earned 100 total points
ID: 37783393
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Closing Comment

by:max7
ID: 37783462
Thanks a lot for confirming what I thought was precisely the case!
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 37783485
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
 
LVL 1

Author Comment

by:max7
ID: 37783514
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
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 37783571
"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

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
HTML5 storage and web apps 11 44
Triple line in an alert message 4 19
html form layout 4 34
Web page design problem 3 12
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question