I want to have an alternative Link colour - once set in the page properties bit in dreamweaver I can't get it to do another option.... how do I get it to create a second option?? Thanks

Dani AI

Generated

Quick practical note for : Dreamweaver’s Page Properties sets the site-wide link colours, so to get a second (different) colour you need CSS that targets only the links you want. ’s class idea is the simplest when you only have a handful of links. was right to point at the global a rule — that’s what you’re overriding.

A reliable pattern is to apply a class to a container and style anchors inside it. That way you do not have to add a class to every single <a> and the rule is easy to manage:

/* site default */
a:link, a:visited {
  color: #0066cc;
}

/* alternate area — wrap links with <div class="alt-links"> */
.alt-links a:link,
.alt-links a:visited {
  color: #aa6600;
}
.alt-links a:hover,
.alt-links a:active {
  color: #ff8800;
}

If your new rule doesn’t win, inspect the link in the browser DevTools and check the computed style. Common causes: the default rule appears later in the cascade, a more specific selector or inline style is in effect, or the stylesheet order puts the override earlier. To resolve: place your override stylesheet after the generated Page Properties styles, increase selector specificity (e.g., body .alt-links a), or use the CSS Styles panel in Dreamweaver to create a rule like .alt-links a. Use !important only as a last resort.

Note accessibility and browser quirks: modern browsers restrict certain styling on :visited for privacy, though colour changes are allowed; always verify contrast for readability. Read more about selector precedence and visited link behavior on MDN: Specificity and :visited.

Recommended Answers

All 4 Replies

your could add some code like this

<html>
<head>
    <style type="text/css">
    <!--
    .textstyle{
        color: #aaaaaa;
    }
    -->
    </style>
</head>
<body>
    <a href="" class="textstyle">link</a>
</body>
</html>

you need to look at your style sheet and see what it says for the a:link element and then set that to the color you want.

If that doesnt help please could you repost your problem because I really dont properly understand it.

I have set that, however I would like to have a second option for a different colour - how do I set it to have more than one? Thanks

I think I understand now. Basically you need to just set a class for all the links you want to display in the alternate color.

like cerberus said above. If you need anymore help just post back.

btw. if they are all in the same area there is a different way of doing it. please let me know if they are.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.