The elements at the bottom of the Google homepage do not stay in place when hovering

I'm facing an issue and seeking guidance on how to make the footer and 'Google in different languages' fixed when hovering over the buttons. I'm attempting to create this on my own without referencing the Google homepage code in Chrome Dev Tools, so I'm unsure of how they positioned these two elements.

Below is the code I've been working on:

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" type="text/css" href="../css_stylesheets/stylesheet3.css"/>
    <title>Google</title>
</head>
<body>
    <div>
    <header class="start">
        <ul>
            <li><a href="#">Gmail</a></li>
            <li><a href="#">Images</a></li>
            <li class="button"><a href="#">Sign in</a></li>
        </ul>
    </header>

    <h1>
        <img src="../Images/googlelogo.png" alt="Google logo"/> 
        <span>India</span>
    </h1>   

    <form>
        <input type="text"/><br>
        <input type="submit" value="Google Search" id="text" name="search"/>
        <input type="submit" value="I'm Feeling Lucky" name="search2"/>
    </form>
    <p>
        Google.co.in offered in: <a href="#">Hindi</a><a href="#">Bangla</a><a href="#">Malayalam</a><a href="#">Marathi</a>
    </p>
    <footer>
            <nav class="left">
            <ul>
                <li><a href="#">Advertising</a></li>
                <li><a href="#">Business</a></li>
                <li><a href="#">About</a></li>
            </ul>
            </nav>
            <nav class="right">
            <ul>
                <li><a href="#">Privacy</a></li>
                <li><a href="#">Terms</a></li>
                <li><a href="#">Settings</a></li>
                <li><a href="#">UseGoogle.com</a></li>
            </ul>
            </nav>
    </footer>
    </div>
</body>
</html> 

The CSS stylesheet I'm using:

*
{
    padding:0px;
    margin: 0px;
}

body
{
    font-family:Arial,sans-serif;
}
div:first-child
{
     font-size:25px;
     margin:auto;
     text-align:center;
     padding-top:0px;
}
div header ul
{
    margin-right:0px;
    text-align:right;
    font-size: 17px;

}
body div header.start
{
    padding-top:0px;
}
h1 
{
    display:inline-block;
    font-size:20px;
}

h1 span
{
    position:relative;
    right: 63px;
    bottom: 5px;
    color:rgb(51,187,232);
    font-size:small;
    font-family: "Arial", sans-serif;
}
li.button a
{
    display:inline-block;
    outline:none;
    background-color:rgb(10,125,247);
    padding:9px;
    border:solid 1px;
    border-radius: 4px;
    font-weight: bold;
    color:#F5F5F5;

}
li.button a:hover
{
    text-decoration:none;
    outline:grey 3px;
    box-shadow: inset 0 0 0px 1px #27496d;
}
li.button a:active
{
    background-color:rgb(11,95,191);
    border:inset 1px #C7C7C7;
}
a
{
    text-decoration: none;
    word-spacing:5px;
    font-size: 15px;
    color:grey;

}
a:hover
{
    text-decoration:underline;
}
a::after
{
    content: " ";
    text-decoration: none;
}
input[type="text"]
{
    margin:auto;
    max-width:500px;
    width:40%;
    padding:10px;
}
input[type="text"]:visited
{
    outline:blue;
}
input[type="submit"]
{
    color:#727578;
    border:solid 0px;
    background-color:#E3E6E8;
    font-weight:bold;
    padding:10px;
    margin: 30px 5px;
    margin-bottom:0px;
}
input[type="submit"]:hover
{
    border:ridge 2px;
    color:black;
    background-color:#f0f0f0;
}
input[type="submit"]:active
{
    outline:blue;
}
p
{
    margin:0px;
    padding:0px;
    font-size:14px;
    position:relative;
    top:15px;
}

p a::after 
{
    content: " ";
    text-decoration: none;
}
p a:link
{
    color: blue;
}
ul li
{
    list-style-type: none;
    display:inline;
    word-spacing: 10px;
}

nav.left ul li 
{
    padding-top:2px;
    position:relative;
    right:590px;
    top:50px;
}
nav.right ul li
{
    position:relative;
    left:500px;
    top:0px;
}
footer nav.right ul
{
    display:block;
    background-color:#e3e3e3;
    padding-top:20px;
    margin-bottom:0px;
}   

I want to mention that I am still learning about CSS3 elements. While I have a good grasp on most CSS properties, there are some areas that I am new to. Once again, I don't need a complete debugging solution unless absolutely necessary. Please provide assistance specifically on the topic mentioned at the beginning in bold.

Answer №1

The issue lies in the CSS style input[type="submit"]:hover which is causing the border-width to change from 0px to 2px, resulting in buttons' total height and width increasing by 4px and moving below content.

To resolve this problem, you can modify the code as follows:

input[type="submit"] {
  ...
  border: solid 0px;
  ...
}

Change it to:

input[type="submit"] {
  ...
  border: transparent solid 2px;
  ...
}

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

Assigning a class to a table row does not produce any changes

When a user clicks on a table, I am attempting to achieve two tasks using pure Javascript: Retrieve the row number (this functionality is working) Change the background color of the row Below is my current code snippet: document.querySelector('#t ...

Having Trouble with Gulp and AutoPrefixer Integration

I have integrated Gulp into my project and am looking to utilize the autoprefixer feature. Here is a glimpse of my current gulp file: // Including gulp var gulp = require('gulp'); // Including necessary plugins var concat = require('gulp-c ...

Is there a way to dynamically update text using javascript on a daily basis?

I am currently developing a script to showcase different content and images every day. While I have successfully implemented the image loop to display a new picture daily, I need assistance in achieving the same functionality for the title. My aim is to c ...

Display an Open Dialog window when a Button is clicked

On a button click, I need to display an Open Dialog box. To achieve this, I am utilizing the FileUpload control for file uploading purposes, however, I prefer not to expose it to the user and would rather display a Button instead. ...

Utilize JQuery's .append() method to insert a new element into the DOM and then trigger an "on click" event within

I am attempting to use the .append() method to add a new radio button, and then when I click on the new radio buttons, trigger a new function. However, I am having trouble achieving this with my current code: HTML: <label>Where should the photo be ...

Retrieving data from a dynamic form using jQuery

Can someone assist me with the following issue: I have a dynamic module (generated by a PHP application) that includes input fields like this: <input type="text" class="attr" name="Input_0"/> <input type="text" class="attr" name="Input_1"/> ...

Using AngularJS, I can bind the ng-model directive to asynchronously update and retrieve data from

I am currently working with Angular to develop a preferences page. Essentially, I have a field in a mysql table on my server which I want to connect my textbox to using ng-model through an asynchronous xhr request for setting and fetching data. I attempt ...

The video on my site is refusing to play

I'm having an issue with a 2-second video that is not playing, yet when I tried a 10-second video it worked perfectly. Why is this happening? Could it be that HTML does not support videos that are shorter than 1-2 seconds? It seems like it's onl ...

LFT Etica font showcases digits with varying heights

In the project I am working on, we are required to use the font LFT Etica. However, there is an issue with the height of certain digits when displayed. Specifically, some numbers appear taller than others. Is there a way to make all digits have equal heigh ...

Eliminating "www" from the domain name leads to a separate website

I am new to this. The lack of support from mediaTemple and my current hosting provider has been frustrating, so I am turning to stackOverflow for help. My issue is that entering "www" before the domain name or leaving it out leads to different servers. ...

Tips on how to prevent a video from playing in the background of a popup even after it has been closed

After creating a video popup that plays upon clicking a button using jQuery, I encountered an issue where the video continues to play in the background even after closing the popup by clicking the close(X) button. Below is my code, can someone assist me in ...

Exciting animation in sidebar links text during toggle transition animation running

As the sidebar collapses, the text adjusts to its width in a choppy transition I'm seeking a way to display the text only when it fits perfectly within the sidebar without breaking into two lines I want the text to appear only after the collapse tra ...

Encountering a problem when trying to use event.target.value in an Angular TypeScript application

Here is the code from my app.component.html : <h1>Password Generator</h1> <div> <label>Length</label> </div> <input (input)="onChangeLength($event.target.value)"/> <div> <div> <input ...

A lone slant positioned at the lower border of an object

Currently, I am working with two images stacked vertically. The dimensions of the top image are set at 100% width and 350px height, while the bottom image size is not a major concern. I am specifically interested in skewing the top image and maintaining a ...

How deep can nesting go within a CSS rule?

When working with stylesheets, the majority of CSS rules follow a structured format: selector { property_1 : value_1; . . . property_n : value_n; } Each selector typically has only one {} block attached to it (without any sub {} blocks ...

How can I resize an element using jQuery resizable and then revert it back to its original size with a button click?

I need help figuring out how to revert an element back to its original size after it has been modified with .resizable. I attempted the following: <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="//code. ...

What is the reason behind Google Font's decision to preconnect to fonts.googleapis.com?

I've been looking to incorporate the Quicksand Font into my website, and Google suggested adding the following code: <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="h ...

Error: Incorrect data input in Django calendar form

I have a DateForm class defined in my form.py file: class DateForm(forms.Form): date = forms.DateTimeField( input_formats=['%m/%d/%Y %H:%M'], widget=forms.DateTimeInput(attrs={ 'class': 'form-control dateti ...

Issues with implementation of map and swiper carousel functionality in JavaScript

I am trying to populate a Swiper slider carousel with images from an array of objects. However, when I use map in the fetch to generate the HTML img tag with the image data, it is not behaving as expected. All the images are displaying in the first div a ...

The alignment of bullets in CSS property list-style-position is off

I'm encountering an issue with aligning the list items. I've been using the CSS property list-style-position: inside; Typically, the bullet points appear outside of the text, like this: https://i.stack.imgur.com/LcVB0.png This doesn't seem ...