当前位置: 代码迷 >> Web前端 >> 设立表单的样式[属性选择器在为不带有 class 或 id 的表单设置样式时特别有用:]
  详细解决方案

设立表单的样式[属性选择器在为不带有 class 或 id 的表单设置样式时特别有用:]

热度:94   发布时间:2012-10-08 19:54:56.0
设置表单的样式[属性选择器在为不带有 class 或 id 的表单设置样式时特别有用:]

    [设置表单的样式

    属性选择器在为不带有 class 或 id 的表单设置样式时特别有用:]
input[type="text"]
{
  width:150px;
  display:block;
  margin-bottom:10px;
  background-color:yellow;
  font-family: Verdana, Arial;
}

input[type="button"]
{
  width:120px;
  margin-left:35px;
  display:block;
  font-family: Verdana, Arial;
}


    [Examples:]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style>
input[type="text"]
{
  width:150px;
  display:block;
  margin-bottom:10px;
  background-color:yellow;
  font-family: Verdana, Arial;
}

input[type="button"]
{
  width:120px;
  margin-left:35px;
  display:block;
  font-family: Verdana, Arial;
}
</style>
</head>
<body>

<form name="input" action="" method="get">
<input type="text" name="Name" value="Bill" size="20">
<input type="text" name="Name" value="Gates" size="20">
<input type="button" value="Example Button">

</form>
</body>
</html>
  相关解决方案