The hamburger menu icon is not visible

I recently built a website and aimed to ensure it had a responsive design. Following a tutorial on YouTube, I implemented everything exactly as shown in the video. However, I encountered an issue with the hamburger icon not appearing. Can anyone shed some light on why this might be happening? The functionality works perfectly in the tutorial. Check out a snippet of my code below:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Nikolinart</title>
    <link rel="stylesheet" href="./styles/style.css">
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
<body>
    <nav class="navbar">
        <div class="max-width">
            <div class="logo"><a href="#">Nikolin<span>art</span></a></div>
            <ul class="menu">
                <li><a href="#">Home</a></li>
                <li><a href="#">About</a></li>
                <li><a href="#">Gallery</a></li>
                <li><a href="#">Contact</a></li>
            </ul>
            <div class="menu-btn">
                <i class="fas fa-bars"></i>
            </div>
        </div>
    </nav>

    <section class="home" id="home">
        <div class="max-width">
            <div class="home-content">
                <div class="text-1">Hello and welcome to</div>
                <div class="text-2">Nikolin<span>art</span></div>
                <div class="text-3">My name is Nikolina and I'm a <span>Painter</span></div>
            </div>
        </div>
    </section>

    <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Inventore aperiam rem laboriosam corrupti sunt, aspernatur doloremque ipsum molestiae, eveniet debitis vitae tempore ea molestias atque fugiat hic voluptas dignissimos mollitia quasi earum saepe fuga cum. Vero quia blanditiis voluptatum suscipit consequuntur praesentium odit asperiores totam quod, aliquid esse voluptas voluptatem dolorum! Dolor provident, sint repellat ese voluptates facere, dolorem tempora, libero at voluptas repellendus saepe reprehenderit laudantium dicta quas id aliquid corporis. Vitae, perferendis dolores! Explicabo voluptatum officiis vel exercitationem voluptate voluptatem in qui expedita ullam voluptas doloremque modi, ratione iure assumenda nostrum architecto ipsa, minima est corporis sed consequuntur, ipsam corru...
.menu-btn {
    color: #fff;
    font-size: 23px;
    cursor: pointer;
    display: none;
}

Answer №1

There are two potential reasons for this issue:

The text may be hidden because you set the display:none property, or it could be invisible due to accidentally using the color:#fff (white color) which matches the background color.

Additionally, it seems like there is no content present.

.menu-btn {
    color:red;
    font-size: 23px;
    cursor: pointer;  
}
<div class="menu-btn">
     <i class="fas fa-bars">Yes</i>
 </div>

Answer №2

Using display: none will conceal the element Consider deleting that particular line of css

Answer №3

Within your CSS code snippet, you have set the display property to None, which is typically used for hiding elements. Consider updating the class to

.menu-btn {
    color: #fff;
    font-size: 23px;
    cursor: pointer;
}

Furthermore, I noticed that you are using Font Awesome icons without importing them properly. If you are loading Font Awesome through a CDN, ensure that the necessary import is included in the HEAD section of your HTML document.

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

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

Tips on preventing a lone track in Laravel for Server Sent Events

In my Laravel app, I am exploring the use of Server Sent Events. The issue I have encountered is that SSE requires specifying a single URL, like this: var evtSource = new EventSource("sse.php"); However, I want to send events from various parts/controlle ...

Toggle Visibility of Div Based on Matching Class Name When Clicked

Just delving into the world of jQuery and could use some guidance. Is there a way to show a div with a matching class when a specific button is clicked? For example, clicking on a button with the class '.project1' should display the corresponding ...

Is there a method to consistently keep the horizontal scrollbar in view for the MUI Data Grid at all times?

I have a Data table with virtualized columns, totaling more than 25 in number. Users can easily scroll horizontally using a trackpad, but without one, they may struggle to access all the columns due to the delayed appearance of the scrollbar. Is there a w ...

What is the best technique to position a div at the bottom of a container that has a height of 100

After many attempts and searching for answers, I'm still struggling to figure out how to make the div float to the bottom with 100% height. I've even considered if it's an issue with Pure or something else entirely. It's definitely frus ...

Issues with styling SVG when using the `<use>` element

I am currently faced with a challenge involving CSS, where I need to modify the size and color of an SVG element that is being displayed using <use>. The specific SVG in question is as follows: <svg xmlns="http://www.w3.org/2000/svg" width="24" h ...

Learn how to easily reset the index value within the same template in Angular

In my template, I have 3 tables with the same JSON data as their parent elements. <tbody> <ng-container *ngFor="let row of reportingData.RecommendationData; let i=index"> <tr *ngIf="row.swRecommendations"> <td& ...

What is the Best Way to Create a Smooth Border-Bottom Transition?

I'm currently diving into the world of HTML5 and CSS. I want to replicate the layout from . Specifically, I am interested in adding a transition effect to the border bottom of certain elements such as "View Our Listings", "The Agency Daily", "Meet our ...

Retrieving input values with JQuery

HTML <td data-title="Quantity"> <div class="clearfix quantity r_corners d_inline_middle f_size_medium color_dark m_bottom_10"> <button class="btn-minus bg_tr d_block f_left" data-item-price="8000.0" data-direction= ...

Adding columns dynamically to a table using ASP.NET Core 6

I am currently working on a project for my university, and I need to design a dynamic table with columns that can be added as needed. Each row should have a maximum of 4 columns before moving on to the next row and continuing the process until completion. ...

What is the significance of an empty href attribute in the HTML <base> tag?

If my website URL is: http://example.com/path/to/dir/index.html And I decide to proxy this page through: http://proxyserver.com/path/to/dir/index.html. I would like all relative URLs on the page to be resolved by proxyserver.com instead of example.com. Wh ...

Updates made to the Transform property in Mui Theme are not appearing in the browser

I'm looking to modify the MuiInputLabel.outlined. While I can see various changes when inspecting in the browser, I'm having trouble seeing the transform property change specifically. This is the current configuration of my MuiInputLabel: MuiInp ...

What is the most efficient way to send multiple arrays by selecting checkboxes?

Currently, I am faced with a challenge where I have a selection of items from a list that need to be submitted in the form of three different arrays with distinct values to PHP. These arrays include: Device id, Client comment, and Manufacturer comment. < ...

Retrieve data from a MySQL table based on a specific condition in PHP

Can someone assist me with fetching data from a table where the valid_from date is less than a specified date (excluding the current date)? I have a table that looks like this: view my table here For instance, if my date is 02-04-2015, I would want to re ...

Implement a hover effect on a specific class targeting a nested element using JavaScript

Is there a method to apply a class that modifies rules for a child element using Javascript? I have successfully added it with CSS but am struggling to do the same with Javascript. Removing the class in JS is easy by referencing the classname before the ho ...

hiding html elements by using the display property set to none instead of physically removing

I am currently utilizing an if-else statement to display different HTML structures. As a result, the entire HTML is being rendered twice. Is there a way we can utilize 'display: none' instead? I attempted to use it in th ...

Arrange text and a button side by side in a table cell using an Angular directive and an HTML template

I have successfully implemented an Angular search function on my project. You can find it here to allow users to search for courses. The search function uses a read-more directive that displays a preview of the description and keywords before allowing use ...

What is the best way to show the logged-in user's name with PHP?

After a successful login, I want to display a personalized greeting message to the user in PHP (e.g. "Hey User!"). However, the code $username = $_SESSION['username']; is not retrieving the username properly and displays nothing (Hey !). Here ...

Unlock the power to toggle dynamic elements with jQuery

I'm currently using jQuery to enable and disable input elements, but I'm having trouble doing so for similar elements with the same class. Here is the HTML code: <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js">< ...

Tips for creating a Vue component that triggers the select dropdown to open when the entire div or wrapper is clicked

I have a custom-designed select dropdown with unique symbols for the select arrow. To achieve this look, I've hidden the default select arrow/triangle and placed our symbol on top as an image file. <div class="select-wrapper"> < ...

I'm curious as to why the web browser is showing a timestamp below the image I have on my HTML page

Issue at Hand: I am currently working on coding a website that involves displaying an image. However, when the image is loaded, a timestamp appears underneath it in the web browser. Query: Could you please shed some light on why a timestamp is showing up ...