J
J
jenya77712016-04-25 19:52:06
css
jenya7771, 2016-04-25 19:52:06

How to align text in the center of the screen?

How to align text in the center of the screen?

<div class="header">
    <div class="container-fluid">
      <div class="row">
        <div class="col-md-3 col-xs-4 col-sm-3">
          <a href="index.html"><img src="image/logo.png" alt="logo" class="img-responsive"></a>
        </div>
        <div class="col-md-8">
          
        </div>
      </div>
      <div class="container">
        <div class="row">
        <div class="col-md-4 col-xs-4 col-sm-4">
        </div>
        <div class="col-md-6 col-xs-5 col-sm-5">
          <div class="nadp">
            <h1 class="lead">Текст</h1>
            <h2 class="lead">Текст_2</h2>
          </div>
        </div>
        </div>
      </div>
    </div>
  </div>

.header{
  width: 100%;
  height: 100%;
  vertical-align: middle;
}
.nadp{
}
.nadp h1, .nadp h2{
  color: #fff;
  text-align: center;
  font-size: 'Sylfaen Regular';
  display: inline-block;
}
.nadp h1{
  padding: 1%;
  font-size:6vw;
  border-bottom: 3px solid #fff;
}
.nadp h2{
  font-size:3vw;
}

text and text_2 should be in the center on any device, under each other, please help, thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2016-04-25
@gangstarcj

Hint:
display: table-cell; cervical-align:middle; height:100%;
Well, in order for everything to work, you still need to add everything

A
Alexander Alekseev, 2016-04-26
@shure348

.nadp set height and width
position: fixed;
margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question