SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    100% Windoze-free earther's Avatar
    Join Date
    Feb 2003
    Location
    Linuxland
    Posts
    2,788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Two anchor related questions

    I have found a way to make the anchors bold in within the p element but I also want to have an option of these two anchor styles within the same p element:

    1) Just how do I accomplish this effect? within one anchor??

    2) How can I also have the option of an anchor that looks like this all within the same p element??

    Should be an easy fix but I haven't stumbled onto it yet. Thanks.

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Nice use of inheritance, but inevitably you'll have to use a class to define one of the styles. Here's an example:

    CSS:
    Code:
    p a {
      font-weight: bold;
      color: brown;
    }
    p a.other {
      font-style: italic;
      font-weight: normal;
    }
    HTML:
    Code:
    <p>For link style one, <a href="#">Click Here</a>. Otherwise, for the other style, <a href="#" class="other">Click Here</a>.</p>
    Your "other" class will inherit the brown color and bold weight from the "p a" rule, but your weight declaration in the "other" class will override the bold setting and make it normal again.

    Hope this helps!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •