Skip to main content
martinv44029552
Inspiring
August 1, 2017
Answered

Links in Dreamweaver?

  • August 1, 2017
  • 1 reply
  • 429 views

Hello

I have 5 links on one of my web pages, I'd like 2 of them to be a different colour to the other 3.

At the moment, I don't seem to be able to change the colour, without it affecting them all?

Is there a way to isolate the 2, I wish to change?

Many thanks for any help.

    This topic has been closed for replies.
    Correct answer Nancy OShea

    Give the targeted anchor tags a unique ID or a re-usable class name.

    <a id="myID1" href=#">Link 1</a>

    <a class="myClass" href=#">Link 2</a>

    CSS

    #myID {color: red}

    .myClass {color: blue}

    Unique IDs have higher specificity than re-usable classes.  But either one should work.

    Nancy

    1 reply

    Nancy OShea
    Community Expert
    Nancy OSheaCommunity ExpertCorrect answer
    Community Expert
    August 1, 2017

    Give the targeted anchor tags a unique ID or a re-usable class name.

    <a id="myID1" href=#">Link 1</a>

    <a class="myClass" href=#">Link 2</a>

    CSS

    #myID {color: red}

    .myClass {color: blue}

    Unique IDs have higher specificity than re-usable classes.  But either one should work.

    Nancy

    Nancy O'Shea— Product User & Community Expert
    martinv44029552
    Inspiring
    August 1, 2017

    Thanks Nancy, I'll give that a go.

    martinv44029552
    Inspiring
    August 3, 2017

    Thanks Nancy, worked a treat.