Trying to create a tooltip for “first name, last name” text- you’ll see by code what I’m trying to do… please tell me what I’m doing wrong or where there’s an error.
CSS
.tooltip {
font-size: 100px;
width: 300px;
height: 250px;
padding-left: 350px;
padding-right: 350px;
padding-top: 200px;
padding-bottom: 200px;
margin: auto;
background-color: darkmagenta;
color: antiquewhite;
font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, "sans-serif";
position: relative;
display: inline-block;
border-bottom: 1px dotted black;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 120px;
background-color: black;
color: white;
text-align: center;
border-radius: 6px;
padding: 5px 0;
position: absolute;
z-index: 1;
bottom: 150%;
left: 50%;
margin-left: -60px;
}
.tooltip .tooltiptext::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: black transparent transparent transparent;
}
.tooltip:hover .tooltiptext {
visibility: visible;
HTML
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Portfolio</title>
<link href="porfolio.JLC.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="tooltip">First Name,Last Name
<span class="tooltiptext">I'm a front end developer!</span>
</div>
</body>
</html>