我的網頁有一些HTML5標籤。我使用<!DOCTYPE html>
爲同一個網頁...但我正面臨一些間距問題。我曾嘗試line-height:0px; and vertical-align
也......但這時一些其他的問題,開闢了......所以我不能使用的line-height:0; ...<!doctype .... /> for HTML5
我曾試圖改變<!DOCTYPE html>
到
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
通過這一切問題都得到解決和工作的罰款..:)...
我只是想知道它是否是添加
"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">"
在HTML5頁面
正確的方式......它會工作與否。 ...或者是我的HTML4標記任何其他方式....
謝謝...
編輯....
下面是一些代碼..好心將其保存爲HTML格式再看看......並與"<!DOCTYPE html" only
嘗試......你會發現區別...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
<style type="text/css">
.sharecon {
border-bottom: 1px solid #E6E6E6;
float: left;
padding: 3px 0 6px;
width: 100%;
font-family:Arial; font-size:12px;
}
.dvleft {
float: left;
}
.mleft5 {
margin-left: 5px;
}
.text11 {
color: #000000;
font-size: 11px;
}
strong {
font-weight: bold;
}
</style>
</head>
<body>
<div class="sharecon">
<span class="dvleft mleft5">
<input id="abc123" type="checkbox" onclick="javascript:EmailBoxGetFocus();CheckUncheck(this,'[email protected]');SetSelectedCount();EmailBoxLostFocus();" value="[email protected]" name="dlstContacts$ctl00$checkBoxSpn">
</span>
<span class="dvleft mleft15" style="margin-left:4px; margin:2px;">
<strong class="text11" style="line-height: 12px">ABC Name</strong>
<br>
<span class="light_text11" style="line-height:12px;display:inline"> [email protected] </span>
</span>
</div>
</body>
</html>
請定義*「一些間距問題」* – Oleg
您可能會更好地發佈引起問題的HTML,然後嘗試使用舊的doctype修復它。 – Sirko
'line-height:0px'不是解決方案 –