Responsive mode causing navbar to break

After creating my web portfolio, I encountered an issue when viewing it on my phone. The navbar collapses but is not properly aligned and there is extra space on the right side of the viewport in the hero section that I can't seem to fix.

Portfolio Link:

HTML code:

<header class="navigation fixed-top">
<nav class="navbar navbar-expand-lg navbar-dark">
.... (omitted for brevity)
</section>
<!-- /hero area -->
<!-- about -->
<section class="section">
.... (omitted for brevity)
</section>

CSS Code:

.navigation {
padding: 40px 100px;
transition: .3s ease;
}
.... (omitted for brevity)
.layer-bg {
position: absolute;
bottom: 0;
left: 0;
}

Answer №1

Looking for a solution? Insert this CSS snippet to eliminate spacing issues and ensure proper alignment when viewing on different devices.

body, html {
overflow-x: hidden;
}

Answer №2

To resolve the problem, try deleting the header tag and its associated class, then apply the 'fixed-top' class to the nav tag.

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

Is it possible to request a GET on a server's JSON file using a specific key?

I am currently working on a project involving an auto-suggestion exercise using a JSON file located on a server. I'm not entirely clear on the web development terminology, so one requirement has me a bit confused: The requirement states: "On the keyu ...

Enhancing the building matrix with JavaScript (or jQuery)

I have created a custom Javascript function for extracting specific data from a matrix. The main purpose of the function is to retrieve data based on dates within a given range. Here's how it works: The matrix[0][i] stores date values I need to extr ...

Having trouble retrieving an array element within an HTML table

Currently, I am working on a database project related to bar beer drinkers. To display the results of my queries on a local host website, I am running queries on my database and using Angular. The issue I am facing is that while I can see the query executi ...

Issue encountered while transmitting information from AngularJS to PHP

I am currently developing a mobile app that focuses on recipes using AngularJS and PHP. I am facing an issue with sending the recipe ID from the URL to the server using the $stateParams in Angular through an HTTP POST method. The ID seems to be either sent ...

What is the best way to pause for the API response in Node JS before moving on to the next line of

When working on a node js project, I encountered a situation where I needed to call an API and wait for the response. The response is crucial as it is the output of my Alexa Skill. Check out the snippet of code for the API: const GetReportOnEmail = functi ...

Error: AJAX responseText Mismatch detected

When I make an AJAX call in my code, everything seems to be working correctly. The PHP script responds with "success" when it should, and the response text is indeed "success". However, even though the output appears to be correct, the line if(returnVal == ...

Tips for creating consistent spacing between elements using Tailwind CSS version 3

I am currently utilizing Tailwind CSS in conjunction with next.js for my project. I have a total of 8 images, each varying in size, and my goal is to display 4 images per row on medium and large devices, while displaying 2 images per row on small devices. ...

Stop automatic selection of the last value in ng-options using AngularJS

I'm facing an issue related to AngularJS. The problem I'm encountering is that... In my code, there are two select elements. Whenever I choose an option from the first select, an Ajax call is made using ng-change to populate the second select ba ...

Asynchronous data fetching with React Hook useEffect does not properly populate the tooltip in Material UI component

After using useEffect to fetch data, I encountered a problem in passing the data to my component. Here is some of my code: User Data Types (UPDATED) export interface IUser { display_name: string; id: string; images: Image[]; } expo ...

Is there a way to change an ISO 8601 date into the format '/Date(1525687010053)/' using JavaScript?

Is there a way to convert a date value that is formatted as 9999-12-31T00:00:00Z to the format /Date(1525687010053)/ using javascript? I tried implementing the following code, but it doesn't seem to be working: var datevalue = '9999-12-31T00:00 ...

Utilizing the smallslider feature through jQuery/JavaScript operations

I've recently embarked on the journey of learning JavaScript/jQuery. I've been attempting to incorporate this cool effect, but unfortunately, I'm facing some difficulties with it: My goal is to understand how to execute this effect using Ja ...

Issue with array merging/inserting feature not functioning as expected

Here are two arrays that I have: First Array: "workingHours": [ { "opening": "09:30", "closing": "13:30", "dayName": "sunday" }, { ...

Sinon's fakeTimers failing to trigger

I'm encountering an issue with sinon's fakeTimers while working in a setup that includes Marionette.js, underscore, and chai test runner. Strangely, when I place a breakpoint in Chrome and step through the code, my timer functions as expected. Ho ...

Tips on configuring the values of the outer div in an HTML document

I have a webpage in AngularJS. It consists of two main sections; one displays the total number of users and the other displays a table populated with user data retrieved from a service. Below is the code snippet: app_user.html // This div displays the t ...

Repair the navigation bar once it reaches the top of the screen using ReactJS

I have a webpage that contains specific content followed by a bar with tabs. My goal is to have this bar stay fixed at the top of the screen once it reaches that position while scrolling down, and only allow the content below the fixed bar to continue scro ...

Tips for concealing the angular component depending on a specific circumstance

I have developed a custom directive for validating input. It is designed to check the length of the input. If the length is zero, an error message will be displayed. However, I am facing difficulty in hiding the error message when the input is filled with ...

Error encountered while parsing Japanese characters using the express body-parser resulting in a bad control character issue

Currently, I am sending a large JSON string to a node express endpoint that is set up like this: import bodyParser from 'body-parser'; const app = express(); const jsonParser = bodyParser.json({ limit: '4mb' }); const databaseUri = &ap ...

What is the technique used to initialize the $route object?

Upon attempting to access this.$route in the created() hook, I noticed that it consistently returns an empty object when logged to the console. {path: '/', name: undefined, params: {…}, query: {…}, hash: '', …} fullPath: "/&q ...

Extract the date and time information from the API response

I have received a response array from an API that I need to work with. Take a look at the response below: [{createdBy:"user1", updatedDttm: "2022-01-20T07:31:35.544Z"}, {createdBy:"user2", updatedDttm: "2022-02-20T09:31:3 ...

Showcasing the time variance using javascript/jquery

I am currently using a datepicker to select dates, with the intention of calculating the difference between the chosen dates and then displaying an alert with the calculated difference. Unfortunately, I am encountering issues with getting the code to work ...