【发布时间】:2018-08-20 18:28:28
【问题描述】:
这是我的 HTML 页面:
https://jsfiddle.net/62czmtvt/2/(实际查看 HTML 页面是否正常工作)
来自 JSFiddle 的代码:
:root {
background-color: #FFFACD;
}
div.infoguide {
width: 240px;
font-family: Arial, sans-serif;
font-size: 13px;
background-color: #F0FFF0;
}
div {
margin: 5;
padding: 0;
border: 0;
outline: 0;
}
A:link {
text-decoration: underline;
color: rgb(204, 51, 51);
}
A:visited {
text-decoration: underline;
color: rgb(204, 51, 51);
}
A:active {
text-decoration: underline;
color: rgb(204, 51, 51);
}
A:hover {
text-decoration: underline;
color: rgb(204, 51, 51);
}
body {
margin-left: 0px;
margin-top: 0px;
}
body,
td,
th {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: rgb(46, 46, 46);
line-height: 16px;
}
h1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 20px;
font-weight: bold;
line-height: 20px;
margin-bottom: 0px;
}
h2 {
font-family: Arial, Helvetica, sans-serif;
font-size: 15px;
font-weight: bold;
margin-bottom: 0px;
}
h3 {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-weight: bold;
margin-bottom: 0px;
}
h3 A:link {
text-decoration: none;
color: rgb(204, 51, 51);
}
h3 A:visited {
text-decoration: none;
color: rgb(204, 51, 51);
}
h3 A:active {
text-decoration: none;
color: rgb(204, 51, 51);
}
h3 A:hover {
text-decoration: underline;
color: rgb(204, 51, 51);
}
ul {
margin-left: 1.5em;
padding-left: 0px;
}
.info_data {
border-color: rgb(137, 137, 137);
border-style: solid;
border-width: 1px;
font-size: 11px;
padding: 4px;
text-align: center;
}
.news_headline {
font-family: Arial, Helvetica, sans-serif;
font-size: 15px;
font-weight: bold;
line-height: 22px;
}
.red {
color: rgb(204, 51, 51);
}
.red_padded {
color: rgb(204, 51, 51);
padding: 4px 0px;
}
.redbg {
background-color: rgb(220, 6, 0);
}
<title>First Drive: 2017 Porsche Panamera - Autos.ca</title>
<div class="infoguide">
<H3>It works!</h3>
<p>It works!</p>
</div>
<div class="info_data">
</div>
<div class="infoguide">
<h2 class="red">A headline</h2>
<p>It works!</p>
</div>
这是一个沙盒页面,用于杂志网站的类似博客的布局,我正在尝试实现这种外观:
但到目前为止,我还没有完全设法让它看起来像我想要的那样,它是一个三列 DIV,带有伪博客样式布局中的标题。
我一直在尝试我的 CSS 文件中的 :root 元素,这在 HTML5 页面中是鼓励还是不鼓励?
如果有任何建议或帮助,我将不胜感激!
【问题讨论】:
-
尽管它是一个 JSFiddle,但请尽量保持代码干净并使用缩进。这样就更容易发现任何关于缺少结束标签或错字的错误。对于使用模板的快速/运行启动,我建议使用引导程序,或者只是引导程序的网格系统。 getbootstrap.com
标签: css html layout css-multicolumn-layout