利用CSS改变输入内容的样式及控件的外形

通过本样式表,用户可以改变在文本框中所输入内容的大小及字体,并可以改变各种控件的外形,充分满足实际的需求。

 CSS文件:

body {
     color : white;
     font-size : 12px;
     font-family : "trebuchet ms",Verdana, Arial, Helvetica, sans-serif;
     line-height : 15px;
     background : 0 3px;
     text-decoration : none;
     background-color : #000000;
      }

.button {
     font-size : 12px;
     font-family : "trebuchet ms",Verdana, Arial, Helvetica, sans-serif;
     line-height : 15px;
     background-color : #e8e8e8;
     background-position : center;
     width : 80px;
     height : 21px;
     border : 1px solid #707070;
      }

.button:focus {
     font-size : 12px;
     font-family : "trebuchet ms",Verdana, Arial, Helvetica, sans-serif;
     line-height : 15px;
     background-color : #ffa8a8;
     background-position : center;
     width : 80px;
     height : 21px;
     border : 1px solid #707070;
      }

.campo {
     font-size : 12px;
     font-family : "trebuchet ms",Verdana, Arial, Helvetica, sans-serif;
     line-height : 15px;
     background-color : #e8e8e8;
     background-position : center;
     border : 1px solid #707070;
     width : 180px;
     height : 100px;
      }

.campo:focus {
     font-size : 12px;
     font-family : "trebuchet ms",Verdana, Arial, Helvetica, sans-serif;
     line-height : 15px;
     background-color : #ffa8a8;
     background-position : center;
     border : 1px solid #707070;
     width : 180px;
     height : 100px;
      }

.combo {
         font-size : 20px;
         font-family : "trebuchet ms",Verdana, Arial, Helvetica, sans-serif;
         line-height : 15px;
         background-color : #ff6347;
         background-position : center;
         width : 180px;
         height : 20px;
         border : 1px solid #ff6347;
      }

.combo:focus  {
         font-size : 12px;
         font-family : "trebuchet ms",Verdana, Arial, Helvetica, sans-serif;
         line-height : 15px;
         background-color : #ffa8a8;
         background-position : center;
         width : 180px;
         height : 20px;
         border : 1px solid #707070;
      }     
a:focus, a:active {property: value;}

index.html文件:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
  <title>CSS Form field color change... on focus... By Luciano D. Iannicelli</title>
<link rel="stylesheet" href="css_color_change.css" type="text/css" media="screen"  />

</head>

<body>
<table width="580" border="0" cellspacing="0" cellpadding="2">
    <tr>
                  <td  colspan="3">
                  <hr align="center" noshade="noshade" size="1" color="#C0C0C0" />
                  </td>
    </tr>
    <tr>
     <td width="200" valign="top">
                  Name<br>
     <input class='combo' type="text" name="nom" size="22" /><br>
     Surname<br>
     <input class="combo" type="text" name="ape" size="22" /><br>
     Telephone nr<br>
     <input class="combo" type="text" name="tel" size="22" /><br>
     Email<br>
     <input class="combo" type="text" name="ema" size="22" /><br>
     <td width="180" valign="top" align="left">Comment<br>
     <textarea class="campo" name="con" rows="8" cols="32" wrap="physical"></textarea>
                  <br><div align="right"><input class="button" type="submit" name="submitButtonName" value=" Send " /></div>
                  </td>
     <td width="200" valign="top" align="left">
                  </td>
    </tr>
   </table>
</body>

</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值