Styles with anchors

Discussion in 'HTML' started by Michael Satterwhite, Feb 23, 2005.

  1. How can I independently control the color of the text and the underline in a
    stylesheet. Example, How could I make the text black and the underline
    blue?

    tia
    ---Michael
     
    Michael Satterwhite, Feb 23, 2005
    #1
    1. Advertising

  2. Michael Satterwhite

    Steve Pugh Guest

    Michael Satterwhite <satterwh.X$NO$S$> wrote:

    >How can I independently control the color of the text and the underline in a
    >stylesheet. Example, How could I make the text black and the underline
    >blue?


    Two ways, neither ideal:

    1.
    a:link {color: black; background-color: white; text-decoration: none;
    border-bottom: 1px solid blue;}

    2.
    a:link {color: blue; background-color: white;}
    a:link span {color: black; background-color: white;}
    <a href=""><span>link text</span></a>

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, Feb 23, 2005
    #2
    1. Advertising

  3. Michael Satterwhite

    mark | r Guest

    "Steve Pugh" <> wrote in message
    news:p...
    > Michael Satterwhite <satterwh.X$NO$S$> wrote:
    >
    > >How can I independently control the color of the text and the underline

    in a
    > >stylesheet. Example, How could I make the text black and the underline
    > >blue?

    >
    > Two ways, neither ideal:
    >
    > 1.
    > a:link {color: black; background-color: white; text-decoration: none;
    > border-bottom: 1px solid blue;}
    >
    > 2.
    > a:link {color: blue; background-color: white;}
    > a:link span {color: black; background-color: white;}
    > <a href=""><span>link text</span></a>


    <a href="">moo</a>

    a{color:#000;border-bottom:1px solid #00f;text-decoration:none}

    ?

    mark
     
    mark | r, Feb 23, 2005
    #3
  4. Michael Satterwhite

    Steve Pugh Guest

    "mark | r" <> wrote:
    >"Steve Pugh" <> wrote:
    >>
    >> a:link {color: black; background-color: white; text-decoration: none;
    >> border-bottom: 1px solid blue;}
    >>

    >a{color:#000;border-bottom:1px solid #00f;text-decoration:none}


    And the differences are?
    1. You'll method will also match any <a name=""> anchors that the
    author may include for backwards compatability.
    2. You've specified a colour without a background colour leading to
    potential clashes with user style sheets.
    3. You're using hex colours instead of keywords.

    Any reason why you decided that you're solution was worth posting as
    an addition to mine?

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, Feb 23, 2005
    #4
  5. Michael Satterwhite

    Richard Guest

    On Wed, 23 Feb 2005 15:00:01 +0000 Steve Pugh wrote:

    > "mark | r" <> wrote:
    >>"Steve Pugh" <> wrote:


    >>> a:link {color: black; background-color: white; text-decoration: none;
    >>> border-bottom: 1px solid blue;}


    >>a{color:#000;border-bottom:1px solid #00f;text-decoration:none}


    > And the differences are?
    > 1. You'll method will also match any <a name=""> anchors that the
    > author may include for backwards compatability.
    > 2. You've specified a colour without a background colour leading to
    > potential clashes with user style sheets.
    > 3. You're using hex colours instead of keywords.


    > Any reason why you decided that you're solution was worth posting as
    > an addition to mine?


    "YOU'RE Method".
    There is nothing wrong with using hex codes for "Color".
    Would it not be easier to define the color say as "#FFE" rather than it's
    worded counterpart?
    Not to mention the fact that using hex code is by far more space saving than
    say using "lightsteelblue" or perhaps "lemonchiffon" or "lavenderblush".
    Using hex codes also makes it easier on the machine in deciphering.
     
    Richard, Feb 23, 2005
    #5
  6. Michael Satterwhite

    Steve Pugh Guest

    "Richard" <Anonymous@127.001> wrote:
    >On Wed, 23 Feb 2005 15:00:01 +0000 Steve Pugh wrote:
    >> "mark | r" <> wrote:
    >>>"Steve Pugh" <> wrote:

    >
    >>>> a:link {color: black; background-color: white; text-decoration: none;
    >>>> border-bottom: 1px solid blue;}

    >
    >>>a{color:#000;border-bottom:1px solid #00f;text-decoration:none}

    >
    >> And the differences are?
    >> 1. You'll method will also match any <a name=""> anchors that the
    >> author may include for backwards compatability.
    >> 2. You've specified a colour without a background colour leading to
    >> potential clashes with user style sheets.
    >> 3. You're using hex colours instead of keywords.

    >
    >> Any reason why you decided that you're solution was worth posting as
    >> an addition to mine?

    >
    >"YOU'RE Method".


    I said solution not method, but thanks for pointing out the
    you're/your typo. Silly me.

    >There is nothing wrong with using hex codes for "Color".


    Indeed. I normally use hex values exclusively.

    I didn't intend for point 3 to be a criticism, I was merely listing
    the differences between the two suggested solutions.

    I suppose that the conjunction of points 1 and 2 (which are
    disadvantages) and point 3 (which is merely a triviality) makes it
    seem like 3 is also a disadvantage but that wasn't my intended
    meaning.

    >Would it not be easier to define the color say as "#FFE" rather than it's
    >worded counterpart?


    Um, no. The keywords exist because they are easier to remember.

    >Not to mention the fact that using hex code is by far more space saving than
    >say using "lightsteelblue" or perhaps "lemonchiffon" or "lavenderblush".


    On the other hand "khaki" is shorter than #ada96e
    Really, the few bytes saved or lost this way or that are neither here
    nor there.

    >Using hex codes also makes it easier on the machine in deciphering.


    Not really an issue. If (and it's a big if) there is any difference
    it's too small to be noticeable.

    The real issue is that in HTML 4.01 and hence in CSS2 there are only
    16 colour names defined. CSS 2.1 takes that up to 17! But to use the
    full X11 set of colour names you need to look at CSS3. Though browsers
    have tended to support them for many years now - but we want to stick
    to current standards, don't we?

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, Feb 23, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris M

    Bookmark Anchors and VB.NET

    Chris M, Oct 24, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    838
  2. =?Utf-8?B?UGF1bCBL?=

    Identifying calls from anchors

    =?Utf-8?B?UGF1bCBL?=, Jun 17, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    330
    =?Utf-8?B?UGF1bCBL?=
    Jun 18, 2004
  3. Lars Netzel

    What about Anchors (#) and ASP.NET?

    Lars Netzel, Jul 26, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    509
    Justin Beckwith
    Jul 27, 2004
  4. JohnZing

    redirect, parameters and anchors

    JohnZing, Aug 22, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    527
    David Jessee
    Aug 23, 2004
  5. Mark Oliver

    newbie - HTML Anchors

    Mark Oliver, Nov 20, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    419
    Mark Oliver
    Nov 20, 2004
Loading...

Share This Page