表格添加、超链接

<!DOCTYPE html>
<html>
 <head>
  <meta charset="UTF-8">
  <title></title>
  <style type="text/css">
   /**
    * border-collapse 
    */
   table{
    width: 400px;
    border-collapse: collapse;
    
   }
   td{
    border: 1px solid grey;
    text-align:center;
   }
   
   .td0{
    border-bottom: 1px solid red;
   }
   .td1{
    border-top: 1px solid red;
    border-right: 1px solid red;
    border-bottom: 1px solid red;
   }
   .td13{
    border-top: 1px solid red;
    border-bottom: 1px solid red;
   }
   .tdleft{
    text-align:left;
   }
   .tdright{
    text-align:right;
   }
   
   div{
    width: 200px;
    height: 50px;
    line-height: 50px;
    background-color: #999999;
    text-align: center;
    margin-left: 50px;
    border: 1px solid blue;
    border-radius: 3px;
    cursor: pointer;
    float: left;
   }
   a{
    float: left;
    margin-left: 50px;
   }
   
   .inputerror{
    border: 1px solid red;
   }
   
  </style>
 </head>
 <body>
  <table >
   <tr style="background-color: lightgoldenrodyellow;">
    <td>名字</td>
    <td>年龄</td>
    <td>性别</td>
   </tr>
   <tr>
    <td class="td0">张三</td>
    <td class="td0 tdleft">18</td>
    <td class="td0 tdright">男</td>
   </tr>
   <tr>
    <td class="td1">李思思</td>
    <td class="td1 tdleft">19</td>
    <td class="td13 tdright">女</td>
   </tr>
   <tr>
    <td class="td0">王呜呜</td>
    <td class="td0 tdleft">20</td>
    <td class="td0 tdright">男</td>
   </tr>
   <tr>
    <td class="td1">赵琪琪</td>
    <td class="td1 tdleft">23</td>
    <td class="td13 tdright">女</td>
   </tr>
   <tr>
    <td>1</td>
    <td></td>
    <td></td>
   </tr>
   <tr>
    <td>1</td>
    <td></td>
    <td></td>
   </tr>
  </table><br />
  <div>
   移动到我上面变小手
  </div>
  <a href="#">我是超链接</a><br /><br /><br /><br />
  
  <input type="text" id="id8" onblur="checkvalue();" onfocus="initcss();"/>
 </body>
 
 <script type="text/javascript">
  function checkvalue(){
   var v = document.getElementById("id8");
   
   if(v.value.length==0){
    //把框变成红色
    v.style = "border:1px solid red";
    
   }
  }
  
  //去掉样式
  function initcss(){
   var v = document.getElementById("id8");
   v.style = "";
  }
 </script>
</html>

阅读更多

没有更多推荐了,返回首页