Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Fixed Menu Dissapears on Image Hover Effect

I’m fairly new to coding in HTML and CSS.

I have the following HTML and CSS Code, a fixed menu nav bar and an image below that makes an effect on hovering.

How do I go about the image not blocking the menu when zooming in?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Also how do I go about not stretching the image but resizing the div where it is posted in order to fir the browser screen a bit?

* {background-color: black
}
*{
    padding: 0;
    margin: 0;
}

ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: visible;
  background-color: black;
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
  font-size: 20px;
  font-weight: bold;
  height: 65px;
  border-style: dashed;
  border-color:green;
  border-radius: 20px;
  height: 80px;
}

li {
  float: left;
}

li a {
  display: block;
  color: white;
  text-align: center;
  padding: 10px 12px;
  text-decoration: none;
  border-style: dotted;
  margin-left: 24px;
  margin-top: 11px;
}

li a:hover {
  background-color: red;
}

.parrafo{
    font-size: 40px;
    padding: 75px;
    border-radius: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    border-left: 22px;
    padding-left: 150px;
    border-top: dotted 5px red;
    border-bottom: dotted 5px yellowgreen;
    display: flex;
    flex-direction: row;
    font-family: sans-serif;
    font-weight: bold;
    color: white;
    
}

.queonda{
font-family: sans-serif;
font-weight: bold;
color: white;
font-size: 50px;
margin-left: 85px;
}

.test{
    margin-left: 200px;
    margin-top: 270px;
}

.test2{
    margin-top: 100px;
    margin-bottom: 100px;
    margin-left: 700px;
}

.portrait {
  overflow: hidden;
  display: inline-block;
}

.portrait img {
  transition: transform 0.5s linear;
  max-width: 100%;
  max-height: 100%;
}

.portrait:hover img {
  transform: scale(1.1);
}

.cat {
 height: 1250px;
 width: 1900px;
}

.algo {
    height: 880px;
    width: 1700px;
    display: block;
}

.active {
  overflow: hidden;
  background-color: #333;
  position: fixed;
  top: 0;
  width: 100%;
}
<div class="active">
    <ul>
        <li><a href="#home">Tour</a></li>
        <li><a href="#news">Listen to Music</a></li>
        <li><a href="#contact">Contact</a></li>
        <li><a href="#about">About</a></li>
    </ul>
</div>

<div class="portrait algo"><img src="https://i.ibb.co/dLrSmP7/1111.jpg" alt=""></div>

<div class="parrafo">
    <img src="https://muzikercdn.com/uploads/products/4207/420772/09821a89.jpg" alt="Ciudad con Transito">
    <P class="test">MUSIC<br>MAINSTREAM   SELLOUT</P>
</div>

<div class="test2">
    <P class="queonda">VIDEOS</P><br><br>
    <video width="1280" controls autoplay="off">
        <source src="./img/prueba2.mp4" type="video/mp4">

</div>

<footer class="footer">
    <div class="container">
        <div class="row">
            <div class="footer-col">
                <h4>Terms & Conditions</h4>
            </div>
            <div class="footer-col">
                <h4><a class="textDecoration" href="#privacy">Privacy and Policy</a></h4>
            </div>

            <div class="footer-col">
                <h4>Follow Us</h4>
                <div class="social-links">

                </div>
            </div>
            <div class="footer-col">
                <div class="social-links">
                    <h3><a href="#" class="fa fa-facebook"></a>
                        <a href="#" class="fa fa-twitter"></a>
                        <a href="#" class="fa fa-instagram"></a>
                        <a href="#" class="fa fa-youtube"></a>
                    </h3>
                </div>
            </div>
        </div>
</footer>

Hopefully you guys can give me some guidancee on this to fix it 🙂

>Solution :

Just add any positive z-index to navigation.

* {background-color: black
}
*{
    padding: 0;
    margin: 0;
}

.navigation {
  z-index: 1;
}

ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: visible;
  background-color: black;
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
  font-size: 20px;
  font-weight: bold;
  height: 65px;
  border-style: dashed;
  border-color:green;
  border-radius: 20px;
  height: 80px;
}

li {
  float: left;
}

li a {
  display: block;
  color: white;
  text-align: center;
  padding: 10px 12px;
  text-decoration: none;
  border-style: dotted;
  margin-left: 24px;
  margin-top: 11px;
}

li a:hover {
  background-color: red;
}

.parrafo{
    font-size: 40px;
    padding: 75px;
    border-radius: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    border-left: 22px;
    padding-left: 150px;
    border-top: dotted 5px red;
    border-bottom: dotted 5px yellowgreen;
    display: flex;
    flex-direction: row;
    font-family: sans-serif;
    font-weight: bold;
    color: white;
    
}

.queonda{
font-family: sans-serif;
font-weight: bold;
color: white;
font-size: 50px;
margin-left: 85px;
}

.test{
    margin-left: 200px;
    margin-top: 270px;
}

.test2{
    margin-top: 100px;
    margin-bottom: 100px;
    margin-left: 700px;
}

.portrait {
  overflow: hidden;
  display: inline-block;
}

.portrait img {
  transition: transform 0.5s linear;
  max-width: 100%;
  max-height: 100%;
}

.portrait:hover img {
  transform: scale(1.1);
}

.cat {
 height: 1250px;
 width: 1900px;
}

.algo {
    height: 880px;
    width: 1700px;
    display: block;
}

.active {
  overflow: hidden;
  background-color: #333;
  position: fixed;
  top: 0;
  width: 100%;
}
<div class="navigation active">
    <ul>
        <li><a href="#home">Tour</a></li>
        <li><a href="#news">Listen to Music</a></li>
        <li><a href="#contact">Contact</a></li>
        <li><a href="#about">About</a></li>
    </ul>
</div>

<div class="portrait algo"><img src="https://i.ibb.co/dLrSmP7/1111.jpg" alt=""></div>

<div class="parrafo">
    <img src="https://muzikercdn.com/uploads/products/4207/420772/09821a89.jpg" alt="Ciudad con Transito">
    <P class="test">MUSIC<br>MAINSTREAM   SELLOUT</P>
</div>

<div class="test2">
    <P class="queonda">VIDEOS</P><br><br>
    <video width="1280" controls autoplay="off">
        <source src="./img/prueba2.mp4" type="video/mp4">

</div>

<footer class="footer">
    <div class="container">
        <div class="row">
            <div class="footer-col">
                <h4>Terms & Conditions</h4>
            </div>
            <div class="footer-col">
                <h4><a class="textDecoration" href="#privacy">Privacy and Policy</a></h4>
            </div>

            <div class="footer-col">
                <h4>Follow Us</h4>
                <div class="social-links">

                </div>
            </div>
            <div class="footer-col">
                <div class="social-links">
                    <h3><a href="#" class="fa fa-facebook"></a>
                        <a href="#" class="fa fa-twitter"></a>
                        <a href="#" class="fa fa-instagram"></a>
                        <a href="#" class="fa fa-youtube"></a>
                    </h3>
                </div>
            </div>
        </div>
</footer>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading