Home > Software engineering >  anchor tag is not being styled
anchor tag is not being styled

Time:11-21

anchor tag is not being styled Here's the particular code I'm having trouble with

HTML
<a href="tel:9149417020" >914-941-7020</a>




CSS

.tele a{
   
    color: #2bab0d;
    text-decoration: none;
    font: 1em sans-serif;
}


I expected it to be styled but for some reason no changes are made 

CodePudding user response:

Css selector problem. Just use .tele or a, using both means descendant, in your case .tele a{} means a is inside of .tele. Try this .tele {} or a {}.

CodePudding user response:

if class is inside the element which you want to style then first select element then class (without space) like this

914-941-7020

a.tele{

color: #2bab0d;
text-decoration: none;
font: 1em sans-serif;

}

  • Related