skip to Main Content

I don’t know what CSS code I should use to make them and the only other one I could find had to do with Class1 and Class2 but I don’t even know how to implement those onto the link. I’m also doing it from an icon list widget on WordPress if that helps. Thanks in advance if you know what I am doing wrong. I think it has something to do with not labeling the links in a way

a.class1 {color:red;}
a.class1:link  {text-decoration: none; color: red;}
a.class1:visited {text-decoration: none; color: red;}
a.class1:hover {text-decoration: underline; color: red;}
a.class1:active {text-decoration: none; color: red;}


a.class2 {color:blue;}
a.class2:link {text-decoration: none; color: blue;}
a.class2:visited {text-decoration: none; color: blue;}
a.class2:hover {text-decoration: underline; color: blue;}
a.class2:active {text-decoration: none; color: blue;}

2

Answers


  1. In WordPress, you can add custom CSS to your theme to achieve this. If you’re using the default WordPress text widget, you can add your links like this:

    <a href="#" class="class1">Link 1</a>
    <a href="#" class="class2">Link 2</a>
    

    Replace "#" with the actual URLs. This way, your links will inherit the styles you defined for class1 and class2 in your CSS.

    Login or Signup to reply.
  2. See this sample below, and use the div tag to call it it the body of your file.

    .city {
      background-color: tomato;
      color: white;
      border: 2px solid black;
      margin: 20px;
      padding: 20px;
    }
    </style>
    </head>
    <body>
    
    <div class="city">
      <h2>London</h2>
      <p>London is the capital of England.</p>
    </div>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search