Arter Arter - 2 months ago 17
CSS Question

Css position on web page

Can someone help me with this? I want make this design, But I have problem with position. Here is image
enter image description here
Here is code

> https://plnkr.co/edit/Smyes7rZXVcqq5IugW2o?p=preview

Answer

The below skeleton will work for you best.

Set parent div's height and display to table (min-height won't work for you here). You can vertically align contents inside the parent div if you set child div's display to table-cell and vertical-align to middle. The child content will automatically align vertically even if the content height changes.

<div class="container">
  <div class="col-sm-6 left">
    <div class="inner">
      <span>become our partner</span>
      <a href="#">contact us</a>
    </div>
  </div>

  <div class="col-sm-6 right">
    //right side content
  </div>
</div>

.left{
  height: 500px;
  background: #ccc;
  display: table;
}
.inner{
  display: table-cell;
  vertical-align: middle;
  text-align: center;
}
.inner span, .inner a{
  display: block;
  text-transform: uppercase;
}
Comments