使用css3制作导航及画圆及椭圆边框的实现

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

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

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>无标题文档</title>

 <style>

 *{ margin:0px; padding:0px;}  

.serch_left{ border-radius:20px;}   

  .serch ,.serch_left,.serch_right{ height:40px; }     

.serch { width:500px; border:#000 0px solid; background:#09F; margin:50px;   border-radius:20px;}  .serch_left { width:390px; height:36px; border:#09F 2px solid; background:#FFF;}  

.serch_right{ width:90px;}

 .serch_left,.serch_right{  float:left; text-align:center;}

 .serch_right{height:30px; padding-top:10px; color:#FFF; font-weight:bold; cursor:pointer;}   

   .inp_serch{ width:390px; padding-left:30px; background:url(img/serch.png) no-repeat 5px 5px; height:35px; border:0px; border-radius:20px; border-color:#FFF;   font-size:20px;}

 </style>

  <script src="js/jquery-1.8.3.min.js"></script>

   <script >     

  $(function(){$(".inp_serch").css("color","#CCC").focus(function(){

          /*val() 能取得值  还可以 赋值*/    

        if($(this).val()==""){

            $(this).val("搜索");  

     }               

}).blur(function(){

             if($(this).val()=="搜索"){  

      $(this).css("color","#CCC");    

  }else{

        $(this).css("color","black");  

     }            

});  

   $(".serch_right").click(function(){  

       alert($(".inp_serch").val());     

        });      

  });       </script>   

<style>   

   .yuan{ width:20px; height:20px; border-radius:20px; background-color:#F00;    color:#FFF; font-weight:bold; text-align:center; margin:5px; float:10px;}

   .cl{ width:200px; height:40px; border-top-left-radius:10px; border-bottom-right-radius:10px; border:#00F 2px solid;} </style>

</head>

<body>

<div class="yuan">1</div>

  <div class="yuan">2</div>

  <div class="yuan">3</div>  

<div class="yuan">4</div>    

  <div class="cl"></div> 

      <div class="serch">    

   <div class="serch_left">   

      <input  type="text" class="inp_serch"/>      

      </div>   

    <div class="serch_right">搜索</div>

  </div>

  </body> </html>

转载于:https://www.cnblogs.com/huanghaixiong/p/3750748.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值