Modifying links design for a tumblr theme - css

I'm trying to modify the way links display in the theme I'm currently working on with the a:link a:hover method in a css file but it don't work and I can't understand why... Any help ? Thank you

You can try this (note a:link doesn't exist in CSS):
a {
text-decoration:none;
color:#000;
font-style:italic;
}
font
a:hover {
text-decoration:underline;
color:#000;
}
a:visited {
color:#000;
}
"a" is the link. text-decoration: none removes the underline, text-decoration: underline adds the underline. font-style:italic adds an italic to the link. the color #000 is black and using that color in a:visited ensures that the link stays black after it's visited (I didn't know if you would want that so I added it anyway).

Related

Changing H4 font colour in CSS

I am trying to change the colour of the font which appears in images in gallery pages such as this page on the site.
I would like to change the text below each image (such a Trail Necklace 111) from #666666 to #007faa.
I used the web inspector to identify that this is an H4 tag in a div class called portfoliotitle_3
It is also a link so altogether I've updated the following parts of the CSS, saved the CSS and refreshed the page a few times but the text colour doesn't change.
#contentwide .portfoliotitle h4 {
color: #007faa;
}
.portfoliotitle a,
.portfoliotitle a:visited {
color: #007faa;
}
#contentwide .portfoliotitle_3 h4 {
color: #007faa;
}
.portfoliotitle_3 a,
.portfoliotitle_3 a:visited {
color: #007faa !important;
}
.portfoliotitle_3 a:hover {
color: #007faa;
text-decoration: none !important;
}
I must be missing something very basic and if anyone can take a fresh look and give me some pointers, that would be very appreciated.
Many thanks
i think Thats because the page load style.css of the page after each reload
It's because of an anchor tag that has some important in color.. so you should probably change the anchor tag to change the color.
.portfoliotitle_3 a, .portfoliotitle_3 a:visited {
color:#007faa !important
}
Cascading is apply for the element a. You can delete this code in internal css style element.
.portfoliotitle_3 a, .portfoliotitle_3 a:visited {
color: rgb(85, 212, 255) !important;
}

CSS trouble - changing colour of a link in cookie bar

I've got a CSS prob i'd love some help with.
My site (www.melodylakerart.com) has a 'Read More' link in its cookie notice bar (to the right of the privacy notice).
The 'read more' link is currently only visible on mouse over. Since the cookie bar is black I therefore assume the link text is black untill mouseover
I just want to make the text a colour other than black so you can see the link without having to mouseover. I've tried the below CSS with no luck. Can anyone help?
.cn-more-info .cn-privacy-policy-link .cn-link .button {color: #feb8b4 !important;}
.cn-privacy-policy-link {color: #feb8b4;}
.cn-more-info .cn-privacy-policy-link .cn-link .button {color: #feb8b4;}
Link color can be changed via a:link or under a specific class
.cn-privacy-policy-link a:link
for example:
a:link {
color: red;
text-decoration: none;
}
a:visited {
color: green;
}
a:active {
color: black;
}
a:hover{
color: #bada55;
}
.test a:link{
color: yellow;
}
Example
<div class="test">Yellow link</div>
You can also change the link color on hover by a:hover or the link color after being clicked by a:visited or while being clicked with a:active
The problem is that you have this:
input[type="submit"], button, .button {... color: #000000!important; ...}
And that is the classic reason why !important is a bad practice.
If all other parts work as expected, you need to trigger one of the element's classes. For instance: cn-privacy-policy-link {color: #feb8b4!important;} will work.

How to disable text decoration with CSS?

So, I need to remove a visited link coloring from my navigation bar, as it will look ugly.
I have tried to use text-decoration: none; and color: white; but that does not seem to help it.
CSS for navigation
Actual code
I removed the actual links from the code, in the real version there is link but for this question links are replaced with #
In addition to Bariock's answer, this will help reset your <a> links in all circumstances to your specified css.
a:visited, a:hover, a:active, a:focus {
color: yourColor !important;
text-decoration: none !important;
outline: none !important;
}
The !important signifies that it has a higher precedence than that of other rules declaring the same values for the same selectors. Note: you can still style them separately such like you would with :hover.
a:visited{
color: your-color;
}
I edited the <a> tag to go around the <button> so the text is back to white now and the button actually works. It is no longer just "click text to visit link" the whole button works.
<button class="dropbtn">Community</button>
Try adding a !important to the end of the css styles like so:
a {
color: white !important;
}
Hope this helps!
I recommend you first set the style of the link tag, for example:
.dropdown a{ color:#fff }
now your text links inside the container with the class .dropdown will be as white color. Then you don't need to set a visited link color, unless you want to set it.
If you want to get rid the underline in the link, your style will be like this:
.dropdown a{ color:#fff; text-decoration: none; }

How to change the link color in a specific class for a div CSS

In my Page the following CSS is set:
a:link {
color: #0094DE;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #0094DE;
}
a:hover {
text-decoration: underline;
color: #DD127B;
}
I want to Change the Link color inside a div which has a class assigned to it.
I tried the following :
register:link{color:#FFFFFF;
}
Where register is the name of the div in which i want to change the link color.
How can i do that?
Also how to change the color for hover link over the same div?
.register a:link{
color:#FFFFFF;
}
It can be something like this:
a.register:link { color:#FFF; text-decoration:none; font-weight:normal; }
a.register:visited { color: #FFF; text-decoration:none; font-weight:normal; }
a.register:hover { color: #FFF; text-decoration:underline; font-weight:normal; }
a.register:active { color: #FFF; text-decoration:none; font-weight:normal; }
how about something like this ...
a.register:link{
color:#FFFFFF;
}
I think there is a confusion about what the OP is actually asking.
This solution:
a.register:link {color:#FFF}
...changes the color of a link whose class is "register". But that's not what the OP was asking.
And this solution:
.register a:link {color:#FFFFFF;}
...changes the color of a link that itself has no class but is placed inside of a div with class "register". And that's what the OP was asking.
Both of these answers are being upvoted here but only the second one is correct answer to the original question.
#register a:link
{
color:#fffff;
}
If you want to add CSS on a:hover to not all the tag, but the some of the tag, best way to do that is by using class. Give the class to all the tags which you want to give style - see the example below.
<style>
a.change_hover_color:hover {
color: white !important;
}
</style>
<a class="change_hover_color">FACEBOOK</a>
<a class="change_hover_color">GOOGLE</a>
I think you want to put a, in front of a:link (a, a:link) in your CSS file. The only way I could get rid of that awful default blue link color. I'm not sure if this was necessary for earlier version of the browsers we have, because it's supposed to work without a
smaller-size version:
#register a:link {color: #fff}

how do I make HTML links show hover style?

I have some HTML markup in my ASP.NET master page representing a basic navigation menu. THree words that link to three pages. My CSS and HTML are included below for your reference.
When I load the page, the links appear with the correct color (red). If I hover over a link, the link changes to the correct color (blue). So far, we're good. Clicking a link changes the link color to the correct color (yellow). The two remaining links are still red / blue as expected. Clicking a second link changes that link to yellow also. Now I have two yellow links. Neither yellow link displays the hover color (blue) like I'd prefer. Clicking the third link causes it to be yellow, too and none of the links display the hover style.
Although a link has been clicked, I'd like the color to be stored and have the hover color displayed. How do I accomplish this? This is an ASP.NET web application project but I'm only using straight HTML at this point.
/* --- css --- */
a:link
{
color: red;
text-decoration: none;
}
a:hover
{
color: blue;
text-decoration: none;
}
a:active
{
color: green;
text-decoration: none;
}
a:visited
{
color: yellow;
text-decoration: none;
}
/* --- HTML --- */
<p class="MenuItems">
Cars.
Trucks.
Vans.
</p>
As described here, the :hover declaration must come AFTER the :visited and :active declarations.
Basically, in the cascade of your current styles, you won't ever see the :hover color.
Your
a:hover
declaration must come after your
a:visited
declaration in the stylesheet because the visited state is currently taking priority. Always put hover at the end of the a styles declaration block to prevent this.
a:link -> a:visited -> a:active -> a:hover is the optimal ordering.
Just use this:
a:hover
{
color: blue ! important;
text-decoration: none ! important;
}
or as described - use this order:
a:link
{
color: red;
text-decoration: none;
}
a:active
{
color: green;
text-decoration: none;
}
a:visited
{
color: yellow;
text-decoration: none;
}
a:hover
{
color: blue;
text-decoration: none;
}

Resources