這是最簡單的html文檔。我指定margin-top
在h1
風格。這裏的文件:margin-top不起作用
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Free mind!</title>
<style type="text/css">
p {
font-family : DejaVu Sans Mono;
font-size : 12pt;
line-height : 100%;
margin-top : 0cm;
margin-bottom : 0.3cm;
white-space : pre-wrap;
display : inline;
}
h1 {
font-size : 14pt;
line-height : 100%;
margin-top : 1cm;
display : inline;
color : blue ;
}
</style>
</head>
<body>
<h1>Bio</h1>
<p>
bk-simulates-range.py -S "" -b "" -e "" -s "" -t dspc.top -n 3000000 -c -j bk-runs-mpi.bash -w "-4.5.5-double_gcc" 2&> `date +%Y-%b-%d-%H%M%S`.log &
bk-pymol-selects.py -f confout.gro -s "resi 1-128" -t traj.trr -i 50
bk-pymol-selects.py -f *ane.gro
bk-pymol-pic.py -f confout.gro -s "resi 1-128" -x "-2" -y "-3" -z "0" -t traj.trr
</p>
<h1>Bash</h1>
<p>
cd /new/dir; (cd /old/dir; find -type d ! -name .) | xargs mkdir
for i in `ls`; do $i; done
</p>
</body>
</html>
我對這個問題一定很簡單。
編輯:
所以問題是:
display : block;
在
h1
規範
。我結束了使用(在這裏我引用head
和body
- 其他部分不需要改變):
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Free mind!</title>
<style type="text/css">
p {
font-family : DejaVu Sans Mono;
font-size : 12pt;
line-height : 100%;
margin-top : 0px;
margin-bottom : 0px;
white-space : pre-wrap;
display : inline;
}
h1 {
font-size : 14pt;
line-height : 100%;
margin-top : 20px;
margin-bottom : -1px;
display : block;
color : blue ;
}
</style>
</head>
<body>
<h1>Bio</h1>
<p>bk-simulates-range.py -S "" -b "" -e "" -s "" -t dspc.top -n 3000000 -c -j bk-runs-mpi.bash -w "-4.5.5-double_gcc" 2&> `date +%Y-%b-%d-%H%M%S`.log &
bk-pymol-selects.py -f confout.gro -s "resi 1-128" -t traj.trr -i 50
bk-pymol-selects.py -f *ane.gro
bk-pymol-pic.py -f confout.gro -s "resi 1-128" -x "-2" -y "-3" -z "0" -t traj.trr</p>
<h1>Bash</h1>
<p>cd /new/dir; (cd /old/dir; find -type d ! -name .) | xargs mkdir
for i in `ls`; do $i; done</p>
</body>
也有人說,em
和px
應該用來代替cm
和pt
- 爲cm
和pt
都沒有好爲網絡。
你能更具體地說明什麼是錯的嗎? – paulmorriss 2012-01-12 15:01:46
@paulmorriss:哦 - 對不起。上面的代碼中'h1'的邊距是錯誤的。它不是'1cm',因爲它必須符合規範。 – Adobe 2012-01-12 16:50:05