嗨,我想知道DOCTYPE要打破我的一些CSS,但不是所有的
我創建了一個簡單的網頁上除了IE的所有瀏覽器運行得很好用!DOCTYPE HTML的。 研究它建議我使用的問題!DOCTYPE html。然而,這似乎否定了我的一些CSS,但並不是全部。
我看着它,唯一能找到的建議是我的id標籤和.css#標籤之間的拼寫錯誤。
我有一小塊java腳本仍然可以正常工作。我的2個div工作正常,允許用戶在提交按鈕停留在屏幕上時滾動。
但我失去了我的CSS和主頁按鈕。它的所有包裹在可能造成這個問題的一些老同學ASP正如我以前只使用asp.net
<%
Set Cn = Server.CreateObject("ADODB.Connection")
Cn.Open CnString
' Build Sql.
Sql = "SELECT [USER_CODE],[WINDOWS_ID], [FIRST_NAME], [LAST_NAME], [ACTIVE_IND] FROM FSUSER ORDER BY [LAST_NAME]"
' Open recordset.
Set Rs = Cn.Execute(Sql)
If Not Rs.Eof Then arrayActiveUsers = Rs.GetRows()
Rs.Close
Set Rs = Nothing
Response.Write "<form action='main1.asp' method='post'>"
Response.Write "<div id=""top"">"
Response.Write "<button name=""regions1"" type=""submit"" value="®ions&" >Save_"®ions&"</button>"
Response.Write "<a href=""default.asp"" id=""home"" onclick=""return confirm('Have you saved your changes before leaving this page?');"" >Home</a>"
Response.Write "</div>"
Response.Write "<div id=""bottom"">"
Response.Write "<table id=""table1"">"
Response.Write "<tr>"
Response.Write "<td>User Code</td>"
Response.Write "<td>Windows ID</td>"
Response.Write "<td>First Name</td>"
Response.Write "<td> Last Name</td>"
Response.Write "<td> Status</td>"
Response.Write "<td> ACTIVATE</td>"
Response.Write "<td> DE-ACTIVATE</td>"
Response.Write "</tr>"
Response.Write "<tr>"
For j = 0 To UBound(arrayActiveUsers,2)
if arrayActiveUsers(4,j) = 1 then
Response.Write "<td>" & arrayActiveUsers(0,j) & "</td>"
Response.Write "<td>" & arrayActiveUsers(1,j) & "</td>"
Response.Write "<td>" & arrayActiveUsers(2,j) & "</td> "
Response.Write "<td>" & arrayActiveUsers(3,j) & "</td>"
Response.Write "<td ><font color=""green"">Active</font></td>"
Response.Write "<td></td>"
Response.Write "<td><input type=""checkbox"" name=""active"" value=" & arrayActiveUsers(0,j) &" /></td>"
Response.Write "</tr>"
else
Response.Write "<td>" & arrayActiveUsers(0,j) & "</td>"
Response.Write "<td>" & arrayActiveUsers(1,j) & "</td>"
Response.Write "<td>" & arrayActiveUsers(2,j) & "</td> "
Response.Write "<td>" & arrayActiveUsers(3,j) & "</td>"
Response.Write "<td><font color=""red"">Not Active</font></td>"
Response.Write "</td>" & "<td><input type=""checkbox"" name=""de- active"" value=" & arrayActiveUsers(0,j) &" /></td>"
Response.Write "<td></td>"
Response.Write "</tr>"
end if
next
Response.Write "</table>"
Response.Write "</div>"
Response.Write "</form>"
Cn.Close
Set Cn = Nothing
%>
所以這是HTML的標題:
<!DOCTYPE html>
<HTML>
<HEAD>
<link rel="stylesheet" type="text/css" href="main1.css">
<TITLE> Main </TITLE>
<script type="text/javascript">
function greeting(){
alert("Have you commited all your data?")
}
</script>
</HEAD>
<BODY>
這是css:
#top{
top:0;
position:fixed;
background: white;
}
#bottom{
margin-top:40px;
}
#home{
display: inline;
width: 115px;
height: 24px;
background: #E6E6E6;
padding: 0px;
text-align: center;
border-width:2px;
border-style:ridge;
border-color: gray;
color: black;
}
#table1{
padding:3;
border:groove,2px,#f0f0f0;
background-color:a0a0a0;
}
我很抱歉,我沒有發現任何明顯的錯誤。我知道CSS會在IE和其他瀏覽器上看起來不一樣,但如果有人能讓它工作,也許我可以爲IE瀏覽器創建2個樣式表,一個用於其他所有內容。
我要補充我已經嘗試了多種文檔類型都達到同樣的效果
嗨 我在這裏創建了一個jsfiddle示例: http://jsfiddle.net/Vn8fp/ – user183200
使用小提琴我解決了我的問題。 非常感謝您的建議:-) – user183200