Div's background color only extends across half of its width

I am having trouble making my div (#signupform) have a light grey background color that extends to the full height of the div.

Currently, the background color stops at the end of the email input field.

Any suggestions on how to fix this issue?

For reference, check out this live example:

#signupform {
  background-color: lightgray;
}

#signupinput {
  display: block;
  text-align: center;
  max-width: 50%;
}

.email-sign-up-headline {
  padding-top: 10px!important;
}

#mcsignupbutton {
  width: 50%;
  display: block;
  text-align: center;
  margin-left: 25%;
}

#mcinputform {
  max-width: 50%;
  display: block;
  text-align: center;
}
<div id="signupform" style="background-color: lightgrey;">
  <center>
    <h3 class="email-sign-up-headline">Subscribe to the private Money Nest newsletter</h3>
  </center>
  <form action="https://moneynest.us11.list-manage.com/subscribe/post?u=9ccf2d2219536b32eaae3c3d1&amp;id=33b662ad0d" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
    <div id="mc_embed_signup_scroll">
      <center><input type="email" value="" name="EMAIL" class="email" id="mcinputform" placeholder="email address" required></center><input id="group_8" style="display: none;" checked="checked" name="group[12353][32]" type="checkbox" value="1" />
      <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
      <div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_9ccf2d2219536b32eaae3c3d1_33b662ad0d" tabindex="-1" value=""></div>
      <div class="clear">
        <center><input type="submit" value="Subscribe" name="subscribe" id="mcsignupbutton"></center>
      </div>
    </div>
  </form>
</div>

Answer ā„–1

The reason for this issue is that the input[type="submit"] within div.clear is floated to the left, and there is no content in the .clear div following it to clear the float. To resolve this issue, you can include the following code within the .clear div:

.clear::after {
    content: '';
    clear: both;
    display: block;
}

Answer ā„–2

 .subscribe-header {
        color: #f8f8f8;
        text-align: center;
    }

    .subscribe-body {
        background-color: #ddd;
        padding: 15px;
        height: 210px;
        color:#808080;
    }

    .custom-tab-content {
        color: #000;
        font-family: 'Open Sans', sans-serif;
    }
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

<div class="container">
<div class="col-md-12">
<div class="subscribe-header" style="margin-top:40px;">
        <div class="subscribe-body" align="center">
            <div class="subscribe-panel">
                <h3>Stay informed with the exclusive Money Nest newsletter.</h3>
                <form action="" method="post">
                    <div class="col-md-offset-4 col-md-4">
                        <div class="form-horizontal">
                            <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon"><i class="glyphicon glyphicon-envelope" aria-hidden="true"></i></span>
                                    <input type="text" class="form-control input-lg" name="email" id="email" placeholder="Enter your Email" />
                                </div>
                            </div>
                            <div class="form-group">
                                <button class="btn btn-warning btn-lg">Sign Up Now!</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</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

How can I ensure that images remain within the link elements in a flex container?

I'm currently assisting a colleague with his website. His main request is to have the two images positioned below the larger image at the beginning of the page align perfectly with the edge of the page, so that the right image lines up with the one ab ...

Customized Bootstrap Dropdown with the ability to add text dynamically

I am working on a Bootstrap dropdown menu that allows users to generate expressions by clicking on the menu items. For example, when the "Action" item is clicked, it should insert {{Action}} into the textbox. The user can then type something like "Hello" a ...

How to avoid an additional carriage return in Internet Explorer when editing a Textarea?

In Internet Explorer, we are facing an issue with a multiline textarea. After setting the content using JavaScript and checking it, everything appears correct without any additional carriage returns in the textarea: document.getElementById( 'text-ar ...

Move a <div> using a handle (without using JQuery)

I devised a plan to create a moveable div with a handle and came up with this code snippet: var mydragg = function() { return { move: function(divid, xpos, ypos) { divid.style.left = xpos + 'px'; divid.style.top = ypos + &apo ...

Tips for streaming an mp3 file on the internet

Is there a way to play an MP3 on a webpage without allowing users to download it? ...

Unable to define attributes of a non-existent element (specifically 'innerHTML') within a Vanilla JavaScript component

Currently, I'm developing a Vanilla JS Component and encountering a challenge with utilizing the innerHTML() function to modify the text within a specific ID in the render() HTML code. The problem at hand is the Cannot set properties of null (setting ...

Sort posts alphabetically by their first letter using jQuery

Currently, I am dealing with a collection of products sourced from WooCommerce and displayed as custom posts through the Elementor page builder at this link: My attempt to incorporate an alphabetical filter using a plugin has not been successful, most lik ...

Showing information from a table for editing purposes with the use of HTML input tags

As I navigate my way through the complexities of HTML and PHP coding, Iā€™m faced with a challenge in displaying database content on an editable table within my web page. Clicking the edit button should lead to a separate page where data can be modified. ...

Search Bar on the Website for Google Search

I am currently working on a basic website and I'm looking to incorporate Google Search functionality into it. I've managed to create a simple search box that redirects users to the Google Search Results page when they input their query. However, ...

Achieve this effect by making sure that when a user scrolls on their browser, 50% of the content is entered into view and the remaining 50%

Is there a way to achieve this effect? Specifically, when the user scrolls in the browser, 50% of the content is displayed at the top and the other 50% is shown at the bottom. ...

What is the best way to position two divs side by side at the bottom of the

When trying to align my second div with the first one, I face an issue. If the text above the first blue box is longer, the second div appears to be outside the line of the box. Changing the relative position doesn't solve this problem either. When th ...

What improvements does IE7 offer compared to IE6?

Many developers in the web development industry often express frustration when it comes to developing for IE6. But when working with a powerful JavaScript framework such as jQuery, does the process of developing for IE6 differ significantly from that of ...

WebDriver does not support compound class names and will throw an error

I have a function that can calculate the total number of elements within divs and return this count. public int getNumberOfOpenBets() { openBetsSlip = driver.findElement(By.id("form_open_bets")); openBets = openBetsSlip.findElements(By.classNa ...

Tips for creating animated arc fills using CSS

Can we gradually fill the color of a CSS semi-circle in a counterclockwise direction, similar to a progress bar? Here is the code for the semi-circle: https://jsfiddle.net/sonymax46/wqfovdjh/7/. .cc{ background-color: transparent; overflow: hidd ...

Steps for incorporating a variable into a hyperlink

I'm trying to achieve something similar to this: var myname = req.session.name; <------- dynamic <a href="/upload?name=" + myname class="btn btn-info btn-md"> However, I am facing issues with making it work. How can I properly ...

What is the best way to automatically show scrollbars when a page loads using JavaScript?

How can I make the vertical scrollbar appear as soon as the page loads using javascript? I am currently using a jquery slide toggle animation that causes the vertical scrollbar to show up because it makes the page longer. However, when the scrollbar appear ...

The HTML5 Canvas Misalignment Issue

I currently have some HTML code that includes a canvas, span, and a button: <canvas id='myCanvas'></canvas> <span id='coords'></span> <button class='clear'>clear</button> Accompanying this ...

Is there a way to retrieve files stored on my hard drive within a webpage?

I have a large number of files stored on my hard drive, all following the same format, 2014.C1.012.012 - full name of the file. They each have unique numbers and names. I want to create a local webpage where I can organize these files into a table w ...

Troubleshooting Problem with Responsive Bootstrap Navbar

I've been working on creating a menubar using Bootstrap where the logo image is centered instead of being on the left side of the bar. However, I'm facing an issue where the right links in the menu go off the screen. When I view the page with a w ...

What could be the reason for my PHP files not appearing in my CSS navigation tabs?

In my PHP document, I am using CSS navigation tabs to display three different files. <div id="Tum" class="w3-container training"> <h2>TUM</h2> <?php include("tum.php"); ?> </div> <div id="Atol" class="w3-container traini ...