-1
<div class="sc-content-footer container">
<div class="row">
<div class="col-md-4">
<!-- Begin MailChimp Signup Form -->
</div>

<div class="col-md-4">
<img src="images/BSY_LOGO_SIGNAGE.png">
</div>

<div class="col-md-4">
<!-- Begin MailChimp Signup Form -->
</div>

Nothing seems to work, text-align: center does nothing. The content inside the 3 divs is: mailchimp form, logo, mailchimp form

Rob
  • 14,746
  • 28
  • 47
  • 65
bogdan
  • 667
  • 1
  • 8
  • 17

5 Answers5

3

text-align: center only works if the element you are aligning has display: inline-block.

Also text-align: center is not on the element you are aligning, but on the parent of the element you are aligning.

.inner {
  width: 100px;
  height: 100px;
  background-color: red;
  display: inline-block;
}

.outer {
  blackground-color: yellow;
  width: 100%;
  text-align: center;
}
<div class="outer">
<div class="inner">

</div>
</div>
Hielke Walinga
  • 2,677
  • 1
  • 17
  • 30
2

...I wish I had spent a little more time before asking here. I apologize to everyone, I am new to web design and I got frustrated. Won't happen again.

The problem was Mailchimp's custom CSS. I removed the CSS stylesheet imports from the form HTML, and added Bootstrap classes to the textboxes and buttons. Now everything is fine and dandy.

bogdan
  • 667
  • 1
  • 8
  • 17
1

in css the outer DIV has:

position: relative;

and inner DIV has

position:relative; margin:0 auto;

try this, this is correct form.

Michel Simões
  • 234
  • 3
  • 8
0

It becomes tricky when the <div> tags are nested, but please try:

.container
{         
     width: 50%; 
     margin: 0 auto;
}

.row
{
   display: inline-block;
   text-align: center;
}
Tebogo Khanye
  • 380
  • 1
  • 7
  • 18
0

Since you're using Bootstrap, you can simply use a Bootstrap class (text-center) to center align the div content.

Edit your code to something like this:

<div class="sc-content-footer container text-center">
<div class="row">
<div class="col-md-4">
<!-- Begin MailChimp Signup Form -->
</div>

<div class="col-md-4">
<img src="images/BSY_LOGO_SIGNAGE.png">
</div>

<div class="col-md-4">
<!-- Begin MailChimp Signup Form -->
</div>
</div>
</div>

You can also put the text-center class in the children div if you are still having problems after running the above code.

derloopkat
  • 6,232
  • 16
  • 38
  • 45