Top and Bottom border in CSS doesn't align text vertically inside a <div> tag

Peter S

So I am making a website and at the bottom of a page it has a slogan. Which in in a div with custom css (Including top and bottom borders).

However, the text is centered with css but is isn't centered vertically in between the two borders.

Here is my code.

#foot {
  border-bottom: 6px solid black;
  background-color: #9C0002;
  font-family: 'Balthazar', serif;
  color: black;
  text-align: center;
  border-top: 6px solid black;
  vertical-align: middle;
}
<div class="row" id="foot">
  <div class="col-lg-12">
    <h2>UNLOCKING  YOUR  POTENTIAL</h2>
  </div>
</div>

Any help would be really appreciated.

dippas

That's because in Twitter bootstrap, H1 to H3, has margin-top:20px and margin-bottom:10px

You need to override those values in your Custom CSS file.

#foot {
  border-bottom: 6px solid black;
  background-color: #9C0002;
  font-family: 'Balthazar', serif;
  color: black;
  text-align: center;
  border-top: 6px solid black
}
#foot h2 {
  margin: 10px /* choose whaterver you want */
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
  <div class="row" id="foot">
    <div class="col-lg-12">
      <h2>UNLOCKING  YOUR  POTENTIAL</h2>
    </div>
  </div>
</div>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Align div from bottom to top

From Dev

Align on top and on bottom in the DIV

From Dev

Vertically align a text with an image inside a div

From Dev

Vertically Align Image and Text Inside a Div

From Dev

Vertically align text inside a div with percentage height and width?

From Dev

HTML div border and text don't align

From Dev

How to vertically top align div inside of div?

From Dev

Text inside a div to align both vertically and horizontally

From Dev

CSS Align text at bottom of div

From Dev

css align text in input vertically to top

From Dev

Vertically align div inside a div

From Dev

Vertically align a img inside a div?

From Dev

CSS Align on the bottom doesn't work in Safari

From Dev

How to align text vertically equal top CSS

From Dev

Align inside div to right bottom in CSS

From Dev

Vertically align some text to top and some to bottom on same page

From Dev

Vertically Align <a> tag inside of a list

From Dev

Align table and div inside td to top and bottom respectively

From Dev

css align text in input vertically to top

From Dev

Vertically align div inside a div

From Dev

Align text vertically inside div with CSS

From Dev

Vertically align a img inside a div?

From Dev

Bootstrap table tr border top and bottom doesn't work

From Dev

Can't align vertically text inside a div which is aligned horizontally with others

From Dev

align text to bottom on two divs inside div

From Dev

How to vertically top align a <nav> inside a <div>?

From Dev

Vertically align <p> inside a <div>

From Dev

CSS : vertical align text at top of div

From Dev

align icon on top of text inside button tag