Need help with a button code


#1

I just started learning HTML and i'm using notepad to create a page about dogs just to practice. I recently learnt on the HTML and CSS course how to make a button that will redirect to a site when clicked. I did this and opened the notepad file in chrome, the stuff about dogs showed up but the box with the link didnt show up. This is my code; HTML:

<head> 
<link type="text/css" rel="stylesheet" href="stylesheet.css"
</head> 
<div>
<a href="https://www.youtube.com>My <span>Youtube Channel</span>
</div>

CSS:

div {
    height:50px;
    width:120px;
    border-color:#6495ED;
    background-color:#BCD2EE;
    border-radius: 5px;
    margin: auto;
    text-align: right;

}
span {
     color: blue;
     font-family: Arial;
    
}
a {
    text-decoration: none;
    color: #3D59AB;
    font-family: Verdana, sans-serif;
}

help please?


#2

You never close your <a> tag, or the quote in your href:

<a href="https://www.youtube.com">My <span>Youtube Channel</span></a>

All fixed. :wink:


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.