Sam Jefferies
Sam Jefferies

Reputation: 594

Reduce padding of div

I've created a div (greenpromobox) which an email form sits in. There is a chunk of padding to the right, bottom and left of the div and I can't workout how to reduce it to slim down the div?

I believe it maybe in one of the pre-built Bootstrap styles.

Live example: http://185.123.96.102/~kidsdrum/moneynest.co.uk/

HTML

 <div class="greenpromobox">
    <div class="h2extrapadding hidden-xs hidden-sm"></div>  <h2 class="boldme">Take our free <b class="jumpstarttext">Jumpstart Your Finances</b> class to<br /> quickly gain control over your finances</h2>
     <p class="text-center">
               <br>
            <!-- Begin MailChimp Signup Form -->
<div id="mc_embed_signup">
<form action="//moneynest.us11.list-manage.com/subscribe/post?u=9ccf2d2219536b32eaae3c3d1&amp;id=299de51b4e" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
    <div id="mc_embed_signup_scroll">


                   <img src="http://185.123.96.102/~kidsdrum/moneynest.co.uk/img/hand-drawn-arrow.png" id="handarrow" class="hidden-xs hidden-sm" alt="arrow"><input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="Enter your email address" required autofocus>
    <!-- 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_299de51b4e" tabindex="-1" value=""></div>
    <div class="clear"><input type="submit" value="Start Class Now" name="subscribe" id="mc-embedded-subscribe" class="text-uppercase btn btn-primary btn-lg"></div>
    </div>
</form>
</div>

<!--End mc_embed_signup-->

Upvotes: 2

Views: 15670

Answers (2)

Paradoxetion
Paradoxetion

Reputation: 726

Just before the div with id #mc_embed_signup you have this code

<p class="text-center">
  <br>
  <!-- Begin MailChimp Signup Form -->
</p>

Which basically does nothing, but adds empty space. As I see you reduced this space by doing things like

#mc_embed_signup input.email {
    position: relative;
    top: -35px;
}

and

.btn-lg {
    position: relative;
    top: -37px;
}

And this is why you have "padding" at the bottom. It's not padding, it's the space where buttons located. So:

  1. Remove html code we don't need (or display: none it, whatever)
  2. Remove css I've placed here
  3. Put normal bottom padding you want

Upvotes: 1

Richard Foucaud
Richard Foucaud

Reputation: 310

The problem came from your CSS.

First, remove the width:70%; into your CSS File

After you can add this :

width:auto;
padding:0 15px 15px 15px;
display:table;

The result must be like this :

CSS

.greenpromobox {
    display: table;
    padding: 15px;
    background-color: green;
    padding-top: 1px;
    margin-top: 25px;
    width: auto;
    border-radius: 5px;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

Hope this answer will help you :)

Richie

Upvotes: 0

Related Questions