Connecting Tech Pros Worldwide Help | Site Map

newb questions

 
LinkBack Thread Tools Search this Thread
  #1  
Old June 29th, 2008, 01:48 PM
Newbie
 
Join Date: Jun 2008
Posts: 12
Default newb questions

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...
Reply
  #2  
Old June 29th, 2008, 05:07 PM
drhowarddrfine's Avatar
Expert
 
Join Date: Sep 2006
Posts: 5,287
Default

No to both.

Always keep in mind that CSS is not a programming language and cannot modify anything. CSS stands for "style sheet".
Reply
  #3  
Old June 29th, 2008, 09:30 PM
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Age: 18
Posts: 4,205
Default

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

He said not on a "subset" of another element.
Reply
  #5  
Old June 30th, 2008, 01:10 AM
Newbie
 
Join Date: Jun 2008
Posts: 12
Default

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?)
Reply
  #6  
Old June 30th, 2008, 04:17 AM
drhowarddrfine's Avatar
Expert
 
Join Date: Sep 2006
Posts: 5,287
Default

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.
Reply
  #7  
Old July 1st, 2008, 12:10 AM
Newbie
 
Join Date: Jun 2008
Posts: 12
Default

thanks for the lesson . . .

crystal clear now . . .
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

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 220,989 network members.