>  기사  >  웹 프론트엔드  >  CSS를 이용하여 그림으로 구현한 버튼의 예

CSS를 이용하여 그림으로 구현한 버튼의 예

墨辰丷
墨辰丷원래의
2018-05-09 18:23:041900검색

이 기사에서는 CSS를 사용하여 그림의 버튼 예제를 구현하는 방법을 주로 소개합니다. 사용하기 쉽고 신비하며 CSS를 통해 이미지 좌표계를 읽어서 로컬 배경 이미지를 구현합니다. 친구가 그것을 참조할 수 있습니다.

NetEase 126 로그인 버튼 코드는 다음과 같습니다.

<style> 
.inp_L1,.inp_L2,{background:url(/upload/20080515201218970.jpg) no-repeat} 
.inp_L1{ width:67px; height:23px; background-position:-4px -4px; border:0; color:#464646; line-height:23px} 
.inp_L2{ width:67px; height:23px; background-position:-4px -30px; border:0; color:#464646; line-height:23px} 
</style> 
<input type="submit" value="登 录" class="inp_L1" onMouseOver="this.className=&#39;inp_L2&#39;" onMouseOut="this.className=&#39;inp_L1&#39;" id="input_btn1"  name="enter.x" tabindex="4">

탐색 버튼 코드는 다음과 같습니다.

<head> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 
<title>用CSS实现的一张图完成的导航条</title> 
<style> 
ul,li{ list-style:none; float:left;} 
body{ font-size:12px; line-height:1.6; font-family:Verdana, "宋体", Arial; text-align:center;} 
#info li{ margin-left:4px; margin-top:15px;} 
#info a {display:block;text-align:center; padding-left:15px; 
padding-top:2px;padding-bottom:1px;background-image:  
url(/upload/20080515201218783.GIF); 
background-repeat: no-repeat;color: #000; width:47px; cursor:hand; text-decoration: none;} 
#job a:link,#job a:visited{background-position: -62px 0px;} 
#eve a:link,#eve a:visited{background-position: -124px 0px;} 
#oth a:link,#oth a:visited{background-position: -186px 0px;} 
#car a:hover ,#car a:active {background-position: 0px -22px; color:#fff;} 
#job a:hover ,#car a:active {background-position: -62px -22px; color:#fff;} 
#eve a:hover ,#car a:active {background-position: -124px -22px; color:#fff;} 
#oth a:hover ,#car a:active {background-position: -186px -22px; color:#fff;} 
</style> 
</head> 
<body>  
<div id="info"> 
 <ul> 
  <li id="car"><a href="#" target="_blank"><span> 
 游 戏</span></a></li> 
  <li id="job"><a href="#" target="_blank"><span> 
 娱 乐</span></a></li> 
  <li id="eve"><a href="#" target="_blank"><span> 
 菜 单</span></a></li> 
  <li id="oth"><a href="#" target="_blank"><span> 
 好 玩</span></a></li>    
 </ul>  
</div> 
</body> 
</html>


CSS 3 달성 D 버튼 효과

AngularJS 개발 WebApp 구현 점프 버튼 효과 강조, ui-sref 및 ui-sref-active 사용 방법

3D 버튼 효과를 얻기 위한 CSS3 추천 기사

가로 스크롤 메뉴 버튼 효과를 표시하는 CSS3 코드

위 내용은 CSS를 이용하여 그림으로 구현한 버튼의 예의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.