newb questions 
June 29th, 2008, 02:48 PM
| | Newbie | | Join Date: Jun 2008
Posts: 12
| | |
please forgive these questions if they are obvious, but if you dont mind clearing something up for me:
1. is it possible to include html or javascript inside a css file? if so what is the format?
2. is it possible to use the hover or link properties of one css element to change the properties of another css element which is not a subset of the first element? (eg?)
thanks for your indulgence...
| 
June 29th, 2008, 06:07 PM
|  | Expert | | Join Date: Sep 2006
Posts: 5,521
| | | re: newb questions
No to both.
Always keep in mind that CSS is not a programming language and cannot modify anything. CSS stands for "style sheet".
| 
June 29th, 2008, 10:30 PM
|  | Moderator | | Join Date: Jun 2007 Location: York, England, with wolves.
Posts: 4,862
Provided Answers: 9 | | | re: newb questions
Would -
#element1:hover #element2 {
-
color: red;
-
}
-
Not work?
| 
June 30th, 2008, 12:57 AM
|  | Expert | | Join Date: Sep 2006
Posts: 5,521
| | | re: newb questions
He said not on a "subset" of another element.
| 
June 30th, 2008, 02:10 AM
| | Newbie | | Join Date: Jun 2008
Posts: 12
| | | re: newb questions
righto . . .
if i had
<span id ="element1">
<a href="#null">something</a></span>
</span>
<span id="element2">some stuff</span>
then the above-mentioned css wouldn't do anything...
(right?)
| 
June 30th, 2008, 05:17 AM
|  | Expert | | Join Date: Sep 2006
Posts: 5,521
| | | re: newb questions
Correct. It's the "cascade" part of CSS. If you want to refer to other elements of the page, then you would need to reference the DOM (Document Object Model), and the only way to do that is with javascript, a programing language.
There are "selectors", in CSS, which are methods of affecting sibling elements in the same cascade, from parent through child, but I don't think that's what you want.
| 
July 1st, 2008, 01:10 AM
| | Newbie | | Join Date: Jun 2008
Posts: 12
| | | re: newb questions
thanks for the lesson . . .
crystal clear now . . .
|  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 225,702 network members.
|