Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Odd CSS-related question

Posted on 2012-03-29
7
355 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

809 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