使⽤css3制作导航及画圆及椭圆边框的实现
<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"/>
border radius什么意思</div>
<div class="serch_right">搜索</div>
</div>
</body> </html>
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论