Hey there! I've been pondering the use of !DOCTYPE html lately.
I recently put together a basic webpage that looked great on most browsers except for IE. After doing some digging, it was recommended to me to use !DOCTYPE html. However, this ended up messing with some of my CSS, but not all of it.
I delved into the issue and found some advice about potential misspellings between my id tags and .css # tags.
Despite the hiccup, a small piece of JavaScript is still functioning properly for me. My two divs are working smoothly, allowing users to scroll while the submit button remains visible.
Unfortunately, I'm losing my CSS styling for the table and home button. It's all tied up in some old-school ASP code, which may be contributing to the problem since I'm more accustomed to using 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
%>
Here is the HTML header:
<!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 committed all your data?")
}
</script>
</HEAD>
<BODY>
And this is the CSS being used:
#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;
}
If anyone spots any glaring errors that I missed, please let me know. I understand that the CSS might appear differently on IE compared to other browsers, but if we can get it working, maybe I can create separate style sheets for IE and everything else.
I should mention that I've tried multiple doctypes with the same result.