粗仿gmail按钮-无图片却有立体效果

本文介绍了一种利用CSS进行自定义搜索框样式的详细方法,包括如何设置文本输入框和按钮的样式,并通过实际代码展示了如何实现这些样式。此外还提供了一个具体的使用示例,演示了如何将这些样式应用到网页元素上。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

/*搜索数据框*/
.search_ipt
{
width:275px;
height:20px;
padding-top:3px;
font-size: 14px;
border-style: inset;
border-width: 1px;
border-bottom-color: #555;
border-right-color: #555;
}
/*聚焦效果*/
.search_ipt:FOCUS
{
border-style:solid;
border-width:2px;  
border-color:#6694E3;
}

/*模拟立体按钮*/
.btn_m
{
position: relative;
z-index:1;
height:20px;
width:80px;
border: 1px solid #CCC;
text-align: center;
cursor:pointer;
-moz-border-radius:3px; /*简单点针对FF圆角*/
}
.btn_m:hover
{
border-color: #888;
}
.btn_m .top
{
position: absolute;
z-index:-1;
top:0px;
left:0px;
height:10px;
width:100%;
background-color: #F9F9F9;
}
.btn_m .bot
{
position: absolute;
z-index:-1;
top:10px;
left:0px;
height:10px;
width:100%;
background-color: #EEEEEE;
}

 上面是样式,下面是使用方法:

 

<div style="padding-top:35px;">
<input type="text" class="search_ipt fleft"/>
<div class="btn_m fleft" style="margin-top:2px;margin-left:5px;"><div class="top">&nbsp;</div><div class="bot">&nbsp;</div>搜索内容</div>
<div class="btn_m fleft" style="margin-top:2px;margin-left:5px;"><div class="top">&nbsp;</div><div class="bot">&nbsp;</div>搜索标题</div>
<div style="float:left;margin-top:2px;margin-left:5px;"><a href="javascript:_();">高级搜索</a></div>
</div>

 

效果图:


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值