0
我正在創建的HTML登錄頁面, 用下面的代碼:HTML表和輸入標籤
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=Utf-8">
<TITLE>
Přihlášení a Registrace
</TITLE>
<style>
table {
width: 33.7%;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
background: red;
text-align: center;
font-size: 28px;
height: 35px;
}
</style>
</HEAD>
<BODY bgcolor=black>
<div style="text-align: center;">
<P><H1>Přihlaste se:</H1>
<br>
</P>
<FORM method="POST" action="login.php"> <H1>
<TABLE align=center ><TR><TD >Uživatelské jméno</TD></TR></TABLE>
<br>
<INPUT name="Username" align=center type="text" value="" style="width:33.7%; height:35px; font-size:28px; border-bottom-left-radius:10px; border-bottom-right-radius:10px;"required fontsize=10 />
<BR />
<br>
<TABLE align=center ><TR><TD>Heslo</TD></TR></TABLE>
<br>
<INPUT name="Pasword" type="password" align=center value="" style="width:33.7%; height:35px; font-size:28px; border-bottom-left-radius:10px; border-bottom-right-radius:10px;"required fontsize=10 />
<BR />
<br>
<input type="submit" alt="Submit" align=center style="width: 33.7%; height: 35px; font-size:28px; background:red; border:0px; border-radius:10px;" >
<BR> </H1>
</FORM>
</div>
</BODY>
</HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=Utf-8">
<TITLE>
Login
</TITLE>
<style>
table {
width: 33.7%;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
background: red;
text-align: center;
font-size: 28px;
height: 35px;
}
</style>
</HEAD>
<BODY bgcolor=black>
<div style="text-align: center;">
<P><H1>log in here:</H1>
<br>
</P>
<FORM method="POST" action="login.php"> <H1>
<TABLE align=center ><TR><TD >User name</TD></TR></TABLE>
<br>
<INPUT name="Username" align=center type="text" value="" style="width:33.7%; height:35px; font-size:28px; border-bottom-left-radius:10px; border-bottom-right-radius:10px;"required fontsize=10 />
<BR />
<br>
<TABLE align=center ><TR><TD>Password</TD></TR></TABLE>
<br>
<INPUT name="Pasword" type="password" align=center value="" style="width:33.7%; height:35px; font-size:28px; border-bottom-left-radius:10px; border-bottom-right-radius:10px;"required fontsize=10 />
<BR />
<br>
<input type="submit" alt="Submit" align=center style="width: 33.7%; height: 35px; font-size:28px; background:red; border:0px; border-radius:10px;" >
<BR> </H1>
</FORM>
</div>
</BODY>
</HTML>`
標籤表,輸入標籤下它是不對齊,但它們都具有align=center
屬性。我該如何修復?我也想標記表格是「觸摸」它下面的標記輸入。我怎樣才能做到這一點?
請找一個現代的HTML教程。這看起來像是二十年前的事情。我們現在有CSS。表不是通用的容器元素。換行不是邊距。另請參閱https://validator.w3.org/nu/ – Quentin
它們都與中心對齊。你使用IE嗎? – Okx