gpt4 book ai didi

html 在 IE8 中不显示相同

转载 作者:太空宇宙 更新时间:2023-11-03 19:47:56 25 4
gpt4 key购买 nike

“必填”文本显示在输入框的左侧。 Opera 中的类似问题只是显示在下一行(创建换行符)。在 FF3.1 和 chrome 中看起来符合预期。有什么建议么?最后,我想在“必需”跨度上使用 display:none 属性,并根据需要使用 javascript 显示此跨度。

<html>
<head>
<title></title>

<style type="text/css">
<!--
input.missing { background-color: #FFFF77; }

div.row {
clear: both;
padding-top: 5px;
}

div.row span.label {
float: left;
width: 100px;
text-align: right;
}

div.row span.formw {
// float: right;
width: 235px;
text-align: left;
padding-right: 0px;
padding-left: 45px;

}

div.spacer {
clear: both;
}

.container{
width: 425px;
background-color: #ccc;
border: 1px dotted #333;
padding: 5px 5px 5px 5px;
margin: 0px auto;
}

.error{
color: #ff0000;
}

.required{
color: #ff0000;
float: right;
// display:none;
// display:inline;
}
-->
</style>
</head>
<body>
<div id="contact_form">
<form action="/jr/index.php" method="POST" id="contact">

<div id="top_message" style="width: 360px; margin: 10px auto;">
Enter Your Information Below</div>


<div class="container">

<div class="row">
<span class="label">Name:</span>
<span class="formw"><input size="30" maxlength="30" name="name" id="name" value=""></span>
</div>

<div class="row">
<span class="label">Email:</span>
<span class="formw"><input size="30" maxlength="30" name="email" id="email" value=""></span>
<span id="email_error" class="required">(required)</span>
</div>

<div class="row">
<span class="label">Shoe size:</span><span
class="formw"><input type="text" size="25" /></span>
</div>
<div class="row">
<span class="formw">
<input type="image" value="submit" name="submit" class="button" src="submit.png" alt="Submit" /></span>
</div>
<div class="spacer">
&nbsp;
</div>

</div>

<div id="message_ajax" style="width: 360px; margin: 10px auto;"></div>

</form>
</div>
</body>
</html>

IE 有时真的让我讨厌网络开发人员。

最佳答案

您可能应该首先添加适当的 DocType标记在文件顶部。

编辑:查看您的代码后,您似乎没有正确使用 float 。首先 -//不会注释掉 CSS 文件中的行。您需要将其包裹在 /* 和 */ 中以将其注释掉。因此,您的 SPAN.formw 样式向右浮动,在您的 SPAN.required 之前,后者也向右浮动。由于您使用的是 SPAN 标记,因此您真的不需要在此处 float 任何内容。如果您删除所有这些,它应该适合您。

关于html 在 IE8 中不显示相同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1916058/

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