Skip to main content
martinv44029552
Inspiring
August 1, 2017
Answered

Links in Dreamweaver?

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 is closed to new replies. Start a new post to keep the conversation going.
    Nancy OShea
    Nancy OSheaCorrect 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

    3 replies

    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

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

    Thanks Nancy, I'll give that a go.

    Translate
    martinv44029552
    Inspiring
    August 3, 2017

    Thanks Nancy, worked a treat.

    Translate