gpt4 book ai didi

html - 表单输入不会采用百分比填充

转载 作者:太空狗 更新时间:2023-10-29 13:29:30 24 4
gpt4 key购买 nike

如果使用像素填充,我的表单输入会正确显示,但对左右使用百分比填充会破坏它。我不明白为什么。

它在 Safari 中工作,在 Firefox 3.5.3 OSX 中损坏。

问题是当我使用百分比填充时,填充全部中断(因此输入值没有很好地对齐。)

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>% padding</title>
<style>
html,body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {
margin:0;
padding:0;
border:none;

}

div.content {
width:50%;
margin:0 auto;
background:#eee;
}
div.content form {
width:100%;
}
div.content form ul {
list-style:none;
margin:0;
width:100%;
}
div.content form li {
position:relative;
margin-bottom:20px;
height:64px;
width:100%; /* width is declared */
}
div.content form li label {
position:absolute;
width:auto;
left:0;
top:0;
line-height:20px;
}
div.content form li .text {
position:absolute;
bottom:0;
left:0;
padding:10px 2%; /* if 2% is changed to 2px the padding works correctly */
width:96%;
font-size:14px;
outline:1px solid #ccc;
}
</style>
</head>
<body>
<div class="content">
<form action="" method="get">
<ul>
<li>
<label for="text">Input</label>
<input type="text" class="text" name="text" value="" />
</li>
<li>
<label for="text">Input</label>
<input type="text" class="text" name="text" value="" />
</li>
<li>
<label for="text">Input</label>
<input type="text" class="text" name="text" value="" />
</li>

</ul>
</form>
</div>
</body>
</form>

最佳答案

这里有一个开放的(在撰写本文时)错误:

https://bugzilla.mozilla.org/show_bug.cgi?id=527459

更新:bug终于修复了! 2012-11-18 15:35 PST

关于html - 表单输入不会采用百分比填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1446832/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com