Forum Moderators: not2easy
#myID {
a:link {color:#ffffff}
} Then referencing it: <a href="https:\\etc" id="myID" target="_blank">CLICK HERE</a> I don't want to do this inline as there are many links to style identically, so I need a class or ID, but I cannot get the syntax correct. Can you help? a.green:link {color: #00ff00;}
a.green:visited {color: #00ccff;}
a.green:hover {color: #00eeaa;} Referencing it: <a href="https://example.com/page.html" class="green" target="_blank">CLICK HERE</a> or <a class="green" href="https://example.com/page.html" target="_blank">CLICK HERE</a>
.classname a:link {blahblah}
#idname a:link {blahblah}
and so on as in not2easy's examples (which are the forms to use if the link itself has a classname). The : colons refer to three pseudo-classes that apply specifically to links; they should be self-explanatory.
!important to the line but it made no difference. I won't ask for more help on this, I just have to investigate.
<a href="https:\\etc" id="myID"The syntax for this would be a#myID {blahblah}
but as not2easy says, this is almost certainly not what you want anyway.
a#myID works for a single link, which is a step forward. I need to find the syntax for including that within a DIV. Currently, the enclosing DIV for all the links seems to be working: <div class="myDIV {
background-color:#4E1B1C;
color:#ffffff;
padding-bottom:12px;
} What I need to do, if humanly possible, is include the a#myID into myDIV so that it affects ALL the links. I have tried adding a:link color:#fff; and a: color:#fff; and even a colour:#fff but nothing works. I feel that this should be easy. It's basically setting the colour (color to you) of hyperlinks! I don't know why it is giving me such grief. Thanks again for your advice. This is probably some override which I have to discover, but there is so little code between the DIV and the link that it's hard to know what that override might be.
<div class=" is not part of the css, that belongs in the html of the page where it is to be seen and needs an end > and a closing </div> <a id="myID" href="https://example.com/page.html" target="_blank">CLICK HERE</a> <a class="myID" href="https://example.com/page.html" target="_blank">CLICK HERE</a> <div id="myID">content</div> you would need to include the definitions for links in the #myID in the css. That way all the links in <div id="myID"> would take on #myID styles. #myID {
text-align: left;
padding: 20px;
font-family: Georgia;
display: block;
a:link colour: #00ff00;
a:visited colour: #00ccff;
a:hover colour: #00eeaa;
} So that it can define everything in your <div id="myID">