Solved

Odd CSS-related question

Posted on 2012-03-29
7
346 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Author Closing Comment

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

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 82

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
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.
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

707 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now