Showing posts with label Link Styling. Show all posts
Showing posts with label Link Styling. Show all posts

How to Add CSS Code in Classic Blogger

Using New Blogger? We provide step-by-step instructons on adding CSS code in our post Adding CSS Code to Eliminate Image Borders. Just follow the directions right to the end and enter your CSS code instead of ours and you'll be all set!



Classic Blogger went away in 2020. We'll keep this blog post around for a while in case some folks still have access to it.

Step 1

From the Blogger dashboard click Theme on the left sidebar.

Step 2

Next, click the Customize button. The Blogger Theme Designer window should display as seen in the image.

Step 3

At the bottom of the left column click Advanced. The right side of the window displays a list of customizable items. Scroll to the bottom of the list and click Add CSS as shown in the image below.


Step 4

After clicking Add CSS, a blank area opens up to the right. Type the CSS code you want to add, or copy and paste into this area.




Step 4

When finished, don't forget to save your changes by clicking the SAVE button.



Styling Sidebar Links (Link, Visited, Hover, Active) for Blogger

Most Blogger templates have a list of variables in the beginning of the HTML that specify font size and font color for the various portions of text on the blog; e.g. post body, sidebar, footer.

However, if an element doesn't have a direct specification - it just defaults to the blog font color and some percentage of the blog text. In this case, the changes you try to make on the Layout window (Fonts and Colors) just don't work.

I had a template that I wanted to customize the font-size and font color of the links on the sidebar (labels and post titles from a feed). Since there was no specification for sidebar links, I created some.

I've used this code on several templates, including Minima and Thisaway. It should work on most modern templates.

Copy and paste this code at the beginning of your HTML where the other CSS styling elements are. Don't forget to make a backup of your blog template first!
  • #sidebar li a:link {color:#003399;text-decoration:none;}
  • #sidebar li a:visited {color:#66CC66;text-decoration:none;}
  • #sidebar li a:hover {color:#cc0000;background-color:#FFFF99;text-decoration:underline;}
  • #sidebar li a:active {color:#FFFFFF;text-decoration:none;}

Let’s discuss the CSS styling for links. First of all, the link states must be in this particular order (link, visited, hover, and active). Here are their definitions.
  • a:link - the color of the link when the blog first opens; an un-visited link
  • a:visited - the color of the link after the link has been clicked on and the post viewed
  • a:hover - the color that displays when the mouse cursor hovers over the link
  • a:active - the color of the link at the very moment that it is clicked

If you don’t know CSS, here is an explanation of the code above.

  • color:#000000; - the 6-digit hexadecimal code representing the font color. See * below.
  • background-color:#000000; - the background color behind the link.
  • text-decoration:none; - usually links are underlined in text, but not on the sidebar. However, links look nice underlined in the hover state.


* There are many websites that provide the 6-digit hexadecimal codes for the over 200 colors in the web-safe color palette. If you would like to see some additional color codes, see our blogs:


Cheers!

If this post has been helpful, please consider linking to our blog or sharing!  Bookmark and Share