I have made a custom title box and the old one still displays along with the new one when I hover over my icons.
I have provided an
Image of what is happening. If you look at the image you can see a black box with "Homepage" and white text above the icon. I want the white text only.
header {
background-color: #195190;
color: #fff;
padding: 20px;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.nav-buttons {
display: flex;
gap: 30px;
justify-content: flex-end;
animation: slideInL 1s ease-in-out;
}
.nav-button {
background-color: transparent;
color: #fff;
border: none;
font-size: 16px;
cursor: pointer;
}
.nav-button:hover {
color: #ccc;
}
li {
list-style-type: none;
position: relative;
display: inline-block;
margin-top: 20px;
}
li[title]:hover::after {
content: attr(title);
position: absolute;
width: 120px;
bottom: 100%;
left: 50%;
margin-left: -60px;
background-color: none;
color: #fff;
text-align: center;
padding: 5px 0;
}
<head>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200"
/>
</head>
<body>
<header>
<ul class="nav-buttons">
<li title="Homepage">
<a id="navhomepage" href="./index.html" class="nav-button">
<span class="material-symbols-outlined">
home
</span>
</a>
</li>
<li title="Photopage">
<a id="navphotopage" href="./Photosite/index.html" class="nav-button">
<span class="material-symbols-outlined">
photo_camera
</span>
</a>
</li>
<li title="Startside">
<a id="navstartside" href="./Startside/index.html" class="nav-button">
<span class="material-symbols-outlined">
web
</span>
</a>
</li>
<li title="Contact">
<a id="navcontact" href="#Contact" class="nav-button">
<span class="material-symbols-outlined">
contact_page
</span>
I tried disabling the title using js but that ended up disabling both of them.
2
Answers
Test thist
Edited:
Html:
Css
You can "patch" your page with javascript, setting a blank
title
to thea
link inside theli
.