我想为我的页面设置基线网格,但是当我设置字体比例时,文本不适合基线网格。设置基线网格
我在做什么错了?问题与字体比例有关?
这里是小提琴:http://jsfiddle.net/3stut/
这里是代码:
HTML
<body>
<h1>Your Name</h1>
<h2>Your Name</h2>
<h3>Your Name</h3>
<h4>Your Name</h4>
<h5>Your Name</h5>
<h6>Your Name</h6>
<p>Paragraph</p>
</body>
CSS
body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, fieldset, input, textarea, p, blockquote, th, td {
margin: 0;
padding: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
fieldset, img {
border: 0;
}
address, caption, cite, dfn, th, var {
font-style: normal;
font-weight: normal;
}
caption, th {
text-align: left;
}
h1, h2, h3, h4, h5, h6 {
font-size: 100%;
font-weight: normal;
}
q:before, q:after {
content: '';
}
abbr, acronym {
border: 0;
}
h1,h2,h3,h4,h5,h6,hgroup,ul,ol,dd,p,figure,pre,table,fieldset,hr,.header,.media,.island{
margin-bottom:1.5rem;
}
html {
font:1em/1.5 Cambria, Georgia, "Times New Roman", Times, serif;
background: url(http://media.smashingmagazine.com/wp-content/uploads/technical-type/img/css/grid.png) center -6px repeat-y #fff;
color: #333;
width: 940px;
padding: 0 10px;
margin: 0 auto;
}
body {
width: 460px;
margin: 0 auto;
padding-top: 72px;
}
h1 {font-size:48px;}
h2 {font-size:30px;}
h3 {font-size:24px;}
h4 {font-size:21px;}
h5 {font-size:18px;}
h6 {font-size:16px;}
定义“基线网格”。我真的不明白你的问题。当你改变它的布局时,没有使用head元素的用处。您可以简单地使用段落或任何其他文本元素。我建议不要更改为字体大小,因为这些元素是默认定义的。 – nkmol
我的目标是让所有文本都坐在基线网格中,如下所示:http://media.smashingmagazine.com/wp-content/uploads/technical-type/img/full/10.jpg,http:// media.smashingmagazine.com/wp-content/uploads/technical-type/img/full/09.jpg,为了给我的文字赋予垂直节奏 – swayziak
这不是原来的布局吗? http://jsfiddle.net/3stut/3/ – nkmol