What could be causing the dropdown menu to be unresponsive in my HTML and CSS code?

I am struggling to figure out why my drop-down menu is not appearing on my website. Even after removing the 'hidden' property, it still doesn't look right when I hover over the 'servicios' tab. I can't seem to pinpoint the issue causing it to not show up.

{
    margin: 0;
    padding: 0;
    font-family: sans-serif;
}
.hero{
    height: 100vh;
    background-image: linear-gradient(rgba(0,0,0,0.8), rgba(0,0,0,0.6)), url(bp.jpg);
    background-position: center;
    background-size: cover;
    overflow-x: hidden;
    position: relative;    
}
.nav_bar{
    display: flex;
    padding: 40px 120px;
}
.nav-logo img{
    width: 135px;
}
.nav_links{
    flex: 1;
}
.nav_links ul{
    margin-left: 50px;
    display: inline;
    list-style: none;
}
.nav_links ul li{
    list-style: none;
    display: inline-block;
    padding: 8px 25px; 
}
.nav_links ul a{
    color: #fff;
    text-decoration: none;
    font-size: 18px;
}
.nav_links ul li::after{
    content: '';
    width: 0;
    height: 2px;
    background: red;
    display: block;
    margin: auto;
    transition: 0.45s;
}
.nav_links ul li:hover::after{
    width: 100%;
}
.btn{
    padding: 10px 10px;
    border: 0;
    background: red;
    font-weight: bold;
    cursor: pointer;
}
.nav_links .btn{
    float: center;
}
.frase{
    margin: 100px 130px;
    color: #fff;
}
.frase h1{
    font-size: 56px;
    margin-bottom: 30px;
}
.vertical_bar{
    height: 100%;
    background: red;
    top: 0;
    left: 0;
    position: absolute;
}
.icono_busqueda{
    height: 60%;
    width: 80px;
}
.icono_busqueda .fa{
    margin: 45px 23px;
    display: block;
    color: white;
    font-size: 30px;
    cursor: pointer;
}
.iconos_sociales{
    height: 60%;
    width: 80px;
} 
.iconos_sociales .fa{
    margin: 45px 23px;
    display: block;
    color:black;
    font-size: 30px;
    cursor: pointer;
}
.iconos_sociales{
    height: 35%;
    width: 80px;
    background: white;
    text-align: center;
    padding-top: 27%;
    bottom: 0;
    position: absolute;
}
.iconos_sociales .fa{
    margin: 15px 15px;
    display: block;
    padding: 8px;
    border: 1px solid black;
    border-radius: 0;
    cursor: pointer;
}
*{
    margin: 0;
    padding: 0;
}
.sub_menu_ser
{
    display: none;
}
.nav_links ul li:hover .sub_menu_ser
{
    display: block;
    position: absolute;
    background: red;
    margin-top: 15px;
    margin-left: -15px;
}
.nav_links ul li:hover .sub_menu_ser ul
{
    display: block;
    margin: 10px;
}
.nav_links ul li:hover .sub_menu_ser li
{
    width: 150px;
    padding: 10px;
    border-bottom: 1px dotted white;
    background: transparent;
    border-radius: 0;
    text-align: left;
}
:last-child
{
    border-bottom: none;
}
.nav_links ul li:hover .sub_menu_ser ul li a:hover
{
    color: red;
}
 
<html>
    <head>
        <title> Animal Care</title>
        <meta name="viewport" content="width=device-width,initial-scale=1">
        <link rel="stylesheet" href="style.css">
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
    </head>
    <body>
        <div class="hero">
        <div class="nav_bar">
        <div class="nav_logo">
            <img src="logo.png">
        </div>
            <div class="nav_links">
                <ul>
                    <a href="#"><li>Sobre Nosotros</li></a>
                    <a href="#"><li>Servicios</li></a>
                       <div class="sub_menu_ser">
                                <ul>
                                    <li><a href="#">Peluqueria</a></li>
                                    <li><a href="#">Veterinario</a></li>
                                    <li><a href="#">Cirugia</a></li>
                                    <li><a href="#">Limpieza</a></li>
                            </ul>
                        </div>
                    <a href="#"><li>Contacto</li></a>
                </ul>
                <button type="button" class="btn">Registrarse</button>
        </div>
        <div class="frase">
            <h1>Cuidando a Nuestros <br> Mas Queridos</h1>
            <button type="button" class="btn">Explorar</button>
        </div>
        <div class="vertical_bar">
            <div class="icono_busqueda">
                <i class="fa fa-search"></i>
                <i class="fa fa-list"></i>
            </div>  
            <div class="iconos_sociales">
                <i class="fa fa-facebook"></i>
                <i class="fa fa-instagram"></i>
                <i class="fa fa-twitter"></i>
                <i class="fa fa-envelope-o"></i>
            </div>
            </div>
        </div>
    </body>
</html>

Answer №1

Instructions to conceal the object:

.object {
    visibility: hidden;
}

Instructions to reveal the object:

.object:hover {
    visibility: visible;
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Animation of underline on hover for NavLink

As a newcomer to React, I am currently exploring how to create an animated underline effect when hovering over a NavLink from reactstrap. I have managed to get the underline working on hover thanks to the solution provided at , but I am struggling with imp ...

Struggling to create a BMI Calculator using JS, the result is consistently displaying as 'NaN'

Having trouble creating a BMI Calculator using JavaScript. The issue I'm facing is that the calculation always returns 'NaN'. I've tried using parseInt(), parseFloat(), and Number() but couldn't solve the problem. It seems that the ...

Tips on configuring a hidden input field to validate a form

I am currently attempting to create a blind input field using PHP that will validate if the input field is empty. If it's not empty, the message set up to be sent will not send. However, I have encountered several issues with the placement and wording ...

Tips on aligning HTML divs properly while printing with jQuery using flexbox CSS

Need help with aligning div content for print media query. Created a media query to target both screen and print. Print media query is similar to the screen media query. Display is fine on the screen, but misalignment occurs when trying to print. Fiddl ...

When zoomed in, the div background gives off a crisp white appearance

When I zoom in on a div with a background color or border, it appears completely white. Strangely, this issue doesn't happen when I zoom in on the Facebook site. This picture illustrates the problem more clearly. What could be causing this issue? H ...

Utilizing gradient effects on table backgrounds with html/css

Trying to enhance my responsive table by adding a gradient background, but encountering an issue where the style being applied is repeating in every cell, creating a messy look. Here's the gradient I'm using: background: linear-gradient(to right ...

Enhance Your File Uploads with Custom Images in Bootstrap

For the file upload buttons, I have used the given image by customizing the button look using Bootstrap 3. Here is an example of how I achieved this: <label class="btn btn-primary" for="my-file-selector"> <input id="my-file-selector" type="fi ...

Detecting file corruption from a form-based web page file upload (using input type="file")

Can file corruption occur during the process of uploading a file through a web form? Specifically, when an input of type "file" is included in a form submission and the file is saved on the server (typically in a designated temporary upload directory). Is ...

Align the button to the right within the form

Having difficulty aligning a button to the right using float: right; No matter what I try, the button with the "advanced-search-button" class refuses to move to the right. This issue is occurring in Bootstrap 4. HTML <link href="https://maxcdn. ...

When working with styled components, how can I effectively apply different styles using two layers of class names within the component declaration?

In my next.js project, I have developed a Container component with specific styles. As I incorporate this container component throughout the site, I aim to assign it a className for context-based styling. Illustrated below is an example of the Container c ...

Modifying jQuery CSS causes certain CSS rules from a file to be deleted

When using jQuery to change the css of an element, I've noticed that it can remove some previously specified css rules for that element. For example, .className, .className2, etc... { background-color: black; color : silver; } .className: ...

Unique Google Maps API V3 PEGMAN Customization

Can custom zoom controls and Pegman controls be styled with the same design? To add custom zoom controls, follow the instructions provided in this question's answer: <!DOCTYPE html> <html> <head> <meta name="viewport" cont ...

Exploring design techniques in React Native

I am currently part of a team working on a react native project with multiple contributors. My goal is to find an effective way to segregate the styling tasks from coding, allowing UI developers to work independently without relying on code developers. In ...

Steps for incorporating HTML templates into a Next.js 13 project

Looking for advice on converting an HTML template using Bootstrap or Tailwind CSS into a Next.js 13.4 project. I have experience with Next.js 12 but understand that the project structure has changed, removing files like _app.js and _document.js. Any tips o ...

Are Bootstrap Input groups inconsistent?

Hey there! I've been working on the sign-in example, but I seem to have hit a roadblock. In my local setup, the top image is what I see in my browser after running the code, while the desired layout that I found on the Bootstrap site is the one below ...

Turning off FavIcon.ico Can Enhance Performance

element: Currently, I have two websites being hosted on AEM or cq5 with distinct domains. Both websites share the same favicon on the new domain. I have attempted to remove this in the head.jsp template, but the favicon continues to display. Despite remo ...

HTML text-indent is a way to add extra space to

I cannot understand why my text is not indenting properly. At the very bottom left corner, the "Educational Specifications" text is enclosed within a p element as follows: <p style="text-indent: 3em">Educational Specifications</p> Why doesn& ...

How about creating a fresh variable in Assemble or merging two comparison helpers together?

Is it possible to create a new variable within a partial in Assemble (assemble.io) or combine two comparison helpers? For example: {#is somevar "yes" || anothervar "no"} In my partial, I have HTML that should only display if one of two different variable ...

What is the best method for restricting the visibility of an animation to specific regions within an SVG?

I am seeking assistance with adding a "shine" animation to my SVG. I want the animation to only appear within specific parts of the SVG, but I'm uncertain about how to achieve this. Below is what I have accomplished so far. The aim is for the white ...

PHP and jQuery to create an autocomplete text input feature

I've been working on implementing an auto suggest text box using PHP and jQuery, but it seems like the jQuery code I found online is already deprecated. I'm not sure if my code is incorrect or if the issue lies with the jQuery itself. Can anyone ...