Place the menu within the image, positioned at the bottom

Could someone help me with placing a menu at the bottom of an image using HTML, CSS and Bootstrap 4? I have limited CSS knowledge and need assistance.

Currently, my navbar is located below the image but not within it like this:

I am looking to achieve something like this where the menu is inside the bottom of the image:

This is the code I currently have:

<img src="car.png">
        <ul>
                <li>
                    <a> HOME</a>
                </li>

                <li>
                    <a href="#contact">NEWS</a>
                </li>
                <li>
                    <a href="#about">CONTACT</a>
                </li>
            </ul>

Answer №1

It seems like you're looking for a solution similar to this.

To achieve the desired layout, wrap your code in a single div and give it the CSS property position: relative. Then, apply the CSS properties position: absolute and bottom: 0 to your ul element.

I hope this suggestion helps:

* {
  margin: 0;
}

img {
  width: 100%;
  height: 100%;
}
.parent{
  position:relative;
}

ul {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: gray;
  color: white;
}
<div class="parent">
  <img src="http://1.bp.blogspot.com/-CGiYA8pN7HM/T_bKK0hOrpI/AAAAAAAACVQ/-ws96c-wkB8/s1600/audi-r8-v12-tdi-concept-2008-797153.jpg">
<ul>
  <li>
    <a> HOME</a>
  </li>

  <li>
    <a href="#contact">NEWS</a>
  </li>
  <li>
    <a href="#about">CONTACT</a>
  </li>
</ul>
</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

Enhancing the user experience of the dropdown component through improved

I have developed an accessibility feature for a dropdown component that dynamically populates values in the options menu only when the dropdown is opened. This means that it compiles the template on the fly and attaches it to the dropdown box. Dropdown HT ...

The addClass and removeClass functions in jQuery are functioning properly only on Firefox browser

Could someone help me understand why this code works in Firefox but not in Safari or Chrome? The variable newClass retrieves the value from a select box, which is then used to create a selector for adding or removing classes using addClass/removeClass. I ...

Issue with loading background image in HTML/CSS is being caused by a Cross-Origin Read Blocking problem

As part of my project, I need to load an image from my image hosting site by using my github repository. The CSS code I am using for this task is as follows: #main-section{ background-image : url("https://github.com/<mypath>/myphoto.jpg"); } Be ...

Steps for generating a dropdown menu using API JSON information

I'm new to using Webapi with AngularJS. I have a URL that returns data in JSON format, and I want to extract only the employee names from the data and display them in a dropdown list using AngularJS. Any assistance would be greatly appreciated. ...

What methods can be used to crop and style images in a similar manner using html and css?

Is there a way to replicate this specific method? I attempted to achieve the same look by using CSS masking, but the results weren't pleasing. Does anyone have suggestions on how to accomplish this using HTML/CSS? ...

What is the proper method for implementing a scrollable effect to the <v-bottom-sheet> element within the Vuetify framework?

Within my Vue.js project, I am utilizing the v-bottom-sheet component from Vuetify framework (version 2.1.12). Upon reviewing my code, you can observe that the v-card is enclosed within the v-bottom-sheet. The issue arises with the scrollable parameter of ...

cannot showcase the reply in a popup (modal)

When a button is clicked, the viewJob function is called and the jobId is passed to it. The response data that I am attempting to display in a bootstrap modal is being assigned as local variables. I even tried this in HTML: {{viewJob(model.citynew)}} If ...

Maintain checkbox selection even after leaving the page

I am looking for a way to maintain the state of a checkbox even after navigating away from the page in an AngularJS and bootstrap environment. Currently, I find that my bound variable gets reset to false every time I reload the page when the controller run ...

Incorrect Arrow Direction of Bootstrap Popover on SVG Icon

I set up a bootstrap(v5.1) popover on an svg icon, but the arrow icon direction is incorrect. Check out the code snippet below to see how it's configured; @create text & @modifytext are placeholders for dynamic content. <svg height="20& ...

Scale transformation - I am aiming for it to exceed the limits, yet it remains contained within

Currently, I am working on enhancing my carousel by implementing a zoom effect when hovering over the images. However, I have encountered an issue where the image gets hidden within the div container and doesn't overflow as expected. I tried adjusting ...

Perform a single click and a double click on an anchor element in the document

I am attempting to implement two actions when a user clicks on an anchor tag. The anchor tag will contain a video link. My goal is for the URL to open in a new window when the user single-clicks on the anchor tag, and for the use of the HTML5 download attr ...

I am looking to manage the error handling service, and my next step is to intentionally insert a single error into my service and have it automated

Need help with error handling in my service. I want to manually insert a single error, but would like it to be done automatically instead. 'use strict'; angular.module('nexoolApp.errorservice', ['nexoolApp.config']) .servic ...

The Endless Dilemma of AngularJS Scrolling

I have implemented an infinite scrolling feature for a Bootstrap app using AngularJS. Below is an example of how it works: Check out the demo here angular.module('scroll', []).directive('whenScrolled', function() { return function(sco ...

Generating replicated elements at varying positions

After discovering that my previous question, which can be found here, is currently not feasible due to limitations with html2canvas only taking 'snapshots', I have chosen to approach the problem differently. The new approach involves making an o ...

Ways to minimize excessive gap between two columns in Bootstrap

How can I reduce the space between two form-groups without moving the email address field with CSS left margins? When I try to make the first column smaller, it automatically wraps to the next line, but I want the email address to be closer to the phone ex ...

Determining the file size of an HTML and JavaScript webpage using JavaScript

Is there a way to determine the amount of bytes downloaded by the browser on an HTML+JS+CSS page with a set size during page load? I am looking for this information in order to display a meaningful progress bar to the user, where the progress advances bas ...

Having trouble understanding the differences between Bootstrap 4's .list-inline class and .list-inline-item class?

I am currently utilizing Bootstrap 4 within Wordpress. Strangely, I am facing an issue where I am unable to have list items appear inline (horizontally) solely by using the class .list-inline on the list itself, as shown below: <ul id="dances" class="l ...

Dynamically loading Jquery tabs in AngularJS can enhance user experience and

I need to implement a feature that loads tabs from an array using AngularJS. $scope.hods = [ { leader_id: 1000321, staff_id: 1000321, longname: "Ooi Kok Hong", username: "ANDREW", team_role: "HOD", importance: "1", active:true }, { leader_id: 100 ...

Issue with scope.$watch not triggering when model is updated

Currently, I am encountering an issue. The $watch event is triggered when I manually select a file. However, if I use the following code snippet: $scope.clear = function() { $scope.logo = null; }; The event does not get fired. Do you have any sugge ...

Steps to remove a row from a table in a ReactJS component

I'm struggling with implementing a delete operation for table rows and encountering errors. Any assistance in resolving this issue would be greatly appreciated. Since I am unsure how to set an auto-incrementing id, I used Date.now(). Now my goal is t ...