title: centering multiline paragraph in the middle of the screen
body: <p>How can I center one div in the middle of the screen? Mainly I have problems with horizontal centering. If I use absolute positioning, then only the first line is in the middle horizontally. My code:</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;en&quot;&gt;
  &lt;head&gt;
  &lt;meta charset=&quot;utf-8&quot;/&gt;
  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
      &lt;title&gt;hey I am a title&lt;/title&gt;
      &lt;style&gt;
          html, body {width: 100%; height: 100%;}
          .t7{
              text-align: center;
              position: relative; top: 50%;}
      &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;!-- this code centers an element in the middle of the screen --&gt;
  
  
  &lt;div class=&quot;t7&quot;&gt;
      I am a text in the middle of the screen.
      &lt;br&gt;
      second line
      &lt;br&gt;
      third line
      &lt;br&gt;
      fourth line
      &lt;br&gt;
      fifth line
  &lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>Thank you.</p>