Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old June 29th, 2008, 02: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, 06:07 PM
drhowarddrfine's Avatar
Expert
 
Join Date: Sep 2006
Posts: 4,631
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, 10:30 PM
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Age: 18
Posts: 2,857
Default

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

He said not on a "subset" of another element.
Reply
  #5  
Old June 30th, 2008, 02: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, 05:17 AM
drhowarddrfine's Avatar
Expert
 
Join Date: Sep 2006
Posts: 4,631
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, 01:10 AM
Newbie
 
Join Date: Jun 2008
Posts: 12
Default

thanks for the lesson . . .

crystal clear now . . .
Reply
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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 network members.
Post your question now . . .
It's fast and it's free

Popular Articles