要取代什么< span> in< form>用? “在XHTML 1.1中,标签<表格>不能包含标签< span> [英] What to replace <span> in <form> with? "In XHTML 1.1 the tag <form> cannot contain tag <span>
问题描述
我是一名html初学者。我正在使用yootools的登录模块:
要用<?>替换< span>
我有XHTML 1.1严格的文档类型(改变过渡性修正它),我得到错误:
在XHTML 1.1标签< form>
不能包含标签< span>
这是用户/每个人都在同一行上,我可以用这样的方式替换这些跨度,所以它没有抱怨?
谢谢!
Maria
编辑:现在清理到这里了,所以我只需要找到一种方法来替换< span class =username> ;
< li class =login>
< ; form action =/ cgi-bin / loginmethod =postname =Login>
< span class =username>
<输入类型=textname =usernamesize =18value =用户名/>
< / span>
< span class =password>
< input type =passwordname =passwdsize =10value =Password/>
< / span>
< span class =login-button>
< button value =Loginname =Submittype =submittitle =L> L< / button>
< / span>
< / form>
< / li>
a:focus {outline:none; }
span.username,
span.password {
width:74px;
height:16px;
padding:6px 5px 2px 25px;
float:left;
overflow:hidden;
margin-right:0px;
}
span.username输入,
span.password输入{
padding:0px;
宽度:100%;
背景:无;
border:none;
概述:无;
float:left;
颜色:#646464;
font-size:11px;
}
span.login-button {
margin:2px 5px 2px 0;
width:50px;
height:20px;
float:left;
overflow:hidden;
}
span.login-button button {
display:block;
padding:0px 0px 0px 0px;
宽度:100%;
height:20px;
border:none;
背景:无;
光标:指针;
overflow:hidden;
font-size:11px;
line-height:20px;
颜色:#646464;
}
.login {
float:right;
margin:5px 0 0 0;
height:24px;
display:block;
}
.login span.username {
background:url(img / username_bg.png)0 0 no-repeat; / * ie6png:crop * /
}
.login span.password {
background:url(img / password_bg.png)0 0 no-repeat; / * ie6png:crop * /
}
.login span.username:hover {
background:url(img / username_bg.png)0 -24px no-repeat;
}
.login span.password:hover {
background:url(img / password_bg.png)0 -24px no-repeat;
}
.login span.username输入:悬停,
.login span.password输入:悬停,
.login跨度.username输入:焦点,
.login span.password输入:焦点{
颜色:#F2AD29;
}
.login span.login-button {
background:url(img / button_bg.png)0 0 no-repeat; / * ie6png:crop * /
}
.login span.login-button:hover {
background:url(img / button_bg.png)0 -20px no-repeat ;
}
.login span.login-button button:hover {
color:#F2AD29;
=http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd =nofollow noreferrer> http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict .dtd
表单标签只能包含块元素,请试试这个:
< li class =login>
< form action =/ cgi-bin / loginmethod =postname =Login>
< div>
< span class =username>
< input type =textname =usernamesize =18value =Username/>
< / span>
< span class =password>
< input type =passwordname =passwdsize =10value =Password/>
< / span>
< span class =login-button>
< button value =Loginname =Submittype =submittitle =L> L< / button>
< / span>
< / div>
< / form>
< / li>
I am a beginner in html. I am using a login module from yootools:
What to replace <span>
in with? I have XHTML 1.1 strict doctype (changing transitional fixes it) and I get error:
"In XHTML 1.1 the tag <form>
cannot contain tag <span>
This is user/pass box lined up next to each other on the same line. What can I replace these spans with so it doesnt complain?
Thanks!
Maria
Edit: Cleaned up to this now. So I just need to find a way to replace <span class="username">
with something.
<li class="login">
<form action="/cgi-bin/login" method="post" name="Login">
<span class="username">
<input type="text" name="username" size="18" value="Username" />
</span>
<span class="password">
<input type="password" name="passwd" size="10" value="Password" />
</span>
<span class="login-button">
<button value="Login" name="Submit" type="submit" title="L">L</button>
</span>
</form>
</li>
a:focus { outline: none; }
span.username,
span.password {
width: 74px;
height: 16px;
padding: 6px 5px 2px 25px;
float: left;
overflow: hidden;
margin-right: 0px;
}
span.username input,
span.password input {
padding: 0px;
width: 100%;
background: none;
border: none;
outline: none;
float: left;
color: #646464;
font-size: 11px;
}
span.login-button {
margin: 2px 5px 2px 0;
width: 50px;
height: 20px;
float: left;
overflow: hidden;
}
span.login-button button {
display: block;
padding: 0px 0px 0px 0px;
width: 100%;
height: 20px;
border: none;
background: none;
cursor: pointer;
overflow: hidden;
font-size: 11px;
line-height: 20px;
color: #646464;
}
.login {
float:right;
margin:5px 0 0 0;
height: 24px;
display: block;
}
.login span.username {
background: url(img/username_bg.png) 0 0 no-repeat; /* ie6png:crop */
}
.login span.password {
background: url(img/password_bg.png) 0 0 no-repeat; /* ie6png:crop */
}
.login span.username:hover {
background: url(img/username_bg.png) 0 -24px no-repeat;
}
.login span.password:hover {
background: url(img/password_bg.png) 0 -24px no-repeat;
}
.login span.username input:hover,
.login span.password input:hover,
.login span.username input:focus,
.login span.password input:focus {
color: #F2AD29;
}
.login span.login-button {
background: url(img/button_bg.png) 0 0 no-repeat; /* ie6png:crop */
}
.login span.login-button:hover {
background: url(img/button_bg.png) 0 -20px no-repeat;
}
.login span.login-button button:hover {
color: #F2AD29;
}
In the schema http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
The Form Tag can only contain block elements, try this instead:
<li class="login">
<form action="/cgi-bin/login" method="post" name="Login">
<div>
<span class="username">
<input type="text" name="username" size="18" value="Username" />
</span>
<span class="password">
<input type="password" name="passwd" size="10" value="Password" />
</span>
<span class="login-button">
<button value="Login" name="Submit" type="submit" title="L">L</button>
</span>
</div>
</form>
</li>
这篇关于要取代什么< span> in< form>用? “在XHTML 1.1中,标签<表格>不能包含标签< span>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!