Loading ...
Sorry, an error occurred while loading the content.
 

Re: [NH] 1 CSS, 3 link decoration colors

Expand Messages
  • Don Passenger
    Welcome, You can set more than one set of link definations in the style sheet and then call the one you want. for example (this is an internal style sheet in
    Message 1 of 3 , Jul 20, 2001
      Welcome,

      You can set more than one set of link definations in the style sheet and
      then call the one you want.

      for example (this is an internal style sheet in the head tags):
      <STYLE TYPE="text/css">
      <!--
      A.whitelink {color:#ffffff; font-weight:bold}
      A:visited {color:#ff0000; text-decoration:underline;}
      A:hover {color:#ff0000;}
      A.bluelink {color:#0000ff; font-weight:bold}
      A:visited {color:#ff0000; text-decoration:underline;}
      A:hover {color:#ff0000;}
      -->
      </STYLE>


      Then when you want to use one:
      <A HREF="filename.html" class="whitelink">link</A>
      <A HREF="filename.html" class="bluelink">link</A>

      And off you go.

      NOTE: hover doesn't work in netscape! So links don't highlight.


      ---
      Don Passenger
      mailto:dpasseng@...
      personal: http://www.iserv.net/~dpasseng
      work: http://www.grcourt.org
      ----- Original Message -----
      From: "Luciano" <luc-lists@...>
      To: <ntb-html@yahoogroups.com>
      Sent: Friday, July 20, 2001 11:48 AM
      Subject: [NH] 1 CSS, 3 link decoration colors


      > Hi, folks, let me introduce myself for I just joined the list. My
      > name is Luciano, I live in Brazil. I'm not a designer, but I've been
      > trying hard to learn HTML so that I can build my own site. So far,
      > everything is going fine though quite slow, especially because I
      > sometimes I get stuck with something and take many hours to get out
      > of it.
      >
      > Currently, I struggle with the following challenge: suppose I have
      > many pages formatted by a single style sheet, called "style1.css". I
      > want to decorate every link with some background color, but only when
      > the mouse flies over the link, so I am using a:hover {property:
      > value} etc. Problem: I want to decorate every http link with a black
      > background and every mailto: link with a blue background. Besides, I
      > want no decoration at all in any link that is placed inside a table.
      >
      > One comment about the tables: I had thought of using SSI, but then
      > another problem kicks in: the table is supposed to contain my brand,
      > with a link to my Home page, in case someone saves a page on disk and
      > it somehow finds its way to someone else's desk. Thus the link to my
      > page would be always there, even if the viewer is off-line. So I
      > really need no decoration at all in the table, because it would
      > definitely clash with the color and general appearance of the table.
      >
      > I'd really appreciate any ideas. Thanks in advance,
      > Luciano ES
      > luc-lists@...
      >
      >
      >
      >
      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      >
      >
    • ceh
      ... From: Luciano To: Sent: Friday, July 20, 2001 10:48 AM Subject: [NH] 1 CSS, 3 link
      Message 2 of 3 , Jul 20, 2001
        ----- Original Message -----
        From: "Luciano" <luc-lists@...>
        To: <ntb-html@yahoogroups.com>
        Sent: Friday, July 20, 2001 10:48 AM
        Subject: [NH] 1 CSS, 3 link decoration colors


        > Currently, I struggle with the following challenge: suppose I have
        > many pages formatted by a single style sheet, called "style1.css". I
        > want to decorate every link with some background color, but only when
        > the mouse flies over the link, so I am using a:hover {property:
        > value} etc. Problem: I want to decorate every http link with a black
        > background and every mailto: link with a blue background. Besides, I
        > want no decoration at all in any link that is placed inside a table.

        No problem. In your style sheet just put something like:

        a.http:hover {background-color: black;}
        a.mailto:hover {background-color: blue; }

        Then in your html page put:

        <a href="somepage.html" class="http">http link</a>
        for a http link and:
        <a href=mailto:somebody@... class="mailto">mailto link</a>

        For links inside a table, just leave out the "class" attribute and it will
        be displayed with just the default properties. Pretty cool eh? Style sheets
        make it really easy to do stuff like this, although it does take a while to
        learn.

        Emmett Hawkins
      • Don Passenger
        If you mean that the user will look at it on-line and then save it to his or her hard disk, that will work fine with ssi because they are saving the rendered
        Message 3 of 3 , Jul 20, 2001
          If you mean that the user will look at it on-line and then save it to his or
          her hard disk, that will work fine with ssi because they are saving the
          rendered page. However, if the user saves the page to their hard disk, any
          relative links are not workable because it will look at the hard drive for
          those. Avoid that by either including full url's in links or by including a
          base href= tag in the head section of the page.

          ---
          Don Passenger
          mailto:dpasseng@...
          personal: http://www.iserv.net/~dpasseng
          work: http://www.grcourt.org
          ----- Original Message -----
          From: "Lotta" <loro@...>
          To: <ntb-html@yahoogroups.com>
          Sent: Friday, July 20, 2001 4:23 PM
          Subject: Re: [NH] 1 CSS, 3 link decoration colors


          > Hello Luciano,
          >
          > Welcome to the list!
          >
          > >One comment about the tables: I had thought of using SSI, but then
          > >another problem kicks in: the table is supposed to contain my brand,
          > >with a link to my Home page, in case someone saves a page on disk and
          > >it somehow finds its way to someone else's desk. Thus the link to my
          > >page would be always there, even if the viewer is off-line.
          >
          > I can't say I'm totally sure of this but as far as I know SSI is no
          problem
          > when saving pages to disk. After all the content is _included_ before the
          > pages are served to the browser. If you view source you can see that it's
          > there as if it had been written in the html document. Don't trust me on
          > this but try it out. I think it will work.
          >
          > Lotta
          >
          > [Non-text portions of this message have been removed]
          >
          >
          >
          >
          > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
          >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.