-1

I'm having issues adding styles to a span tag from an external CSS file to the following snippet of HTML.

<!DOCTYPE html>
<html>
 <head>
  <link type="text/css" rel="stylesheet" href="stylesheet.css"/>
  <title>About Me</title>
 </head>
 <body>
  <img src="https://s3.amazonaws.com/codecademy-blog/assets/46838757.png"/>
  <p>We're Codecademy! We're here to help you learn to code.</p><br/><br/>
  <div>
  <a href="www.google.com"><span>LINK</span></a> 
  </div>
 </body>
</html>

The corresponding CSS is below; it appears that the problematic line is the text-decoration line in the span block, which for some reason isn't being applied. Any input?

img {
 display: block;
 height: 100px;
 width: 300px;
 margin: auto;

}

p {
 text-align: center;
 font-family: Garamond, serif;
 font-size: 18px;
 
}

/*Start adding your CSS below!*/

div {
    height: 50px;
    width: 120px;
    border-color: #6495ED;
    background-color: #BCD2EE;
    border-style: dashed;
    border-width: 3px;
    border-radius: 5px;
    margin: auto;
    text-align: center;
    
}

span {
    color: blue;
    font-family: times;
    text-decoration: none;
}
v. carey
  • 1
  • 1
  • 2
  • Possible duplicate of [Remove stubborn underline from link](http://stackoverflow.com/questions/2789703/remove-stubborn-underline-from-link) – André Dion Apr 19 '17 at 14:49

2 Answers2

0

This line was from anchor tag, rather then from span. Check css below:

img {
  display: block;
  height: 100px;
  width: 300px;
  margin: auto;
}

p {
  text-align: center;
  font-family: Garamond, serif;
  font-size: 18px;
}


/*Start adding your CSS below!*/

div {
  height: 50px;
  width: 120px;
  border-color: #6495ED;
  background-color: #BCD2EE;
  border-style: dashed;
  border-width: 3px;
  border-radius: 5px;
  margin: auto;
  text-align: center;
}

span {
  color: blue;
  font-family: times;
}

a {
  text-decoration: none;
}
<!DOCTYPE html>
<html>
 <head>
  <link type="text/css" rel="stylesheet" href="stylesheet.css"/>
  <title>About Me</title>
 </head>
 <body>
  <img src="https://s3.amazonaws.com/codecademy-blog/assets/46838757.png"/>
  <p>We're Codecademy! We're here to help you learn to code.</p><br/><br/>
  <div>
  <a href="www.google.com"><span>LINK</span></a> 
  </div>
 </body>
</html>
Artem Lopatiy
  • 948
  • 5
  • 15
0

Use this

a {
    color: blue;
    font-family: times;
    text-decoration: none;
}
Ravi Ubana
  • 397
  • 5
  • 26