我有一個麪包屑代碼,我希望在我的網站上使用,但它沒有響應。在頁面進入移動視圖時如何使頁面正確縮小的任何想法?現在,隨着分辨率的降低,它會分裂成幾行。使HTML/CSS Breadcrumb響應
感謝您的幫助!
CSS:
.breadcrumb {
list-style: none;
overflow: hidden;
font: 18px Helvetica, Arial, Sans-Serif;
}
.breadcrumb li {
float: left;
}
.breadcrumb li a {
color: white;
text-decoration: none;
padding: 10px 0 10px 55px;
background: 004aa1; /* fallback color */
background: hsla(166, 80%, 36%, 1.0);
position: relative;
display: block;
float: left;
}
.breadcrumb li a:after {
content: " ";
display: block;
width: 0;
height: 0;
border-top: 50px solid transparent; /* Go big on the size, and let overflow hide */
border-bottom: 50px solid transparent;
border-left: 30px solid hsla(166, 80%, 36%, 1.0);
position: absolute;
top: 50%;
margin-top: -50px;
left: 100%;
z-index: 2;
}
.breadcrumb li a:before {
content: " ";
display: block
width: 0;
height: 0;
border-top: 50px solid transparent; /* Go big on the size, and let overflow hide */
border-bottom: 50px solid transparent;
border-left: 30px solid white;
position: absolute;
top: 50%;
margin-top: -50px;
margin-left: 1px;
left: 100%;
z-index: 1;
}
.breadcrumb li:first-child a {
padding-left: 10px;
}
.breadcrumb li:nth-child(2) a { background: hsla(166, 80%, 26%, 1.0); }
.breadcrumb li:nth-child(2) a:after { border-left-color: hsla(166, 80%, 26%, 1.0); }
.breadcrumb li:nth-child(3) a { background: hsla(166, 80%, 16%, 1.0); }
.breadcrumb li:nth-child(3) a:after { border-left-color: hsla(166, 80%, 16%, 1.0); }
.breadcrumb li a:hover { background: hsla(166, 80%, 10%, 1.0); }
.breadcrumb li a:hover:after { border-left-color: hsla(166, 80%, 10%, 1.0) !important; }
HTML:
<ul class="breadcrumb">
<li><a href="#">Home</a></li>
<li><a href="#">Equipment</a></li>
<li><a href="#">Category</a></li>
</ul>
你想要它做什麼而不是分成幾行? –
使用媒體查詢使其響應。 –