473,387 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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...
Jun 29 '08 #1
6 1198
drhowarddrfine
7,435 Expert 4TB
No to both.

Always keep in mind that CSS is not a programming language and cannot modify anything. CSS stands for "style sheet".
Jun 29 '08 #2
Markus
6,050 Expert 4TB
Would
Expand|Select|Wrap|Line Numbers
  1. #element1:hover #element2 {
  2.     color: red;
  3. }
  4.  
Not work?
Jun 29 '08 #3
drhowarddrfine
7,435 Expert 4TB
He said not on a "subset" of another element.
Jun 29 '08 #4
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?)
Jun 30 '08 #5
drhowarddrfine
7,435 Expert 4TB
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.
Jun 30 '08 #6
thanks for the lesson . . .

crystal clear now . . .
Jul 1 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Xizor | last post by:
Ok, I'm new to PHP and MySQL. I've been going through tutorials, reading the documentation, and looking through web sites. PHP to me seems great! With MySQL it seems even better. However, I'm an...
1
by: nick | last post by:
Hi - apologies if these have been asked before. I've been looking around, but can't find answers to my question. Anyway... I'm an experienced programmer with JSP, ASP, and ASP.NET and am...
20
by: Chad Everett | last post by:
Hi all, I am new to the group. Trying to learn Python programming on my own. I am working through Michael Dawson's Book Python Programming for the absolute beginner. I am tring to write a...
3
by: code_berzerker | last post by:
Hi i'm relatively new to Python and my C/C++ knowledge is near to None. Having said that I feel justified to ask stupid questions :) Ok now more seriously. I have question refering to char* used...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.