html - 如何将此 html 正文向右移动?

标签 html css

我有一个简单的 html 页面,但正文太靠近左侧了。我想在左边留一些边距。换句话说,我想将 html 正文向右移动。

html代码如下;

<!DOCTYPE html>
<html ng-app="myApp">
  <head>
    <title>head title</title>
  </head>
  <body>

      <h1>Test Page</h1>
      <table class="table table-bordered" style="width: auto">
        <thead>
        </thead>
        <tbody>
          <tr>
            <td>
              <strong>Column1</strong>
            </td>
            <td>Col1 data</td>
          </tr>
          <tr>
            <td>
              <strong>Column1</strong>
            </td>
            <td>Col2 data</td>
          </tr>
        </tbody>
      </table>

      <form novalidate="" class="simple-form">PersonID

      <input type="text"  />    
      <BR><BR>
      name
      <input type="text" />    
      <BR><BR>

      <button ng-click="submit()" id="submit_btn">SUBMIT</button> 

      </form> 
      <br>
    </div>

  </body>
</html>

我该怎么做才能将 html 正文稍微向右移动,使其看起来不会太靠近左侧?

最佳答案

在你的头标签之间添加:

<style type="text/css">
<!-- 

body {
   padding: 10px;
}

-->
</style>

这会将 body 标签内的所有内容都推 10px。将其更改为最适合您的内容。 10px 可能不多。

关于html - 如何将此 html 正文向右移动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26395622/

相关文章:

javascript - html2canvas - 错误 - 对象 HTMLCanvasElement

javascript - 为具有长标签的 md-input 显示星号图标

html - 制作一个与其兄弟列高度相同的 flex 列

javascript - Fancybox 在页面中途加载

css - GWT:标签 getOffsetHeight() 值与 CSS 值不匹配

javascript - 使用 jquery 删除 html 中的样式标签

html - 如何使 Bootstrap 导航栏移动友好?

html - css 计数器和自定义组件(没有 shadow dom)

php - Wordpress CSS 样式表不影响小部件输出

javascript - 多个changeImage实例