Semantic-UI: Why is the Body not the same viewport size?

好久不见. 提交于 2019-12-05 09:39:29

It is because of the ui grid property which pulls content outside its area due to negative margin. Try setting it to 0.

.ui.grid {
  margin: -1rem; // Change to 0
}

The best practice is to wrap the ui grid inside a container. I am not sure why .container CSS code is missing in your site but they have it in Docs.

Semantic UI Docs The grid is wrapped inside .main.container which has a width set.

The problem appears bcz of the default margin of "ui grid". To Fix it just add "padded" class to the "ui grid" element. Just like this:

<div class="ui grid padded">
  <!-- your columns -->
</div>

if you set

 .ui.grid {margin:0}

it will work

Simon H

As Manoj hinted, the solution according to the docs for the main grid is

<div class="ui grid container">
  <div class="four wide column">
    <!-- ... -->
  </div>
  <!-- ... -->
</div>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!