Tips for positioning footer text to the left and right, similar to Google's style

Explore www.google.com for inspiration.
You will notice a footer containing links to Advertising, Business, and About on the left side, and Privacy, Settings, Terms, etc. on the right side at the bottom of the page.

I am an aspiring developer attempting to recreate a similar page like Google using only HTML and CSS, without any functionality added.

Below is my HTML code:

selector {
  property: value;
}
h3 {
  text-decoration: underline;
  position: absolute;
  top: 10px;
  right: 180px;
  border: 0;
}
h4 {
  text-decoration: underline;
  position: absolute;
  top: 10px;
  right: 120px;
  border: 0;
}
.ribbon {
  position: absolute;
  top: -160px;
  right: -560px;
  width: 25px;
}
img {
  position: fixed;
  width: 300px;
  top: 40%;
  bottom: 60%;
  left: 40%;
  margin: auto;
}
a {
  position: relative;
  margin-top: 400px;
  background: no-repeat left;
  font-size: 12px;
  left: 500px;
}
.venu {
  width: 150px;
  box-sizing: border-box;
  border: 2px solid #ccc;
  border-radius: 4px;
  font-size: 16px;
  background-color: white;
  background-image: 2.png;
  padding: 20px 20px 20px 45%;
  position: fixed;
  top: 55%;
  bottom: 60%;
  left: 30%;
  margin: auto;
}
p {
  position: fixed;
  top: 75%;
  bottom: 60%;
  left: 30%;
  margin: auto;
}
#footer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 1rem;
  background-color: #efefef;
}
.left {
  float: left;
  left: -800px;
}
.right {
  float: right;
  text-align: right;
}
.button {
  background-color: blue;
  border: none;
  color: white;
  padding: 5px 5px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 2px 2px;
  cursor: pointer;
  position: absolute;
  top: 20px;
  right: 20px;
  border: 0;
}
<!DOCTYPE html>
<html>

<head>
  <link type="text/css" rel="stylesheet" href="2.css" />
  <title>Google</title>
  <style>
    a:link,
    a:visited {
      background-color: #e0e0e0;
      color: #696969;
      padding: 14px 25px;
      text-align: center;
      text-decoration: none;
      display: inline-block;
    }
    a:hover,
    a:active {
      background-color: #e0e0e0;
    }
  </style>
</head>

<body>
  <div id="content">
    <img src="22.png" class="ribbon" />
  </div>
  <button class="button">Sign in</button>
  <h3>Gmail</h3>
  <h4>Images</h4>
  <img src="download.png" />
  <input type="text" class="venu">
  <p>Google.co.in offered in: English Hindi Tamil Telugu Kanada Malayalam</p>
  <div id="footer">
    <h4 class="left">Advertising Business About</h4>
    <h4 class="right">Privacy Terms  Settings  Use Google.com</h4>
    <div style="clear: both"></div>
  </div>
  <a href="" target="www.Google.com">Google Search</a>
  <a href="" target="www.Google.com">I'm Feeling Lucky</a>
</body>

</html>

If there are any elements missing from my attempt to replicate the footer design, please provide feedback.

Answer №1

Create two separate divs named leftContainer and rightContainer. Fill the leftContainer with the necessary elements list. Follow the same process for the rightContainer.

.leftContainer{
    float:left;
}
.rightContainer{
    float:right;
}

Answer №2

If you want to create a footer on your website, consider using the <footer> tag.

To set up your footer, simply replace the <h4> tags within the

<div id="footer"></div>
with the <footer> tag. Here's an example for reference:
<div id="footer">
    <footer>Advertising Business About</footer>
 </div>

You can also use <div> tags to help align your footer content as needed.

Answer №3

Take a look at their code, I've created a snippet that resembles theirs. Add float: right to the specific element.

body {
  margin: 0;
  padding: 0;
}

footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 10px 0;
  background-color: grey;
}

.content.left {
  margin-left: 30px;
}

.content.right {
  float: right;
  margin-right: 30px;
}
<footer>
  <span class="content left">Some contents here</span>
  <span class="content right">Some contents here</span>
</footer>

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

My navigation bar's CSS code falls short of extending across the full width of my screen, leaving a gap of approximately 10 pixels before reaching the edges

Can someone help me figure out what went wrong? I've been trying to remove the margins but it's not working. The background colors of other elements seem to be seeping into this empty space. Any thoughts or suggestions would be greatly appreciate ...

Tips for modifying the height of a bootstrap-vue table and enabling scrolling with a fixed header

I have a div containing a b-table that I need help adjusting the height for. I want to make the table scrollable with a fixed header. Can anyone assist me? Here is my code: Code inside the template: <div class="tbl-barangay"> <b-table stripe ...

Problem with Bootstrap 3 navbar on mobile devices - not tappable or responsive

After years of using Bootstrap, I've come across a new issue with my implementation of a Bootstrap 3 Nav. While testing on a desktop browser with device emulation, the nav collapses and functions properly. However, when tapping on the header on an ac ...

Eliminating undesired borders of table cells using CSS

I am facing a unique and puzzling issue. Here is the simple markup: <table> <thead> <tr><th>1</th><th>2</th><th>3</th></tr> </thead> <tbody> <tr>< ...

Django: Sending Templates through AJAX for Dynamic Rendering

Hey there, this is more of a theoretical question. So I recently discovered a cool trick: using AJAX to trigger a function that delivers a pre-rendered HTML template as a response, which can then be applied to a designated div element. This method feels i ...

What is the best way to customize the CSS of the Skype contact me button?

I am struggling with customizing the Skype contact me button. The standard Skype button has a margin of 24px and vertical-align set to -30px. I have tried removing these styles but have had no success. Here is the code snippet I am working with: Skype ...

Creating consistency in tab spacing within a text area

At the moment, I am utilizing an HTML textarea attribute to collect input from users and then displaying that text back to them formatted. However, there seems to be an issue with how it handles tabs. For instance, when attempting to input the following: ...

What's the best way to display a component once a function has been executed?

My service controls the visibility of components using *ngIf! Currently, when I click a button, the service sets to true and the components appear instantly! I want the components to only show after a specific function has finished executing. This means I ...

I'm having trouble getting a response from the user.php file in my login system

I am trying to create a login system using ajax and pdo with a button as the submitter. The issue I am facing is that when I click the button to execute, nothing happens. There are no errors in the console. I can see in the network tab that it sends the us ...

Combine and blur multiple background images using CSS blending techniques

I am currently working on a website, which is just a demo built in ReactJS: The issue I'm facing is related to the background. The idea behind the app is simple - it consists of 4 parts, with the top part displaying weather information without a bac ...

Discover a specific segment of the pie chart

Currently, I have a pie chart that has been created using HTML5 canvas. I am able to retrieve the coordinates (X,Y) when the mouse hovers over it. Now, my goal is to determine which slice of the pie chart the Point (X,Y) falls into. Please note: I have ...

Arranging elements on a webpage using CSS grid placements

Currently experimenting with css grid, envisioning a scenario where I have a 2x2 grid layout. When there are 4 child elements present, they would form 2 rows of 2 elements each. My challenge is when dealing with an odd number of children, I aim to avoid al ...

Click on the anchor tag to reveal additional content beyond the default display

This question stems from a previous discussion on the topic at: Only show specific div with anchor In my profiles.html page, there are profiles of around 20 people all grouped under a class named "profile" and unique ids such as "example-name1", "example ...

Issues encountered when attempting to utilize removeEventListener() with multiple elements within a for loop in Javascript

After experimenting, I have been exploring ways to avoid encountering repeated event listeners The script provided below iterates through all buttons with a specific attribute. However, the issue is that it only functions effectively for a single button ...

Looking to adjust the alignment in BootsFaces? Want to move the final link of the navbar to the right corner?

<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.c ...

Show only the present y-coordinate in the ToolTip of a chart.js

I am currently working on developing a chart using Chart.js, and my goal is to only show the y-axis value in the tooltip. The current display shows: date name_of_line: measurement example: Jan 1, 2020, 8:00:00 AM 5th Percentile: 100 oz. However, I would ...

Can the distinction between a page refresh and closure be identified using the method below?

My idea is to trigger a popup window when the page is closed, not when it is refreshed. The plan is as follows: Client Send an ajax request to the server every x seconds. Server var timeout=0 var sec=0 while (sec>timeout) { open popup win ...

DjangoPDFViewer

I need help figuring out how to integrate a PDF Viewer into my Django website. Right now, I'm using an iframe to show the PDF, but I want to add annotation functionality directly on the site. I've looked into using PDF.js, but it means incorporat ...

Learn how to assign an ID to a React component in order to access it using the document.getElementById() method

After going through multiple inquiries, my understanding led me to believe that simply setting the id as shown below would suffice: <MyComponent id="myId"/> However, upon invoking document.getElementById() on the specified id, I receive a null resu ...

Modify the color of the components in Select from Material-UI

After reviewing numerous questions and answers on this topic, I have yet to find a suitable solution for my issue. Seeking guidance from the community for assistance. Utilizing the Select component from @mui/material to showcase the number of records per ...