user8521874 user8521874 - 2 months ago 19
HTML Question

Css is not working with my html code

I am new to html and css please tell me where I am going wrong

.property1
{
color: #0dc3ff;
}

<a class="navbar" href="#">Text1<span id ="property1"> + </span> Text2</a>

Answer Source

So the following code is doing a property of css on span is what I believe, so .property1 is not a id so you need to call it by span class like below. Remember if you need to call it by ID then you need to use #property1 not .property1

     .property1
     {
     color: #0dc3ff;
     }
    <a class="navbar" href="#">Text1<span class ="property1"> + </span> Text2</a>