2015-09-06 183 views
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属性。我该如何修复?我也想标记表格是“触摸”它下面的标记输入。我怎样才能做到这一点?

+1

请找一个现代的HTML教程。这看起来像是二十年前的事情。我们现在有CSS。表不是通用的容器元素。换行不是边距。另请参阅https://validator.w3.org/nu/ – Quentin

+0

它们都与中心对齐。你使用IE吗? – Okx

回答

0

他们完全在我的朋友中心对齐。我认为你的浏览器存在一些问题。

我认为你是一个初学者,因此我想引导你正确的方向。

尝试制作css类 - 为特定元素定义所需的任何内容,然后将其附加到特定元素。

http://www.w3schools.com/css/css_selectors.asp