I am struggling to achieve the desired outcome, which is depicted in this image: https://i.sstatic.net/i6X0j.jpg
Specific requirements for this project include:
- The image must be responsive
- A fixed-top navbar should remain visible
- No vertical scrolling should occur
- The footer also needs to stay at the bottom of the page
I have spent an entire day attempting to solve this issue, but so far, I have not had any success. A previous attempt that I made can be found here:
https://codepen.io/Codewife_101/pen/rpvdPq
However, using 'align-self-center' in my code caused unwanted vertical scrolling on the website, especially when viewing it on mobile devices.
This is my first version:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Red Logo Website</title>
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/custom.css">
<!--Material Design Icons-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<!--adding Roboto different styles-->
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,900" rel="stylesheet">
</head>
...
I also attempted another approach documented here:
https://codepen.io/Codewife_101/pen/eyVxre
Here is a snippet from my second version:
<nav class="navbar navbar-expand-sm navbar-light bg-light fixed-top">
<div class="container">
<img src="img/navbar_red_logo.32x32.png" class="img-fluid" alt="red-logo">
...
<footer id="main-footer" class="text-center">
<div class="container">
<p class="text-muted">Copyright © 2018 <img src="img/navbar_red_logo.32x32.png" class="img-fluid" alt="red-logo"> RedDesign LLC</p>
...
Unfortunately, neither solution resulted in the vertical centering of the elements as intended. Any suggestions or solutions would be greatly appreciated.
While my question may appear similar to others at first glance, my specific situation and limitations prevent me from commenting on existing discussions. Thank you in advance for any advice provided.