另一种注释:
如果有后来人遇到像这样的问题:
明明有<meta charset="utf-8">声明,但<title>此心光明,夫复何言</title>显示到网页上还是乱码,等一些列匪夷所思的问题,请按以下步骤执行:
先全选(ctrl+a)->格式->转为utf-8无BOM格式,在刷新浏览器
这类问题大底是因为你直接复制了改教程的代码,但粘过去的是ASCII码格式的代码 交作业
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>文本字体</title>
<style type="text/css">
body{
background-color: beige;
height: 100%;
}
.h1{
color: #F00;
background-color: #000000;
font-weight: normal; /*font-weight 属性设置文本的粗细。*/
font-size: 3.6em;
height: 60px;
line-height: 60px;
}
#p{
font-weight: bold;
/*text-indent:2em;*/
line-height: 180%; /*line-height 属性设置行间的距离(行高)。注释:不允许使用负值。*/
font-family:sans-serif ;
color:#ff04bb ;
}
h1,p{
text-align: center;
}
</style>
</head>
<body>
<h1 class="h1">God say</h1>
<p id="p">In the beginning God created the heaven and the earth.<br/>And the earth was without form,and void;<br/>
And darkness was upon the face of the deep.<br/>And the Spirit of God moved upon the face of the waters.<br/>
And God said,Let there be light.And there was light.
</p>
</body>
</html>
交作业~
不二是女性吗?这么喜欢粉红色{:10_256:}{:10_254:} type_J 发表于 2017-1-26 22:12
不二是女性吗?这么喜欢粉红色
你认为我是,我就是~
肌肉粉?留给你自己吹水阁发掘了{:10_336:} joker11111 发表于 2017-2-28 00:17
另一种注释:
这类问题大底是因为你直接复制了改教程的代码,但粘过去的是ASCII码格式的代码
学习了~ 本帖最后由 lumber2388779 于 2017-5-4 10:55 编辑
line-height是行高不是居中吧,应该还要根据height来变化的吧。还有一个问题,height与font-size会有冲突吧,应该以哪个为主? 一档起步。
<!--XXXX-->;/*XXXX*/
交作业!
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<title>此心光明,夫复何言</title>
<style type="text/css">
h1{
color:#F08;
font-weight: normal;
font-size: 3.6em;
background: #BBFFEE;
height: 60px;
line-height: 60px;
}
p{
font-weight: bold;
/*text-indent: 2em;*/
line-height: 160%;
font-family: "Trebuchet MS";
}
h1,p{
text-align: center;
}
</style>
</head>
<body>
<h1>God say</h1>
<p>In the beginning God created the heaven and the earth.<br>And the earth was without form,and void;
And darkness was upon the face of the deep.<br>And the Spirit of God moved upon the face of the waters.
<br>And God said,Let there be light.And there was light</p>
</body>
</html> 不错不错 <!DOCTYPE html>
<html>
<meta charset="UTF-8">
<head>
<title>024-此心光明,夫複何言</title>
<style type="text/css">
h1{
color:#F08;
font-weight:normal;
font-size:3.6em;
background:#BBFFEE;
height:60px;
line-height:60px;
}
p{
font-weight:bold;
/*text-indent:2em;*/
line-height:160%;
font-family:"Trebuchet MS";
}
h1,p{
text-align:center;
}
</style>
</head>
<body>
<h1>God say</h1>
<p>In the beginning God created the heaven and the earth.<br>And the earth was without form,and void;<br>And darkness was upon the face of the deep.<br>And the Spirit of God moved upon the face of the waters.
<br>And God said,Let there be light.And there was light</p>
</body>
</html>
交作業了! 交作业啦
<!doctype html>
<html>
<meta charset="utf-8">
<head>
<title>WEB lesson 0024</title>
<style type="text/css">
h1
{
color:#f08;
font-weight:normal;
font-size:3.6em;
background:#bee;
height:66px;
line-height:66px;
}
p
{
font-weight:bold;
/*text-indent:2em;*/
line-height:160%;
font-family: "Trebuchet MS";
}
h1,p
{
text-align:center;
}
</style>
</head>
<body>
<h1>God <em>say</em></h1>
<p>In the beginning God created the heaven and the earth.<br>And the earth was without form,and void;<br>
And darkness was upon the face of the deep.<br>And the Spirit of God moved upon the face of the waters.<br>
And God said,Let there be light.<br>And there was light</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>此心光明,夫复何言</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
h1 {
color: #f08;
font-weight: normal;
font-size: 3.5em;
background: #bfe;
height: 65px;
line-height: 60px;
}
p {
font-weight: bold;
/* text-indent: 2em; */
line-height: 160%;
font-family: "Trebuchet MS";
}
h1,
p {
text-align: center;
}
</style>
</head>
<body>
<h1>God say</h1>
<p>In the beginning God created the heaven and the earth.
<br>And the earth was without form,and void;
<br>And darkness was upon the face of the deep.
<br>And the Spirit of God moved upon the face of the waters.
<br>And God said,Let there be light.And there was light
</p>
</body>
</html> <head>
<title>此心如是,夫复何求</title>
<style type="text/css">
h1,p{
text-align: center;
}
h1{
color: #F08;
font-weight: normal;
font-size: 3.6em;
background: #BBFFEE;
height: 80px;
line-height: 80px;
}
p{
font-weight: bold;
/*text-indent: 2em;*/
line-height: 160%;
font-family: "Trebuchet MS"
}
</style>
</head>
<body>
<h1>God say</h1>
<p>In the beginning God created the heaven and the earth. <br>And the the earth was without form, and void;<br> And darkness was upon the face of the deep.<br> And the Spirit of God moved upon the face of the waters.<br> And God said, let there be light. And there was light</p>
</body>
</html>
<img src="https://fishc.com.cn/forum.php?mod=image&aid=104858&size=300x300&key=ed5967e904dd9536&nocache=yes&type=fixnone" aid="attachimg_104858" alt="" border="0">
交作业
打卡!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>好看的排版</title>
<style type="text/css">
h1{
color: #F08;
font-weight: normal;
font-size: 3.6em;
background: #BBFFEE;
height: 60px;
line-height: 60px;
}
pre{
font-weight: bold;
text-indent: 2em;
line-height: 160%;
font-family: "Trebuchet MS"
}
h1,pre{
text-align: center;
}
</style>
</head>
<body>
<h1>GodSay</h1>
<pre>
In the beginning God created the heaven and the earth.
And the earth was without form,and void;
And darkness was upon the face of the deep.And the Spirit of God moved upon the face of the waters.
And God said,Let there be light.And there was light</pre>
</body>
</html> 不二一直如此优秀! 交作业
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<title>此心光明,夫复何言</title>
<style type="text/css">
h1 {
font-weight: normal;
color:#fd79a8;
font-size: 3.6em;
line-height: 50px;
height: 50px;
background: #dfe6e9;
}
p {
font-size: 20px;
font-weight: bold;
/* text-indent: 2em; */
text-align: left;
line-height: 160%;
}
h1,p {
font-family: "Trebuchet MS" ;
text-align: center;
}
</style>
</head>
<body>
<h1>God say</h1>
<p>In the beginning God created the heaven and the earth.
<br>And the earth was without form,and void;
<br>And darkness was upon the face of the deep.
<br>And the Spirit of God moved upon the face of the waters.
<br>And God said,Let there be light.And there was light</p>
</body>
</html> <!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<title>此心光明,夫复何言</title>
<style type="text/css">
h1,p {
text-align: center;
}
h1 {
color: #ff0088;
font-weight: normal;
font-size: 3.6em;
background: #bbffee;
height: 70px;
line-height: 60px;
}
p {
font-weight: bold;
/*text-indent: 2em;*/
line-height: 160%;
font-family:'Trebuchet MS';
}
</style>
</head>
<body>
<h1>God say</h1>
<p>In the beginning God created the heaven and the earth.<br>And the earth was without form,and void;<br>
And darkness was upon the face of the deep.<br>And the Spirit of God moved upon the face of the waters.<br>
And God said,Let there be light.And there was light</p>
</body>
</html>
页:
[1]
2