Is there a way to remove this annoying double Google search bar?

Looking to replicate the Google home page for a project using HTML and CSS. I'm having trouble with incorporating the highlighted code (as shown in the second picture and identified by bold and italicized text) into my code. When I try to add it, I end up with this double search bar result (first picture), which is not the size I intended. Below is a snippet of my HTML code that you can also see in the second picture. Can anyone provide assistance?

Unfortunately, I am unable to share the CSS code here due to certain constraints, so you'll have to refer to the image provided. Apologies for any inconvenience.

View how the code looks in the browserCheck out the picture of the code

<div class="content">
  <div class="search-wrapper">
    <a href="" class="search-logo">
      <img src="google copy.jpg">
    </a>
    <div class="search-bar">
        ***<form action="https://google.com/search">
          <input type="text" name="q">
          <input type="submit" value="Google Search">
          </form>***
      <div class="search-icon">
        <i class="fa fa-search"></i>
      </div>
      <input type="text">
      <div class="search-icon right">
        <i class="fa fa-microphone"></i>
      </div>
    </div>
    <div class="search-buttons">
      <a href="">Google Search</a>
      <a href="">I'm Feeling Lucky</a>
    </div>
    <p class="search-info">
      This is a search bar. <a href="">Random Link</a>
    </p>
  </div>
</div>

Answer №1

You added an extra <input> tag unnecessarily. Please review the following code:

        <div class="content">
            <div class="search-wrapper">
                <a href="" class="search-logo">
                    <img src="google copy.jpg">
                </a>
                <div class="search-bar">***
                    <form action="https://google.com/search">
                        <input type="text" name="q">
                        <input type="submit" value="Google Search">
                    </form>***
                    <div class="search-icon">
                        <i class="fa fa-search"></i>
                    </div>
                    <!-- REMOVE THIS <input> -->
                    <div class="search-icon right">
                        <i class="fa fa-microphone"></i>
                    </div>
                </div>
                <div class="search-buttons">
                    <a href="">Google Search</a>
                    <a href="">I'm Feeling Lucky</a>
                </div>
                <p class="search-info">
                This is a search bar. <a href="">Random Link</a>
                </p>
            </div>
        </div>

Answer №2

I only implemented the HTML and did not apply your CSS. However, when I remove the input field that I mentioned in my comment, the second textbox disappears.

    <div class="content">
  <div class="search-wrapper">
    <a href="" class="search-logo">
      <img src="google copy.jpg">
    </a>
    <div class="search-bar">
        ***<form action="https://google.com/search">
          <input type="text" name="q">
          <input type="submit" value="Google Search">
          </form>***
      <div class="search-icon">
        <i class="fa fa-search"></i>
      </div>
      <!-- REMOVE THIS? <input type="text"> -->
      <div class="search-icon right">
        <i class="fa fa-microphone"></i>
      </div>
    </div>
    <div class="search-buttons">
      <a href="">Google Search</a>
      <a href="">I'm Feeling Lucky</a>
    </div>
    <p class="search-info">
      This is a search bar. <a href="">Random Link</a>
    </p>
  </div>
</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 I programmatically retrieve a comprehensive list of all global HTML attributes available?

Exploring the extensive list of global HTML attributes can be overwhelming, especially when considering how it continues to evolve with browser updates. Can JavaScript be leveraged to dynamically generate a complete list of these attributes without the ne ...

Selenium extracts valuable content, specifically the text within the <h2> tag of a webpage,

I am currently working on a project that involves entering a postcode (which will eventually be a list) into a website and saving the obtained results to a CSV file using a loop to move on to the next. However, I am encountering difficulties when it comes ...

Is it possible to customize the notification message displayed after clicking the save button in a listview within ng-admin?

While working on the listview/creation view, I am attempting to incorporate a custom notification message instead of the default one (please see the screenshot) that appears when the user clicks the save button. Is there a way for me to include a custom n ...

What is the best way to design a dynamic gallery that showcases three columns for large screens, but switches to two columns for mobile devices?

My goal is to create an image gallery using Bootstrap, with 3 columns on large screens and 2 columns on mobile. I want to maintain the aspect ratio of each image while fixing the width so they align within the columns. I was able to achieve this on large s ...

Having a bottom border only on input fields appears strange when viewed on a mobile device

When trying to achieve a bottom border on mobile, I encountered an unexpected issue where a strange line appeared instead in the browser. Here is an image of the problem: https://i.sstatic.net/PqEOF.jpg I expected to see a straight line as intended (it w ...

Seeing the Bootstrap css load immediately upon the page loading and switching between pages

Upon loading my webpage or navigating between subpages, I've noticed that the Bootstrap.css styles are interfering with my CSS transitions. For some reason, my regular links appear orange initially, but they turn blue during loading or when transition ...

Tips for choosing a block using Puppeteer

Trying to retrieve the height of a series of blocks using Puppeteer, I encountered an issue where I couldn't select my block in page.evaluate() due to an error. The code snippet in question is as follows: (async () => { const browser = aw ...

Conceal tooltip containing message using the required field validator in AngularJS

I'm looking to control the visibility of a tooltip for an input field that requires validation with the message: "This is a required field". Currently, I am implementing this using an ng-required input tag. <form novalidate name="CustAddressDe ...

When using setInterval, the image remains static on Safari but updates on Chrome

In my project, I am using a mock array to distribute data. One part of the project utilizes this data to display a list of cases, each with assigned images. When a case is hovered over, the images associated with that case are displayed one at a time, with ...

The Weglot country selector is not properly aligned with the rest of the content and its hover

Our Woocommerce store is now multilingual thanks to the weglot plugin. In the desktop view, we have integrated the country selector next to the shopping cart. For mobile view, we placed the HTML Widget in the header with some surrounding code: <div clas ...

Troubleshooting: How can I ensure my custom scrollbar updates when jQuery niceselect expands?

I am currently utilizing the jquery plugins mCustomScrollbar and niceselect. However, I have encountered an issue when expanding the niceselect dropdown by clicking on it - the mCustomScrollbar does not update accordingly. I suspect this is due to the abso ...

Showing how an iframe can adjust its height to 100% within a div element

Currently, I have a player status script implemented on our Minecraft Server. This script displays the server name, IP address, and the heads of the players currently online. The setup includes two div boxes for the status box: one outer box to fix its pos ...

Vertically center the container

I am struggling to center my container div vertically, similar to how it is horizontally aligning with margin: auto;. Despite searching online for solutions, I have not been successful in finding a method that works for me. It is surprising to me that in t ...

Looking to automate the scraping of Wikipedia info boxes and displaying the data using Python for any Wikipedia page?

My current project involves automating the extraction and printing of infobox data from Wikipedia pages. For example, I am currently working on scraping the Star Trek Wikipedia page (https://en.wikipedia.org/wiki/Star_Trek) to extract the infobox section d ...

Tips for relocating several buttons to the upper right corner

I have a dilemma with the positioning of 10 buttons on my webpage. Specifically, I would like to place them in the top right corner, but they are currently at the bottom. Can you assist me with moving the buttons? My desired outcome can be seen here. I s ...

How to vertically align text within a container in Bootstrap?

Lately, I've been facing a challenge in my attempts to vertically center text while also incorporating a full-width background image. The goal is for the centered text to maintain its position regardless of the height of the enclosing container. This ...

The onclick event in JavaScript is unresponsive on mobile devices

Our website is powered by Opencart 1.5.6.4 and the code snippet below is used to add items to the shopping cart. <input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?&g ...

Tips for expanding an input field to span across two td elements

I am attempting to design a simple form. The issue I am encountering involves creating an input field that spans two td's in the second row of my table. Despite using the colspan="2" attribute within the td tag, the input field does not expand over tw ...

Steps for displaying a website within a specific Div using HTML

I'm trying to set up a website to open within a specific <div> tag, like the example shown in this link: Responsive. Can anyone spot what I'm doing incorrectly? <html> <head> <script> function mobile320() { ...

Increase or decrease the quantity of items by cloning with Jquery and dynamically changing the ID

Currently, I am working on a jQuery clone project where I need to dynamically add and delete rows. Despite searching extensively on Stack Overflow and Google, I only have a basic understanding of how jQuery clone works. Any suggestions would be greatly ap ...