简体   繁体   English

如何在页面底部的右上角放置一个文本框

[英]How to put a textbox in the right corner at the bottom of the page

I want to put a text box in the right corner of the page, in the bottom using html. 我想在页面的右上角使用html在底部放置一个文本框。

I wrote this code, it works, but i'm not sure if it's correct. 我写了这段代码,它可以工作,但是我不确定它是否正确。

    <html>
<head>
<title> Test </title>
<style type="text/css">
.poz
{
position:absolute;bottom:15px; right:10px;
}
</style>
</head>
<body>
<form>
<input type="text" name="email"; div class="poz"/></div>
</form>
 </body>
</html>

I mean, i am not sure if it's ok to put this part of code "div class="poz"/>" . 我的意思是,我不确定是否可以将这部分代码放入“ div class =” poz“ />”。

Definitely not valid HTML. 绝对无效的HTML。 I would place the class on the form element and remove the closing </div> (which makes it invalid HTML). 我将把该类放在form元素上,并删除结束符</ div>(这使它成为无效的HTML)。

<form class="poz">
<input type="text" name="email"/>
</form>

 .poz{ position: absolute; bottom: 5px; right: 10px; } 
 <input type="text" class="poz"> 

Tidying your code a little bit. 整理您的代码。

<html>
<head>
<title> Test </title>
<style type="text/css">
.poz
{
position:absolute;bottom:15px; right:10px;
}
</style>
</head>
<body>
<form>
<input type="text" name="email" class="poz">
</form>
 </body>
</html>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM