so im trying to have two different headers here. One displaying my name and the other displaying a quote I think is pretty neat. I would like to make them change on hover.
Ive gotten this to happen once, but the two different set of texts where not on top of each other, but underneath.
I tried fixing this with some js, because I had seen someone do smth similar (so I thought "eh why the heck wouldnt it work).
Excuse the boring site and code, Ive only started coding 3 days ago (thats maybe why this seems to be a herculean task for me). (Its a testing website, so I went with a simple topic.. a CV)
I'd appreciate any help I could get with this. Thanks
function myFunction() {
var element = document.body;
element.classList.toggle("dark-mode")
}
body {
font-family: Arial, Helvetica, News Courier;
margin: 0;
}
.header {
padding: 80px;
text-align: center;
background: #40826D;
color: white;
}
.header:hover {
background: #6e7f80;
transition: 1s;
color: #6e7f80;
}
.header h1 {
font-size: 40px;
}
.text {
font-size: 40px;
opacity: 0;
}
.header:hover .text {
opacity: 1;
color: white;
transition: 1s;
}
.navbar {
overflow: hidden;
background-color: #333;
}
.navbar a {
float: left;
display: block;
color: white;
text-align: center;
padding: 14px 20px;
text-decoration: none;
}
.navbar button {
float: right;
display: block;
color: white;
text-align: center;
padding: 21px;
text-decoration: none;
}
.navbar a.right {
float: right;
}
.navbar a:hover {
background-color: #ddd;
color: black;
}
.dark-mode {
background-color: black;
color: white;
}
<div class="header">
<div class="text">
<h1 style="font-family: News Courier;text-align: left">Brene Brown</h1>
<p style="font-family: News Courier;text-align: center"><i>There is no innovation and
creativity without failure</i></p>
</div>
<h1 style="font-family: News Courier">Luca S. Frias Serrano</h1>
<p>a curriculum vitae</p>
</div>
<div class="navbar">
<a target="_self" href="file:///Users/lucafrias/Downloads/HTML/CV.html">Home</a>
<a target="_self" href="file:///Users/lucafrias/Downloads/HTML/pls%20save%20me.html">Personalia</a>
<a target="_self" href="file:///Users/lucafrias/Downloads/HTML/academic%20career.html">Career</a>
<a target="_self" href="file:///Users/lucafrias/Downloads/HTML/aboutme.html">About me</a>
<div>
<button onclick="myFunction()"></button>
<script type="text/javascript">
</script>
</div>
<a target="_self" href="file:///Users/lucafrias/Downloads/HTML/CV/contact%20me.html" class="right">Contact me</a>
</div>
<div style="text-align: center;font-family: News Courier">
<h1>Welcome to my virtual curriculum!</h1>
<h3>I hope this will give you a general idea of me.</h3>
<p>This page will provide you with:</p>
<p>My personalia</p>
<p>Information about my academic career</p>
<p>Information about my work experience</p>
<p>Information regarding myself</p>
</div>