-1

我出于非传统原因追求 HTML。我认为它在学术论文中提供了比 MS Word 或 LaTeX 更合适的画布,因为它为作者提供了更好的交流方式。我正在尝试编写一种可用于符合传统 APA 6 指南的学术论文的格式。

我想使用 index.html 文件或 style.css (我不知道哪个更合适)使页面看起来像 8.5 宽的纸(确切的尺寸并不重要),而不是全宽浅灰色背景。这是在 wordpress 22 主题中完成的,如下所示:

在此处输入图像描述

如何通过更改 index.html 文件(如下所示)来复制这种感觉,或者我可能需要在 style.css 文件中添加一些内容?具体来说,我如何才能在顶部带有“页面”的彩色背景?

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>title</title>
    <link rel="stylesheet" href="style.css">
    <script src="script.js"></script>
  </head>
  <body>
    Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this.
  </body>
</html>

我尝试从 22 处窃取但无法理解,因为文件是 php,而且我不知道 style.scc 文件中的内容在做什么。

4

1 回答 1

2

这是一个简单的例子......具体的规则很容易改变,但应该给你一个想法。div.container基本上,您在 body ( )的子元素上设置小于 100% 的宽度。然后,将margin-leftmargin-right值设置为auto以使其水平居中。The height:400pxand the margin-topand margin-bottomset to1em是任意值。您的页面内容只需要在div.container元素内构建......您的人造页面。

演示:http: //jsfiddle.net/ZXdY8/

CSS

body {
    background: #efefef;
}
.container {
    width: 90%;
    height: 400px;
    margin: 1em auto;
    background: #FFF;
}
.container p {
    padding: 1em;
}

HTML

<body>
   <div class="container">
      <p>Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this.</p>
   </div>
</body>
于 2013-04-23T04:08:21.230 回答