Footer Design with Images in Bootstrap

Hi, I recently started using Bootstrap and I'm trying to add a fixed footer to my page with a logo that is taller than the footer itself. I want the footer and the image to be fixed at the bottom of the page, while the image extends beyond the footer.

Something like this... https://i.sstatic.net/pWPS6.png

When I try to make the image part of the footer, it automatically resizes to fit the height of the footer. Can anyone help me with this? I've been struggling with this issue for a while now.

/***Footer***/

footer {
  width: 100%;
  z-index: 9;
  background: #bff;
  position: fixed;
  bottom: 0px;
  left: 0px;
  height: 40px;
  padding: 0 25px;
  color: #808080;
}

.foot-lg {}

.foot-lg img {
  width: 50px;
}

.footer-logo-copyright,
.foot-menu,
.foot-social {
  overflow: hidden;
  display: flex;
  height: 40px;
}


/*** added on 04.Jun.21 to display GPTW logo sticking out of footer ***/

.foot-pop img {
  overflow: visible;
  max-height: 100%;
  height: 100%;
  width: auto;
}


/**********************************************************************/

.footer-logo-copyright *,
.foot-menu *,
.foot-social * {
  align-self: center;
}

.footer-logo-copyright p {
  padding: 0 10px;
  font-size: 11px;
}

.foot-menu li {
  float: left;
  list-style: none;
  border-right: 1px solid #808080;
}

.foot-menu li:last-child {
  border-right: none;
}

.foot-menu li a {
  display: block;
  padding: 0px 15px;
  text-decoration: none;
  color: #808080;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
}

.foot-menu li:hover a {
  color: #f37e1f;
}

.foot-social li {
  float: left;
  margin-right: 10px;
}

.foot-social li:last-child {
  margin-right: 0;
}

.foot-social li a img {
  width: 13px;
  filter: invert(.7);
  opacity: 0.5;
}

.foot-social li:hover a img {
  /*    filter: invert(0);  */
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<footer>
  <div class="row">

    <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 no-pd">
      <div class="footer-logo-copyright">
        <a href="" class="pull-left foot-lg">
          <img src="img/logo-animation.gif" alt="footer-logo">
        </a>
        <p class="pull-left">is a registered trademark of XYZ Pty Ltd.</p>
        <p class="pull-left">&#169; 2021. all rights reserve to XYZ Pty Ltd.</p>

      </div>
    </div>

    <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
      <ul class="pull-right foot-menu">
        <li>
          <a href="contact.html">Careers</a>
        </li>
        <li>
          <a href="#">Sitemap</a>
        </li>
      </ul>
    </div>

    <div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
      <ul class="foot-pop pull right">
        <li>
          <a href="# ">
            <img src="img/gptw21.jpg ">
          </a>
        </li>
      </ul>
      <ul class="foot-social pull-right ">
        <li>
          <a href="https://www.linkedin.com/company/sjs-enterprises-pvt.-ltd./?originalSubdomain=in " class=" ">
            <img src="img/linked-in-logo-key.svg ">
          </a>
        </li>
      </ul>
    </div>

  </div>
</footer>

Appreciate any help on this. Thank you!

Answer №1

It is recommended to maintain the current HTML structure, with the logo included in the footer for proper positioning and sizing relative to the footer.

The objective is to have the logo positioned at the bottom of the footer, potentially with some padding or margin, while also being taller, such as twice the height of the footer or slightly more (the exact difference is not specified in the query).

This simplified snippet assumes that the desired logo height is the footer height plus a bit extra. If a logo twice the height of the footer is desired, refer to the accompanying comment for guidance.

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

body {
  width: 100vw;
  height: 100vh;
}
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 10%;
  background-color: cyan;
}
footer .logo {
  position: absolute;
  right: 1vmin;
  bottom: 1vmin;
  height: calc(100% + 30px); /* CHANGE to be what you want - e.g. height: 200% for twice the footer height %/
  width: auto;
}
<footer>
  <img src="https://i.sstatic.net/csy1S.png" class="logo">
  </div>
</footer>

Answer №2

To customize your img tag, include the following CSS styles:

img {
    max-height: 100%; 
    height: 100%;
    width: auto; 
}

Answer №3

To display a fixed image at the corner of the page above the footer, you can utilize fixed positioning to achieve this effect effortlessly.

Simply create a new div container and apply fixed positioning to that element. Refer to the implementation below for detailed instructions.

<style>
.fixed-image {
      position: fixed;
      bottom: 0;
      right: 0;
    }
</style>

 <div class="fixed-image">
  <img src="https://dummyimage.com/120x170/000/fff" alt="Image">
</div>

For more information, check out the documentation:

https://developer.mozilla.org/en-US/docs/Web/CSS/position

Here is a JsFiddle link for reference:

https://jsfiddle.net/aus_tin/0dsoqecz/2/

Answer №4

To create the desired outcome, adjust the footer to have a relative position and set the image to absolute

position: absolute;
bottom: 0;
right: 20px; // Customize this value as needed

html,
body {
  height: 100%;
  background-color: cadetblue;
  margin: 0;
  padding: 0;
}

div#wrapper {
  height: 100%;
  display: grid;
  grid-template-rows: 100px auto 50px;
}

header {
  background-color: purple;
}

footer {
  position: relative;
  background-color: lime;
}

footer>img {
  position: absolute;
  bottom: 0;
  right: 20px;
}
<div id="wrapper">
  <header>header</header>
  <main>body</main>
  <footer>
    footer
    <img src="https://picsum.photos/100" />
  </footer>
</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

Can you explain the purpose of the "for" attribute in the <output> tag of HTML?

I'm puzzled by the purpose of the for attribute in the new HTML5 output tag, as the result doesn't seem to change based on its presence. This query was raised back in 2012 during the era of HTML4. However, with the introduction of HTML5 in 2014, ...

Error Encountered: Angular JS Throwing Unhandled Injection Error

I am having trouble validating the fields in my index.html and js files. I keep seeing errors, even after trying different versions of angular-route.min.js and angular.js. AngularJs | Basic Login Form <body ng-app="myApp"> ...

The functionality of the <button type="button"> is currently failing to submit the data as intended

I am currently facing an issue with retrieving the value from a date-picker in my post method. I need to select the date using a button, and after selecting the date, I want to retrieve its value in the post method. However, when I click on the submit butt ...

Missing information from PHP contact form fields

I've been struggling with this issue all day and I can't seem to figure it out on my own. The solution is probably right in front of me... My contact form is mostly functional, but for some reason, I'm not receiving input for all fields. On ...

How can we best understand the concept of custom directives using the link method?

As a beginner in AngularJS, I am looking to implement an autocomplete feature for text input. My JSON data is stored in JavaScript and I need help simplifying the process. Can you provide me with a straightforward solution? The specific requirement is to ...

Leverage htaccess functionality to modify website configurations without altering the URL

I currently have the following htaccess configuration: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(.*)$ dl.php?id=/$1 [QSA,L] </IfModule> It works perfectly fine. However, I am facing a problem with my site URLs and images ...

Clicking does not trigger scrollIntoView to work properly

I'm facing an issue with a button that is supposed to scroll the page down to a specific div when clicked. I implemented a scrollIntoView function in JavaScript and attached it to the button using onClick. Although the onClick event is functioning as ...

navigation trail click feature

I'm currently working on an Angular application using Chart.js to display dynamic pie charts. I want to include a breadcrumb navigation above the pie charts to show users the hierarchy of the data they are viewing. I also need to enable click functio ...

SASS mixin that enables flexbox capabilities without supporting older, legacy versions of flexbox

Is it possible to provide support for browsers lacking flexbox compatibility (such as IE) while using SASS mixins? I have been quickly implementing the display:flex property with the following mixin. However, I am facing challenges with IE and need to man ...

While using the Android Firefox browser, I noticed that the keyboard is causing my screen to shrink in size

As I work on creating a cross-platform HTML page, I have encountered an issue with text fields on Android smartphones. When I attempt to type in a text box, the keyboard pops up and causes my HTML page to shrink within the viewport. I'm curious to kn ...

Differences in Behavior of jQuery Element Styles in Firefox and Chrome When Modals Are Visible

I'm new to working with jQuery and JavaScript. Currently, on my website, I have implemented several unique modal/popups that are activated using a CSS :target selector, which changes their display property to block. Additionally, I am attempting to us ...

How can one determine the most accurate box-shadow values?

I am trying to extract the precise box-shadow parameters from a CSS style rule generated by the server. My main focus is determining whether the element actually displays a visible shadow or not. There are instances where the shadow rule is set as somethi ...

Containerized chatboxes with improved stability

https://i.sstatic.net/ILwsO.jpg Within the div labeled chatbox-container, there are two chatboxes that have been positioned to float: right with a margin-right: 15px. .chatbox-container { position: fixed; z-index: 1; right: 0; left: 0; ...

The stickiness of elements causes scrollbars to disappear in Chrome 77 on OSX

In this scenario, I have set up two tables where the first one has a sticky header achieved with position: sticky; top: 0px; https://codepen.io/seunje/pen/JjjRVLm The sticky header works perfectly fine, but there is an issue with scrollbars disappea ...

Creating Awesome Icons in Kendo Grid with Code In this tutorial, we will learn how to programm

Looking to have a Kendo grid display a green fas-fa-clock icon if isActive is true, and a grey far-fa-clock icon if false. Clicking on the icon should toggle between true and false. Currently, the grid just shows the word true or false in the column. Cod ...

HTML form for selecting shipping method in PayPal

In my shopping cart setup, I offer two shipping methods: 'express' and 'standard'. I'm wondering if it's feasible to transmit this data to PayPal using HTML variables? ...

show an HTML webpage within a <div> container using AJAX technology

I am trying to include an HTML page named Introduction.html (located in the same folder as x.html) within div1. However, it does not seem to be loading properly. Below is a snippet of the code from x.html x.html <!DOCTYPE html> <h ...

What is the best way to adjust the position of a dropdown menu in Material UI?

I am currently working on a Gatsby application and I'm trying to achieve a dropdown menu effect when the Menu icon is clicked, with the menu appearing right under the header and expanding to 100% width. Below is the code snippet that I have been using ...

The svg line is drawn with a width that is half of the specified width

I am looking to create a horizontal line that is 10px wide. I tried using the code below <svg width="500" > <line x1="100" x2="460" y1="0" y2="0" stroke="red" stroke-width="10px&qu ...

Building an expansive navigation menu with react-bootstrap

My current project involves creating a mega menu. Although I successfully made a responsive navbar, the challenge now is to implement a dropdown panel with 100% width. I've tried various approaches but haven't found one that works. Note: The oth ...