What is the best way to create a full-width bottom menu for my app using HTML and CSS?

I encountered an issue with the bottom navbar menu on the mobile version of my website. It appears as an app-like bottom menu and looks great on most devices except for those with a 320px width size. In these cases, the navbar does not stretch to fill the entire screen width but rather gets cut off prematurely (I am utilizing Bootstrap 4).

Here is the expected appearance:

https://i.sstatic.net/HV1ru.png

However, this is what occurs on devices with a 320px width:

https://i.sstatic.net/cS74v.png

When I tried adding width: 100vw, this was the result:

https://i.sstatic.net/ARsfB.png

Below is the snippet of HTML code being used:

// Tablets and Phones (768 and down) //
@media (max-width: 768px) {
  .nh-mobile-footer-bottom {
    display: flex;
    background-color: $white;
    height: 78px;
    align-items: flex-start;
    padding-top: 10px;
    box-shadow: 0px -4px 27px rgba(0, 0, 0, 0.1);
    -webkit-box-shadow: 0px -4px 27px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0px -4px 27px rgba(0, 0, 0, 0.1);
  }
  // More CSS styling...
}
<!-- Additional markup -->

Answer №1

  • Utilized background color and hover effect to demonstrate the class covering the area - The behavior can be observed by removing *{} or any other CSS
  • Implemented !important to override the original Bootstrap CSS code

* {
  margin: 0px !important;
  padding: 0 !important;
  overflow:auto !important;
}

.nh-mobile-footer-bottom {
  width: 100% !important;
  display: block !important;
}

button {
  float: left !important;
  width: 20% !important;
  height: 60px !important;
  font-size: 11px !important;
  display: block !important;
}

button:hover {
  background-color: blue !important;
  color: white !important
}

#nhMobileMenuMap {
  padding: 0 !important;
}
#nhMobileMenuMessages {
  padding: 0 !important;
}
<!-- Bootstrap 4.5.3 CDN -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="40222f2f34333432213000746e756e73">[email protected]</a>/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">


<div class="row fixed-bottom nh-mobile-footer-bottom">

  <!-- Map -->
  <button type="button" class="btn col nh-mobile-footer-bottom-btn pl-4" id="nhMobileMenuMap">
    <i class="fal fa-map-marker-alt"></i>
    <p>Mapa</p>
  </button>

  <!-- Filters -->
  <button type="button" class="btn col nh-mobile-footer-bottom-btn" id="nhMobileMenuFilters">
    <i class="fal fa-filter"></i>
    <p>Filtros</p>
  </button>

  <!-- Publish -->
  <button type="button" class="btn col nh-mobile-footer-bottom-btn-publish-container" data-toggle="modal" data-target="#publicationServiceModal" id="nhMobileMenuPublishBtn">
    <i class="fa fa-plus nh-mobile-footer-bottom-btn-publish"></i>
    <p class="nh-mobile-footer-bottom-publish-label">Publicar</p>
  </button>

  <!-- My services -->
  <button type="button" class="btn col nh-mobile-footer-bottom-btn" id="nhMobileMenuMiServicios">
    <i class="fal fa-user-tag"></i>
    <p>Mis servicios</p>
  </button>

  <!-- Messages -->
  <button type="button" class="btn col nh-mobile-footer-bottom-btn pr-4" id="nhMobileMenuMessages">
    <i class="fal fa-comment"></i>
    <p>Mensajes<span class="nh-footer-menu-message-bubble">2</span></p>
  </button>
</div>

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 for ensuring smaller columns have the same height as their siblings

I'm facing an issue where I have a row with two columns dictating the height, but one of them is shorter than the others. How can I make the shorter column stretch to match the height of the row? This inconsistency in height is causing disruption to ...

Looking to boost the height of ngSelect options?

Need help with adjusting the dropdown height for the ng-select form image. Currently, it is only displaying 5 items and I would like it to show 8-10 items. Below is the code I am using: <form [formGroup]="addReportForm" class="form-hori ...

Leverage the power of effekt in your AngularJS development

Can anyone demonstrate how to implement animation effects with AngularJS? Has someone created an example using Effeckt.css? ...

Clicking the delete button will halt the process once the user cancels the confirm alert

The website is now capable of extracting API data and displaying it in a table. Additionally, users can delete rows from the table by clicking on a button. (pic) Table and alert display after clicking the delete button Q: If I click cancel on the alert, ...

Displaying MongoIds in HTML output for the user

Currently, I am in the process of developing a web application that utilizes MongoDB as its database management system. One challenge I am facing is finding a way to accurately identify which object the user has selected from a list on the screen, and the ...

Incorporating server-side rendered components into a Vue.js parent component

I have a server-side rendered page that includes information about "orders" and a root Vue object initialized as the "parent object." Is it feasible to assign the rendered HTML orders as children of that parent Vue object? Vue.js is known for its dynamic ...

Initiate a fresh start with an automatic input reset

When you perform an action in the first id = "benodigheden", I believe there should be a specific outcome that then triggers a second rule for id = "benodigheden". However, I have been unsuccessful in finding information on this topic online. It seems like ...

Node replication including a drop-down menu

Is there a way to clone a dropdown menu and text box with their values, then append them to the next line when clicking a button? Check out my HTML code snippet: <div class="container"> <div class="mynode"> <span class=& ...

Increase the height of a div dynamically in HTML during program execution

Within my datagrid, there exists an expandable/collapsible section above the content (see Picture 1 https://i.sstatic.net/N68Rl.png). Upon expanding the content, a scroll bar appears within the datagrid element to display the data (see Picture 2 https://i. ...

Leveraging multiple css classes within a single class definition

I need some help with this issue, it seems pretty basic but I can't seem to find the solution...sorry for asking a beginner question. Currently, I have multiple HTML elements that share the same CSS classes: <a class="class1 class2 class3">< ...

Update the hover functionality to only trigger on small screens when clicked

Is there a way for the text content to change from appearing on hover of an image to opening with a click in the mobile version? <div class="program prog-image" style="background-image: url(https://imagevars.gulfnews.com/2019/07/23/Timberwolf_16c1de355 ...

Childs - A jQuery Stride

I am trying to figure out how to modify a specific child element within an HTML structure. Specifically, I want to target the first anchor tag within a list item of an unordered list. Here is what I have attempted so far: [HTML AND JQUERY] <body> ...

Animate in Css3 before the object enters the user's view

Currently, I am utilizing CSS3 animate it from Despite following their instructions, the children within the animation activate prior to entering the viewport. Is this a common issue or is there a specific meta tag required? Your assistance is greatly ap ...

Struggling to make @media queries function while customizing Bootstrap 4 with React Bootstrap

Utilizing Bootstrap 4, I am attempting to modify the "custom-select" class to suit my own design preferences. Below is the HTML and SCSS code I have implemented. It may seem like a simple task. <select className="custom-select" id='sortin ...

When the route is modified, the image fetched from the JSON disappears

When using a div tag to display JSON values on an image, I noticed that the values disappear when navigating to other pages and then returning to the home page. This issue is occurring as I develop with Angular.js NumberJson.get().then(function (resul ...

What is the process for adjusting the attribute of a subitem utilized by the `use` element?

Currently, I am studying SVG and have a question about changing the circle fill value of the second use element. Here is what I have tried: * { stroke: brown; stroke-width: 1; fill: none; } .canvas{ border-color: green; border-style: solid; border-widt ...

The child element is bigger than its parent due to the maximum height set. There is no visible overflow

My goal is to create a parent element with a maximum height, and have a child element fill this parent. If the content in the child exceeds the parent's dimensions, a scrollbar should appear. I attempted to achieve this by: div.parent { max-hei ...

Access a document by selecting a particular page from a designated anchor tag

Seeking assistance from the community on opening a particular page within a file using an anchor tag (<a href=""></a>). The issue arises when trying to pass a parameter through the xls file, as it prevents locating the specified page. Any gui ...

Just sent out an email including an attachment with HTML content or a webpage link to access on Google

My email recipients primarily use Gmail as their email service provider. To address this, I saved the contents of this page as an HTML file named index.html and stored it on my drive for easy sending. However, the issue lies in the fact that the page does ...

display data in a sequential format

Within my MySQL database, there exists a table structure which I will share as a reference: +----+--------------+---------+--------+-----------+ | id | name | place | number | type | +----+--------------+---------+--------+-----------+ | 1 ...