Challenges with CSS on mobile devices

My mobile navigation bar on CSS is not functioning properly. It does not cover 100% width, the dropdown menu text is not centered, and the menu stays on screen after clicking a link.

Is there anyone who can help me resolve this issue?

To view the code snippet, visit: https://jsfiddle.net/wepywurp/

<body>
   <div class="nav animated slideInDown">
       <img src="img/hamburger.png" alt="" class="hamburger">
       <div class="logo">
          <h1>STEN</h1>
       </div>
       <ul>
           <li><a href="#home">HOME</a></li>
           <li>
               <a href="#">PAGE</a>
               <i class="fa fa-angle-down" aria-hidden="true"></i>
               <ul>
                   <li><a href="#">DROPDOWN</a></li>
                   <li><a href="#">DROPDOWN</a></li>
               </ul>
           </li>
           <li><a href="#aboutme">ABOUT ME</a></li>
           <li><a href="#portfolio">PORTFOLIO</a></li>
           <li><a href="#">PAGE</a></li>
       </ul>
   </div>

   <div id="landing" class="landing animated fadeIn">
       <div class="container">
            <h1>STEN</h1>
            <hr>
            <p>I'M THE</p>
            <h2>NEXT GENERATION</h2>
            <button><a href="#aboutme">LEARN MORE</a></button>
            <button><a href="#">PLANS</a></button>
        </div>
       <a href="#aboutme"><i class="fa fa-angle-double-down scroll" aria-hidden="true"></i></a>
   </div>

   <div class="main-content-wrapper">
       <div id="aboutme" class="about-me">
           <h1>ABOUT ME</h1>
           <hr>
           <div class="section">
               <h2>WHO <span>AM I</span>?</h2>
               <p>
                   Sed ullamcorper vestibulum nulla et aliquam. Nullam in porta arcu, in tincidunt felis. Aliquam vestibulum quam quis rutrum pellentesque.
                   <br><br>
                   Ut cursus congue sem nec vulputate. In quis dictum lacus, in ornare ante. Maecenas mattis enim id est auctor, vitae semper sapien pharetra. Vivamus dapibus nulla ut mattis lacinia.
               </p>
           </div>
           <div class="section">
               <h2>WHAT I'M <span>GOOD</span> AT</h2>
               <p>
                   Things that I'm good at and things I'm still improving upon.
               </p>

...

@media only screen and (max-width: 850px){
    .up {
        margin-right: 8px;
    }

    .nav .hamburger {
        height: 6vh;
        width: 6vh;
        display: inline-block;
        float: left;
        margin: 2vh 0 0 2vh;
    }

    .nav .logo {
        position: relative;
        margin-left: calc(50% - 12.5vh);
    }

    .nav > ul {
        display: none;
        float: none;
        padding-top: 10vh;
    }

    .nav .hamburger:hover ~ ul {
        display: block;
        width: 100%;
        margin: 0;
    }

    .nav li:hover > ul {
        display: block;
        position: relative;
    }

    .nav > ul:hover {
        display: block;
        width: 100%;
    }

    .nav ul:hover li {
        width: 100%;
        padding: 0;
    }

    .nav > ul > li {
        display: block;
        background-color: #F2F2F2;
    }
}

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

When using jQuery, adding a class does not always trigger CSS animation

Currently facing a peculiar issue. I am utilizing jQuery to load articles from JSON and would like to dynamically add a class of 'animate' to each loaded element. $.each(jsonArticles, function (i, article) { var $articleHTML = $( ' ...

Retrieving Basic HTML Source Code in UITextView Without CSS Styling Using Objective-C

I am looking to make changes to HTML text within a UITextView. The original text was created using an HTML editor in the web version of the app and needs to be edited with a default font on iOS. Here is the simple HTML code for the text that needs editing ...

Issue with displaying Django Bootstrapv5 component in carousel item

I am struggling to display at least 5 cards in each carousel-item, but currently it only shows one card per item. Can you help me figure out what needs to be done? {% for knowledge in knowledges %} <div class="carous ...

I am struggling to align elements properly with Bootstrap, and I am encountering issues with the border radius of a specific div

I'm having trouble aligning all the elements in the center of my login form created with HTML and Bootstrap. The header appears to be center-aligned, but it is not vertically aligned with the other elements. I've been using the Grid system and ne ...

SVG path tooltips are not functioning properly, unlike in regular HTML where they work perfectly

I have a CSS/HTML code that works perfectly in plain HTML and is also shown as an example at the end of the demo. However, it fails to work properly in SVG. Upon inspecting the element, I found that the :after code is being called but the tooltip remains ...

Is the username you want available?

I am facing a challenge in my registration form validation process where I need to verify the username input using javascript and flask in python, but the implementation is unclear to me. The requirement is to utilize $.get in the javascript segment along ...

What is the best way to eliminate the "onclick" attribute from an HTML element using JavaScript?

Is there a way to make my code only execute the onlick function after a button is pressed? I want to prevent any action from happening before that. <!-- deactivate onclick function --> <div class="boardsection2" id="2_8_7" oncl ...

Ensure that the div remains within the viewport

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Tit ...

Center align the label and textbox using CSS in a horizontal arrangement

Is there a way to center the label text within the div? My desired outcome is: ----------- Name: | textbox | ----------- For a demo, check out this code: http://jsfiddle.net/53ALd/2053/ ...

error displays stating that the module '../util/http_util' cannot be located

I'm currently using node and Notepad++ to develop a website that allows users to log in, save their details, and access the site. I've encountered an issue that I can't quite figure out even though everything seems fine in the code. Below yo ...

Formatting Issue with HTML Form (Width Exceeding Specifications)

Currently, I am in the process of creating a table that contains various forms and buttons within the cells. However, there seems to be excess space between the buttons which is giving the appearance of the form being too wide. I have been attempting to di ...

How can I show or hide all child elements of a DOM node using JavaScript?

Assume I have a situation where the HTML below is present and I aim to dynamically conceal all the descendants of the 'overlay' div <div id="overlay" class="foo"> <h2 class="title">title</h2> ...

Is it possible for me to include a static HTML/Javascript/jQuery file in WordPress?

My extensive HTML file contains Javascript, jQuery, c3.js, style.css, and normalize.css. I am wondering if I can include this file as a static HTML page within Wordpress. Say, for instance, the file is called calculator.html, and I want it to be accessib ...

Creating an Angular form from scratch using HTML

I've developed a component named login. Initially, I created an HTML form called login.component.html and then decided to convert it into an Angular form. To achieve this, I inserted <form #loginform="ngForm"> in the login.component.ht ...

Switching the image backdrop with an assortment of pictures

I am working with a structure that looks like this: <div class="container"> <ul> <li> <img> </li> </ul> </div> Currently, there is a background image set for the main container. My go ...

Is there a way to align my anchor tag so that my link appears perfectly centered both vertically and horizontally on the page?

Despite my efforts to find a solution, I am stuck with this issue. Here is the code I have been working on: <a href='/Customers' class='centre'>Start</a> I attempted to wrap it in a div tag and also wanted to add a small gr ...

Error encountered when using Symfony 2 command line interface

Just started learning Symfony2 and encountered a problem. I made changes to my CSS and when I try to re-install them in Eclipse shell, I get this error message: 'C:\wamp\www\Symfony' is not recognized as an internal or external ...

merge various CSS styles into a single one

My div has a mix of styles applied to it. <div class="alert alert-secondary login-alert" role="alert">Please contact the administrator to receive credentials!</div> The styles alert and alert-secondary are default styles from bootstrap 4, whi ...

What does it mean when an "Unidentified column in the field list" error occurs?

I've encountered a problem with my HTML+PHP code. Whenever I try to input data into this table within my database, an error message pops up saying "Unknown column 'phone_outlet' in 'field list'"... What should I do? :( I can't ...

Arrange two divs with a full width of 100% next to each other

Is there a way to create two divs, each taking up 100% of the page width and side by side within a wrapper with overflow:hidden? How can I achieve this? I attempted using inline-block, but it didn't produce the desired outcome. Similarly, when I tri ...