How do I focus on a full page?

How to focus on the full page? I tried to add the object.css.css file:

#content { width: 700px ; margin-left: auto ; margin-right: auto ; 

}

But it did not help. I also tried:

 .field { margin:auto; width:70%; } 

But this did not include the elements h1

Thanks. EDIT: http://imgur.com/2fzfJ

0
source share
3 answers

This is not a Ruby on Rails question, but an HTML / CSS question. Your stylesheet should contain something like:

 body { text-align: center; } 

And, of course, any other content in your layout may have other effects.

+2
source

To center the elements on the page you use margin:0 auto; , and set the width, but to the center of the text inside the element that you would use text-align:center;

+1
source

In the content center, we first complete the page in a div, then center the #content inside that wrapper div.

your css will look like this:

  #wrapper { width: 100%; height: auto; } #content { margin: 0 auto; width: 700px; } 

your html will look like this:

  <div id="wrapper"> <div id="content"> Content Stuffs </div> </div> 
+1
source

Source: https://habr.com/ru/post/1486386/


All Articles