When you go to thedaystaragency.com/home and scroll down to our services where the lightbulbs are they are all misaligned and aren’t working properly. This is the code I’m using, I removed the button for now because for some reason elementor doesn’t allow the button to function properly, if any solutions could be recommended I would truly appreciate it! đŸ™‚
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Change Image on Hover in CSS</title>
<style>
#myBtn{
padding: 15px 25px;
font-size: 24px;
text-align: center;
cursor: pointer;
outline: none;
color: #fff;
background-color: #4CAF50;
border: none;
border-radius: 15px;
box-shadow: 0 9px #999;
}
#lightbulb:hover img{
content:url("https://thedaystaragency.com/wp-content/uploads/2020/03/rsz_11logomakr_2srycx.png");
}
#lightbulb:hover p { font-weight:bold; }
}
</style>
</head>
<body>
<center>
<div id=lightbulb >
<img src="https://thedaystaragency.com/wp-content/uploads/2020/03/rsz_4rsz_logomakr_3ijkr2.png" onmouseover=this.src="https://thedaystaragency.com/wp-content/uploads/2020/03/rsz_11logomakr_2srycx.png" onmouseout=this.src="https://thedaystaragency.com/wp-content/uploads/2020/03/rsz_4rsz_logomakr_3ijkr2.png" width=25px;> <br> <br> <h2> hi</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet, nulla et dictum interdum, nisi lorem egestas vitae scel<span id="dots">...</span><span id="more">erisque enim ligula venenatis dolor. Maecenas nisl est, ultrices nec congue eget, auctor vitae massa. Fusce luctus vestibulum augue ut aliquet. Nunc sagittis dictum nisi, sed ullamcorper ipsum dignissim ac. In at libero sed nunc venenatis imperdiet sed ornare turpis. Donec vitae dui eget tellus gravida venenatis. Integer fringilla congue eros non fermentum. Sed dapibus pulvinar nibh tempor porta.</span></p>
}
For button im trying to do something like this:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
#more {display: none;}
</style>
</head>
<body>
<h2>Read More Read Less Button</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet, nulla et dictum interdum, nisi lorem egestas vitae scel<span id="dots">...</span><span id="more">erisque enim ligula venenatis dolor. Maecenas nisl est, ultrices nec congue eget, auctor vitae massa. Fusce luctus vestibulum augue ut aliquet. Nunc sagittis dictum nisi, sed ullamcorper ipsum dignissim ac. In at libero sed nunc venenatis imperdiet sed ornare turpis. Donec vitae dui eget tellus gravida venenatis. Integer fringilla congue eros non fermentum. Sed dapibus pulvinar nibh tempor porta.</span></p>
<button onclick="myFunction()" id="myBtn">Read more</button>
<script>
function myFunction() {
var dots = document.getElementById("dots");
var moreText = document.getElementById("more");
var btnText = document.getElementById("myBtn");
if (dots.style.display === "none") {
dots.style.display = "inline";
btnText.innerHTML = "Read more";
moreText.style.display = "none";
} else {
dots.style.display = "none";
btnText.innerHTML = "Read less";
moreText.style.display = "inline";
}
}
</script>
</body>
</html>
3
Answers
Actually I tried this solution and it seemed to work thanks to your insight!
Not sure what you aim to do, but the misalignment comes from the last light bulb div not being wrapt in the same div structure as the first three ones.
I’d recommend you to avoid switching whole paragraph to bold text. You could use something like this maybe: