+ -
当前位置:首页 → 问答吧 → 一个简单的CSS问题 争取即给分

一个简单的CSS问题 争取即给分

时间:2011-08-08

来源:互联网

http://www.w3school.com.cn/tiy/t.asp?f=csse_link_focus

改一下 。。。 就让 tab 到 submit 的时候 才能有黄色背景 谢谢。。。。

作者: jiashu912387   发布时间: 2011-08-08

HTML code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style type="text/css">
input:focus
{
background-color:yellow;
}
</style>
</head>

<body>
<form action="form_action.asp" method="get">
First name: <input type="text" name="fname" /><br />
Last name: <input type="text" name="lname" /><br />
<input type="submit" value="Submit" />
</form>

<p><b>注释:</b>如果已规定 !DOCTYPE,那么 Internet Explorer 8 (以及更高版本)支持 :focus 伪类。</p>

</body>
</html>



楼主在把问题说清楚一点~·

作者: MuBeiBei   发布时间: 2011-08-08

引用 1 楼 mubeibei 的回复:

HTML code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style type="text/css">
input:focus
{
background-col……



现在 不是 有三个input 嘛 我想 只有tab 定位到 submit 这个input 的时候 才显示 黄色背景。。。也就是 在
input:focus 这个地方要修改下。。。

作者: jiashu912387   发布时间: 2011-08-08

ie6不支持focus伪类,ie8或者firefox可以看到

作者: hongmei85   发布时间: 2011-08-08

热门下载

更多