CSS 탐색경로 탐색 모음

不言
풀어 주다: 2018-06-21 16:05:17
원래의
2930명이 탐색했습니다.

이 글에서는 주로 두 가지 순수 CSS 탐색 표시줄 구현 코드를 소개합니다. 내용은 비교적 간단합니다. HTML 코드 구현이 필요한 친구는 들어와서 살펴볼 수 있습니다. 참고하실 수 있습니다

 다음은 두 가지 순수 CSS 탐색 표시줄 구현 코드입니다. 인터넷에서 몇 가지 방법을 찾았지만 그 중 어느 것도 적합하지 않은 것으로 나타났습니다. 이 두 가지 순수 CSS만 거의 동일합니다. 당신을 위한.

  방법 1,

  설명: 이 방법은 CSS3를 사용하며 사진이 없으며 동시에 다양한 웹킷 브라우저와 호환됩니다. 첫 번째 사진:

 1. 첫 번째는 비교적 간단한 HTML 코드입니다. 코드는 다음과 같습니다.

  

<p id="crumbs">
<ul>
 <li><a href="#">首页</a></li>
 <li><a href="#">目录</a></li>
 <li><a href="#">子目录</a></li>
</ul>
<p class="fixed"></p>
</p>
로그인 후 복사

 2. , 첫 번째는 일반 li 플로팅 및 레이블 미화 설정입니다.

#crumbs ul li {
float: left;
list-style: none;
}
#crumbs ul li a {
display: block;
float: left;
height: 34px;
background: #f66fa2;
text-align: center;
padding: 10px 20px 0 45px;
position: relative;
margin: 0 10px 0 0;
font-size: 20px;
text-decoration: none;
color: #fff;
}
로그인 후 복사

  다음 단계는 탐색경로 탐색의 핵심 부분으로 전후를 통해 화살표 효과를 생성합니다.

#crumbs ul li a:after {
content: "";
border-top: 22px solid transparent;
border-bottom: 22px solid transparent;
border-left: 22px solid #f66fa2;
position: absolute; right: -22px; top: 0;
z-index: 1;
}
#crumbs ul li a:before {
content: "";
border-top: 22px solid transparent;
border-bottom: 22px solid transparent;
border-left: 22px solid #fff;
position: absolute; left: 0; top: 0;
}
#crumbs ul li:first-child a {
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
padding-left: 40px;
}
#crumbs ul li:first-child a:before {
display: none;
}
#crumbs ul li:last-child a {
padding-right: 30px;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
}
#crumbs ul li:last-child a:after {
display: none;
}
#crumbs ul li a:hover {
background: #e56592;
transition: all 0.2s ease;
}
#crumbs ul li a:hover:after {
border-left-color: #e56592;
transition: all 0.2s ease;
}
로그인 후 복사

마지막으로 플로트 지우기:

.fixed {
clear: both;
}
로그인 후 복사

방법 2:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "//m.sbmmt.com/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="//m.sbmmt.com/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset="utf-8″ />
<title>纯css制作面包屑,兼容IE6</title>
<style type="text/css">
*{margin:0;padding:0;list-style-type:none;}   
a,img{border:0;}   
body{font:12px/180% Arial, Helvetica, sans-serif, "新宋体";}   
/* demo */   
.demo{width:600px;margin:100px auto;background:#f0f0f0;position:relative;}   
.demo ul{height:32px;overflow:hidden;}   
.demo li{float:left;width:200px;text-align:center;position:relative;z-index:2;font-weight:bold;font-size:14px;line-height:32px;}   
.demo li em{position:absolute;right:-24px;top:-8px;width:0;height:0;line-height:0;border-width:24px 0 24px 24px;border-color:transparent transparent transparent #fff;border-style:dashed dashed dashed solid;}   
.demo li i{position:absolute;right:-16px;top:0;width:0;height:0;line-height:0;border-width:16px 0 16px 16px;border-color:transparent transparent transparent #f0f0f0;border-style:dashed dashed dashed solid;}   
.demo li.current{background:#f60;color:#fff;z-index:1;}   
.demo li.current i{border-color:transparent transparent transparent #f60;}   
</style>
</head>
<body>
<p class="demo">
<ul class="clearfix">
<li>面包屑一<em></em><i></i></li>
<li class="current">面包屑二<em></em><i></i></li>
<li>面包屑二<em></em><i></i></li>
</ul>
</p>
</body>
</html>
로그인 후 복사

위 내용은 모두의 학습에 도움이 되기를 바랍니다. 더 많은 관련 내용은 PHP 중국어 홈페이지를 주목해주세요!                  

관련 권장 사항:

CSS3 및 HTML5 웹 페이지 로딩 진행률 표시줄 구현

CSS3 및 Javascript를 구현하여 진행률 표시줄 효과 달성

위 내용은 CSS 탐색경로 탐색 모음의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!