Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.

    GIF shows where to locate </> in the thread and or post editor toolbar.
    To learn more about how to use our BBCode feature, review our "How to post your code into threads" here.

    Thank you, Code Forum.

CSS Changing appearance of link A

SpongeBOB

Well-Known Coder
HI everyone,

I would like to have the unvisited link with a color, without underline.

and the visited link grey, without underline , with > in front and < in the back

I tried few thing without success:

[CODE lang="css" title="CSS"]a:link {
color: red;
text-decoration: none;
}
a:hover {
color:green;
text-decoration: none;
}
a:visited {
color:#888888;
text-decoration-line: none;
}
a:visited::after {
content: "<"
}[/CODE]


Thanks
 
What is working and what isn't? Does nothing work?

I would recommend first get the style for the visited link working on all the links, so you get the arrow placement correct. Then, take that code you know works and get the logic for visited / unvisited working. Then style your unvisited link as desired.
 
Thank you @Mutiny

So
[CODE lang="css" highlight="3,6" title="Highlighted = not working"]a:visited {
color:#888888;
text-decoration-line: none;
}
a:visited:after {
content: "<"
}[/CODE]

The color work, but the links are still underlined, and I do not have the < after...
 
As the
text-decoration-line: none
or
text-decoration: none

have both no effect on the visited I use this ->

[CODE lang="css" title="CSS"]a:visited {
color:#888888;
text-decoration: underline #Color_of_My_background
}[/CODE]

no the best but it "hide" the underline

No rest to add the > < ...
 
To remove the underline, text-decoration: none; should do the trick. Maybe it's being overwritten? You might need to add an !important, like text-decoration: none !important;.

Also, for the before and after content, you may need to make the parent link position: relative, then make the before and after elements position absolute and position the arrows as desired. You may also have to add additional padding left and right of the link so the arrows do not overlap other links.
 

Buy us a coffee!

Buy me a coffee.
Back
Top Bottom