+ -
当前位置:首页 → 问答吧 → 按钮背景图片问题

按钮背景图片问题

时间:2011-11-23

来源:互联网

HTML code

<style>
.btn_login{background:url(pic_button01.gif) left top no-repeat; 
border:0px;
width:102px; 
height:42px; 
padding:0px; 
margin:0px; 
cursor:pointer;}
</style>
<input type="button" class="btn_login" value="登 录">



pic_button01.gif图片是一个左右两端圆弧形状的,长度200px,以上css后按钮只能看到左边的圆弧边缘,无法看到右边的,被截断了,除非我把width:102px改为width:200px,这样我的按钮变长了,那么我能不能做到按钮的背景图片采用三部分组成,也就是左边缘圆弧形图片+中间部分图片+右边缘圆弧形图片

作者: oceanmeng   发布时间: 2011-11-23

这也是我想知道的
我现在的解决方法是做两个图片,分层背景、位置错开
坐等高人

作者: a87345293   发布时间: 2011-11-23

引用楼主 oceanmeng 的回复:
HTML code

<style>
.btn_login{background:url(pic_button01.gif) left top no-repeat;
border:0px;
width:102px;
height:42px;
padding:0px;
margin:0px;
cursor:pointer;}
</style>
<input type=……


可以啊~·楼主百度搜索 css滑动门技术~·

作者: MuBeiBei   发布时间: 2011-11-23

搜索出来的都是超级链接的方式,没有<input type="button" class="btn_login" value="登 录">
这种类型的按钮自适应

作者: oceanmeng   发布时间: 2011-11-23

引用 3 楼 oceanmeng 的回复:
搜索出来的都是超级链接的方式,没有<input type="button" class="btn_login" value="登 录">
这种类型的按钮自适应


不一定非得用button吧

别的都行啊,到时侯用js加个onclick效果一样的

作者: MuBeiBei   发布时间: 2011-11-23

相关阅读 更多