I stumbled upon a sidebar code that caught my interest:
#sidebar {
position: fixed;
z-index: 10;
left: 0;
top: 0;
height: 100%;
width: 60px;
background: #fff;
border-right: 1px solid #ddd;
text-align: center;
}
#sidebar a {
text-decoration: none;
display: block;
padding: 20px 0 20px 0px;
color: #000000;
letter-spacing: 1px;
}
#sidebar a:hover {
background-color: rgba(255, 255, 255, 0.1);
color: black !important;
}
#sidebar a:hover,
#sidebar a.active {
text-decoration: none;
background: #4caf50;
color: black;
}
#sidebar a.active {
background: #00ff00;
}
<div id="sidebar">
<center>
<img width="80%" height="10%" src="https://img.pngio.com/download-for-free-10-png-gold-star-png-icon-top-images-at-carlisle-small-gold-star-icon-png-512_512.png"/>
</center><br>
<a href="one.php">1️⃣</a>
<a href="two.php">2️⃣</a>
<a href="three.php">3️⃣</a>
</div>
I have a vision to enhance the sidebar with some descriptive text:
<div id="sidebar"><br>
<center>
<img width="80%" height="10%" src="https://img.pngio.com/download-for-free-10-png-gold-star-png-icon-top-images-at-carlisle-small-gold-star-icon-png-512_512.png"/>
</center><br>
<a href="one.php">1️⃣ Number one</a>
<a href="two.php">2️⃣< Number two/a>
<a href="three.php">3️⃣ Number three</a>
</div>
- My goal is for the text to appear only when hovering over the sidebar. When not hovering, the sidebar will feature only symbols, and upon hovering, it expands to show the accompanying text. How can I achieve this effect?