Connecting Tech Pros Worldwide Help | Site Map

newb questions

  #1  
Old 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...
  #2  
Old June 29th, 2008, 06:07 PM
drhowarddrfine's Avatar
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".
  #3  
Old June 29th, 2008, 10:30 PM
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,862
Provided Answers: 9

re: newb questions


Would
Expand|Select|Wrap|Line Numbers
  1. #element1:hover #element2 {
  2.     color: red;
  3. }
  4.  
Not work?
  #4  
Old June 30th, 2008, 12:57 AM
drhowarddrfine's Avatar
Expert
 
Join Date: Sep 2006
Posts: 5,521

re: newb questions


He said not on a "subset" of another element.
  #5  
Old 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?)
  #6  
Old June 30th, 2008, 05:17 AM
drhowarddrfine's Avatar
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.
  #7  
Old July 1st, 2008, 01:10 AM
Newbie
 
Join Date: Jun 2008
Posts: 12

re: newb questions


thanks for the lesson . . .

crystal clear now . . .
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
SWIG and char* newb questions :) code_berzerker answers 3 July 29th, 2008 09:35 PM
More threading newb questions Mike P answers 4 March 16th, 2007 08:35 PM
Newb questions: centered image; right bottom footer Richard Shewmaker answers 5 February 4th, 2006 11:45 AM
Some Newb Questions nick answers 1 July 17th, 2005 06:33 AM