newb questions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dandyliondancer
    New Member
    • Jun 2008
    • 12

    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...
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    No to both.

    Always keep in mind that CSS is not a programming language and cannot modify anything. CSS stands for "style sheet".

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      Would
      Code:
      #element1:hover #element2 {
          color: red;
      }
      Not work?

      Comment

      • drhowarddrfine
        Recognized Expert Expert
        • Sep 2006
        • 7434

        #4
        He said not on a "subset" of another element.

        Comment

        • dandyliondancer
          New Member
          • Jun 2008
          • 12

          #5
          righto . . .

          if i had
          <span id ="element1">
          <a href="#null">so mething</a></span>
          </span>

          <span id="element2">s ome stuff</span>

          then the above-mentioned css wouldn't do anything...
          (right?)

          Comment

          • drhowarddrfine
            Recognized Expert Expert
            • Sep 2006
            • 7434

            #6
            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.

            Comment

            • dandyliondancer
              New Member
              • Jun 2008
              • 12

              #7
              thanks for the lesson . . .

              crystal clear now . . .

              Comment

              Working...