- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我目前正在使用 this来自 this 的 jsfiddle片段,我正在尝试将两行文本放入列表项之一,其中“其余文本需要显示”当前处于隐藏状态。
对于我的元素,我可能需要显示超过两行的列表项,那么 css/javascipt 中是否有一种方法可以将列表环绕在文本周围
<ul class="nav sidebar-nav">
<li>
<a href="#">
item 1<br>rest of the text need to show
</a>
</li>
<li>
<a href="#">
item 2
</a>
</li>
<li>
<a href="#">
item 3
</a>
</li>
</ul>
最佳答案
从 a
标签中移除固定高度,元素高度将匹配其中内容的大小。这是一个更新的 fiddle https://jsfiddle.net/0m4qdvja/5/
@import "https://fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900,900italic&subset=latin,cyrillic";
/* -- import Roboto Font ---------------------------- */
/* -- import Material Icons Font -------------------- */
@font-face {
font-family: 'Material Design Iconic Font';
src: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/53474/Material-Design-Iconic-Font.eot?v=1.0');
src: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/53474/Material-Design-Iconic-Font.eot?#iefix&v=1.0') format('embedded-opentype'), url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/53474/Material-Design-Iconic-Font.woff?v=1.0') format('woff'), url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/53474/Material-Design-Iconic-Font.ttf?v=1.0') format('truetype'), url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/53474/Material-Design-Iconic-Font.svg?v=1.0#Material-Design-Iconic-Font') format('svg');
font-weight: normal;
font-style: normal;
}
[class^="md-"],
[class*=" md-"] {
display: inline-block;
font: normal normal normal 14px/1 'Material Design Iconic Font';
font-size: inherit;
speak: none;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.md {
line-height: inherit;
vertical-align: bottom;
}
.md-inbox:before {
content: "\f10c";
}
.md-star:before {
content: "\f2e5";
}
.md-send:before {
content: "\f119";
}
.md-drafts:before {
content: "\f107";
}
.md-arrow-back:before {
content: "\f297";
}
.md-arrow-forward:before {
content: "\f298";
}
/* -- You can use this sidebar in Bootstrap (v3) projects. HTML-markup like Navbar bootstrap component will make your work easier. -- */
/* -- Box model ------------------------------- */
*,
*:after,
*:before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/* -- Demo style ------------------------------- */
html,
body {
position: relative;
min-height: 100%;
height: 100%;
}
body {
font-family: 'RobotoDraft', 'Roboto', 'Helvetica Neue, Helvetica, Arial', sans-serif;
font-style: normal;
font-weight: 300;
font-size: 14px;
line-height: 1.4;
color: #212121;
background-color: #f5f5f5;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
}
.sidebar-overlay {
visibility: hidden;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
opacity: 0;
background: #000;
z-index: 1034;
-webkit-transition: visibility 0 linear 0.4s, opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
-moz-transition: visibility 0 linear 0.4s, opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
transition: visibility 0 linear 0.4s, opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
-o-transform: translateZ(0);
transform: translateZ(0);
}
.sidebar-overlay.active {
opacity: 0.5;
visibility: visible;
-webkit-transition-delay: 0;
-moz-transition-delay: 0;
transition-delay: 0;
}
.top-bar {
height: 25px;
background: rgba(0, 0, 0, 0.1);
}
/* -- Google typography ------------------------------- */
.headline {
font-size: 24px;
font-weight: 300;
line-height: 1.1;
color: #212121;
text-transform: inherit;
letter-spacing: inherit;
}
.subhead {
font-size: 16px;
font-weight: 300;
line-height: 1.1;
color: #212121;
text-transform: inherit;
letter-spacing: inherit;
}
/* -- Bootstrap-like style ------------------------------- */
.caret {
display: inline-block;
width: 0;
height: 0;
margin-left: 2px;
vertical-align: middle;
border-top: 4px solid;
border-right: 4px solid transparent;
border-left: 4px solid transparent;
}
.dropdown-menu {
display: none;
}
/* -- Constructor style ------------------------------- */
.constructor {
position: relative;
margin: 0;
padding: 0 50px;
-webkit-transition: all 0.5s cubic-bezier(0.55, 0, 0.1, 1);
-o-transition: all 0.5s cubic-bezier(0.55, 0, 0.1, 1);
transition: all 0.5s cubic-bezier(0.55, 0, 0.1, 1);
}
.sidebar,
.wrapper {
display: table-cell;
vertical-align: top;
}
.sidebar-stacked.open + .wrapper .constructor {
margin-left: 280px;
}
@media (max-width: 768px) {
.sidebar-stacked.open + .wrapper .constructor {
margin-left: 240px;
}
}
/* -- Sidebar style ------------------------------- */
.sidebar {
position: relative;
display: block;
min-height: 100%;
overflow-y: auto;
overflow-x: hidden;
border: none;
-webkit-transition: all 0.5s cubic-bezier(0.55, 0, 0.1, 1);
-o-transition: all 0.5s cubic-bezier(0.55, 0, 0.1, 1);
transition: all 0.5s cubic-bezier(0.55, 0, 0.1, 1);
}
.sidebar:before,
.sidebar:after {
content: " ";
display: table;
}
.sidebar:after {
clear: both;
}
.sidebar::-webkit-scrollbar-track {
border-radius: 2px;
}
.sidebar::-webkit-scrollbar {
width: 5px;
background-color: #F7F7F7;
}
.sidebar::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
background-color: #BFBFBF;
}
.sidebar .sidebar-header {
position: relative;
height: 157.5px;
margin-bottom: 8px;
-webkit-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.sidebar .sidebar-header.header-cover {
background-repeat: no-repeat;
background-position: center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.sidebar .sidebar-header:hover .sidebar-toggle {
opacity: 1;
}
.sidebar .sidebar-toggle {
position: relative;
float: right;
margin: 16px;
padding: 0;
background-image: none;
border: none;
height: 40px;
width: 40px;
font-size: 20px;
opacity: 0.7;
-webkit-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.sidebar .sidebar-toggle:before,
.sidebar .sidebar-toggle:after {
content: " ";
display: table;
}
.sidebar .sidebar-toggle:after {
clear: both;
}
.sidebar .icon-material-sidebar-arrow:before {
content: "\e610";
}
.sidebar .sidebar-image img {
width: 54px;
height: 54px;
margin: 16px;
border-radius: 50%;
-webkit-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.sidebar .sidebar-brand {
position: absolute;
bottom: 0;
left: 0;
right: 0;
display: block;
height: 48px;
line-height: 48px;
padding: 0;
padding-left: 16px;
padding-right: 56px;
text-decoration: none;
clear: both;
font-weight: 500;
overflow: hidden;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
white-space: nowrap;
-webkit-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.sidebar .sidebar-brand:hover,
.sidebar .sidebar-brand:focus {
-webkit-box-shadow: none;
box-shadow: none;
outline: none;
}
.sidebar .sidebar-brand .caret {
position: absolute;
right: 24px;
top: 24px;
}
.sidebar .sidebar-brand .sidebar-badge {
position: absolute;
right: 16px;
top: 12px;
}
.sidebar .sidebar-brand:hover,
.sidebar .sidebar-brand:focus {
text-decoration: none;
}
.sidebar .sidebar-badge {
display: inline-block;
min-width: 24px;
height: 24px;
line-height: 24px;
padding: 0 3px;
font-size: 10px;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
}
.sidebar .sidebar-badge.badge-circle {
border-radius: 50%;
}
.sidebar .sidebar-divider,
.sidebar .sidebar-nav .divider {
position: relative;
display: block;
height: 1px;
margin: 8px 0;
padding: 0;
overflow: hidden;
}
.sidebar .sidebar-text {
display: block;
height: 48px;
line-height: 48px;
padding: 0;
padding-left: 16px;
padding-right: 56px;
text-decoration: none;
clear: both;
font-weight: 500;
overflow: hidden;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
white-space: nowrap;
-webkit-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.sidebar .sidebar-text:hover,
.sidebar .sidebar-text:focus {
-webkit-box-shadow: none;
box-shadow: none;
outline: none;
}
.sidebar .sidebar-text .caret {
position: absolute;
right: 24px;
top: 24px;
}
.sidebar .sidebar-text .sidebar-badge {
position: absolute;
right: 16px;
top: 12px;
}
.sidebar .sidebar-icon {
display: inline-block;
margin-right: 16px;
min-width: 40px;
width: 40px;
text-align: left;
font-size: 20px;
}
.sidebar .sidebar-icon:before,
.sidebar .sidebar-icon:after {
vertical-align: middle;
}
.sidebar .sidebar-nav {
margin: 0;
padding: 0;
}
.sidebar .sidebar-nav li {
position: relative;
list-style-type: none;
}
.sidebar .sidebar-nav li a {
position: relative;
cursor: pointer;
user-select: none;
display: block;
line-height: 48px;
padding: 0;
padding-left: 16px;
padding-right: 56px;
text-decoration: none;
clear: both;
font-weight: 500;
overflow: hidden;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
white-space: nowrap;
-webkit-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.sidebar .sidebar-nav li a:hover,
.sidebar .sidebar-nav li a:focus {
-webkit-box-shadow: none;
box-shadow: none;
outline: none;
}
.sidebar .sidebar-nav li a .caret {
position: absolute;
right: 24px;
top: 24px;
}
.sidebar .sidebar-nav li a .sidebar-badge {
position: absolute;
right: 16px;
top: 12px;
}
.sidebar .sidebar-nav li a:hover {
background: transparent;
}
.sidebar .sidebar-nav .dropdown-menu {
position: relative;
width: 100%;
margin: 0;
padding: 0;
border: none;
border-radius: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
.sidebar-default {
background-color: #ffffff;
}
.sidebar-default .sidebar-header {
background-color: #eceff1;
}
.sidebar-default .sidebar-toggle {
color: #212121;
background-color: transparent;
}
.sidebar-default .sidebar-brand {
color: #757575;
background-color: transparent;
}
.sidebar-default .sidebar-brand:hover,
.sidebar-default .sidebar-brand:focus {
color: #212121;
background-color: rgba(0, 0, 0, 0.1);
}
.sidebar-default .sidebar-badge {
color: #ffffff;
background-color: #bdbdbd;
}
.sidebar-default .sidebar-divider,
.sidebar-default .sidebar-nav .divider {
background-color: #bdbdbd;
}
.sidebar-default .sidebar-text {
color: #212121;
}
.sidebar-default .sidebar-nav li > a {
color: #212121;
background-color: transparent;
}
.sidebar-default .sidebar-nav li > a i {
color: #757575;
}
.sidebar-default .sidebar-nav li:hover > a,
.sidebar-default .sidebar-nav li > a:hover {
color: #212121;
background-color: #e0e0e0;
}
.sidebar-default .sidebar-nav li:hover > a i,
.sidebar-default .sidebar-nav li > a:hover i {
color: #757575;
}
.sidebar-default .sidebar-nav li:focus > a,
.sidebar-default .sidebar-nav li > a:focus {
color: #212121;
background-color: transparent;
}
.sidebar-default .sidebar-nav li:focus > a i,
.sidebar-default .sidebar-nav li > a:focus i {
color: #757575;
}
.sidebar-default .sidebar-nav > .open > a,
.sidebar-default .sidebar-nav > .open > a:hover,
.sidebar-default .sidebar-nav > .open > a:focus {
color: #212121;
background-color: #e0e0e0;
}
.sidebar-default .sidebar-nav > .active > a,
.sidebar-default .sidebar-nav > .active > a:hover,
.sidebar-default .sidebar-nav > .active > a:focus {
color: #212121;
background-color: #e0e0e0;
}
.sidebar-default .sidebar-nav > .disabled > a,
.sidebar-default .sidebar-nav > .disabled > a:hover,
.sidebar-default .sidebar-nav > .disabled > a:focus {
color: #e0e0e0;
background-color: transparent;
}
.sidebar-default .sidebar-nav > .dropdown > .dropdown-menu {
background-color: #e0e0e0;
}
.sidebar-default .sidebar-nav > .dropdown > .dropdown-menu > li > a:focus {
background-color: #e0e0e0;
color: #212121;
}
.sidebar-default .sidebar-nav > .dropdown > .dropdown-menu > li > a:hover {
background-color: #cecece;
color: #212121;
}
.sidebar-default .sidebar-nav > .dropdown > .dropdown-menu > .active > a,
.sidebar-default .sidebar-nav > .dropdown > .dropdown-menu > .active > a:hover,
.sidebar-default .sidebar-nav > .dropdown > .dropdown-menu > .active > a:focus {
color: #212121;
background-color: #e0e0e0;
}
.sidebar-inverse {
background-color: #212121;
}
.sidebar-inverse .sidebar-header {
background-color: #eceff1;
}
.sidebar-inverse .sidebar-toggle {
color: #212121;
background-color: transparent;
}
.sidebar-inverse .sidebar-brand {
color: #757575;
background-color: transparent;
}
.sidebar-inverse .sidebar-brand:hover,
.sidebar-inverse .sidebar-brand:focus {
color: #212121;
background-color: rgba(0, 0, 0, 0.1);
}
.sidebar-inverse .sidebar-badge {
color: #212121;
background-color: #e0e0e0;
}
.sidebar-inverse .sidebar-divider,
.sidebar-inverse .sidebar-nav .divider {
background-color: #bdbdbd;
}
.sidebar-inverse .sidebar-text {
color: #f5f5f5;
}
.sidebar-inverse .sidebar-nav li > a {
color: #f5f5f5;
background-color: transparent;
}
.sidebar-inverse .sidebar-nav li > a i {
color: #bdbdbd;
}
.sidebar-inverse .sidebar-nav li:hover > a,
.sidebar-inverse .sidebar-nav li > a:hover {
color: #bdbdbd;
background-color: #000000;
}
.sidebar-inverse .sidebar-nav li:hover > a i,
.sidebar-inverse .sidebar-nav li > a:hover i {
color: #bdbdbd;
}
.sidebar-inverse .sidebar-nav li:focus > a,
.sidebar-inverse .sidebar-nav li > a:focus {
color: #f5f5f5;
background-color: transparent;
}
.sidebar-inverse .sidebar-nav li:focus > a i,
.sidebar-inverse .sidebar-nav li > a:focus i {
color: #bdbdbd;
}
.sidebar-inverse .sidebar-nav > .open > a,
.sidebar-inverse .sidebar-nav > .open > a:hover,
.sidebar-inverse .sidebar-nav > .open > a:focus {
color: #bdbdbd;
background-color: #000000;
}
.sidebar-inverse .sidebar-nav > .active > a,
.sidebar-inverse .sidebar-nav > .active > a:hover,
.sidebar-inverse .sidebar-nav > .active > a:focus {
color: #f5f5f5;
background-color: #000000;
}
.sidebar-inverse .sidebar-nav > .disabled > a,
.sidebar-inverse .sidebar-nav > .disabled > a:hover,
.sidebar-inverse .sidebar-nav > .disabled > a:focus {
color: #757575;
background-color: transparent;
}
.sidebar-inverse .sidebar-nav > .dropdown > .dropdown-menu {
background-color: #000000;
}
.sidebar-inverse .sidebar-nav > .dropdown > .dropdown-menu > li > a:focus {
background-color: #000000;
color: #bdbdbd;
}
.sidebar-inverse .sidebar-nav > .dropdown > .dropdown-menu > li > a:hover {
background-color: #000000;
color: #bdbdbd;
}
.sidebar-inverse .sidebar-nav > .dropdown > .dropdown-menu > .active > a,
.sidebar-inverse .sidebar-nav > .dropdown > .dropdown-menu > .active > a:hover,
.sidebar-inverse .sidebar-nav > .dropdown > .dropdown-menu > .active > a:focus {
color: #f5f5f5;
background-color: #000000;
}
.sidebar-colored {
background-color: #ffffff;
}
.sidebar-colored .sidebar-header {
background-color: #e91e63;
}
.sidebar-colored .sidebar-toggle {
color: #f5f5f5;
background-color: transparent;
}
.sidebar-colored .sidebar-brand {
color: #e0e0e0;
background-color: transparent;
}
.sidebar-colored .sidebar-brand:hover,
.sidebar-colored .sidebar-brand:focus {
color: #f5f5f5;
background-color: rgba(0, 0, 0, 0.1);
}
.sidebar-colored .sidebar-badge {
color: #ffffff;
background-color: #ec407a;
}
.sidebar-colored .sidebar-divider,
.sidebar-colored .sidebar-nav .divider {
background-color: #bdbdbd;
}
.sidebar-colored .sidebar-text {
color: #212121;
}
.sidebar-colored .sidebar-nav li > a {
color: #212121;
background-color: transparent;
}
.sidebar-colored .sidebar-nav li > a i {
color: #757575;
}
.sidebar-colored .sidebar-nav li:hover > a,
.sidebar-colored .sidebar-nav li > a:hover {
color: #e91e63;
background-color: #e0e0e0;
}
.sidebar-colored .sidebar-nav li:hover > a i,
.sidebar-colored .sidebar-nav li > a:hover i {
color: #f06292;
}
.sidebar-colored .sidebar-nav li:focus > a,
.sidebar-colored .sidebar-nav li > a:focus {
color: #212121;
background-color: transparent;
}
.sidebar-colored .sidebar-nav li:focus > a i,
.sidebar-colored .sidebar-nav li > a:focus i {
color: #f06292;
}
.sidebar-colored .sidebar-nav > .open > a,
.sidebar-colored .sidebar-nav > .open > a:hover,
.sidebar-colored .sidebar-nav > .open > a:focus {
color: #e91e63;
background-color: #e0e0e0;
}
.sidebar-colored .sidebar-nav > .active > a,
.sidebar-colored .sidebar-nav > .active > a:hover,
.sidebar-colored .sidebar-nav > .active > a:focus {
color: #212121;
background-color: #f5f5f5;
}
.sidebar-colored .sidebar-nav > .disabled > a,
.sidebar-colored .sidebar-nav > .disabled > a:hover,
.sidebar-colored .sidebar-nav > .disabled > a:focus {
color: #e0e0e0;
background-color: transparent;
}
.sidebar-colored .sidebar-nav > .dropdown > .dropdown-menu {
background-color: #e0e0e0;
}
.sidebar-colored .sidebar-nav > .dropdown > .dropdown-menu > li > a:focus {
background-color: #e0e0e0;
color: #e91e63;
}
.sidebar-colored .sidebar-nav > .dropdown > .dropdown-menu > li > a:hover {
background-color: #cecece;
color: #e91e63;
}
.sidebar-colored .sidebar-nav > .dropdown > .dropdown-menu > .active > a,
.sidebar-colored .sidebar-nav > .dropdown > .dropdown-menu > .active > a:hover,
.sidebar-colored .sidebar-nav > .dropdown > .dropdown-menu > .active > a:focus {
color: #212121;
background-color: #f5f5f5;
}
.sidebar-colored-inverse {
background-color: #e91e63;
}
.sidebar-colored-inverse .sidebar-header {
background-color: #eceff1;
}
.sidebar-colored-inverse .sidebar-toggle {
color: #212121;
background-color: transparent;
}
.sidebar-colored-inverse .sidebar-brand {
color: #757575;
background-color: transparent;
}
.sidebar-colored-inverse .sidebar-brand:hover,
.sidebar-colored-inverse .sidebar-brand:focus {
color: #212121;
background-color: rgba(0, 0, 0, 0.1);
}
.sidebar-colored-inverse .sidebar-badge {
color: #212121;
background-color: #e0e0e0;
}
.sidebar-colored-inverse .sidebar-divider,
.sidebar-colored-inverse .sidebar-nav .divider {
background-color: #bdbdbd;
}
.sidebar-colored-inverse .sidebar-text {
color: #e0e0e0;
}
.sidebar-colored-inverse .sidebar-nav li > a {
color: #f5f5f5;
background-color: transparent;
}
.sidebar-colored-inverse .sidebar-nav li > a i {
color: #e0e0e0;
}
.sidebar-colored-inverse .sidebar-nav li:hover > a,
.sidebar-colored-inverse .sidebar-nav li > a:hover {
color: #f5f5f5;
background-color: rgba(0, 0, 0, 0.1);
}
.sidebar-colored-inverse .sidebar-nav li:hover > a i,
.sidebar-colored-inverse .sidebar-nav li > a:hover i {
color: #f5f5f5;
}
.sidebar-colored-inverse .sidebar-nav li:focus > a,
.sidebar-colored-inverse .sidebar-nav li > a:focus {
color: #f5f5f5;
background-color: transparent;
}
.sidebar-colored-inverse .sidebar-nav li:focus > a i,
.sidebar-colored-inverse .sidebar-nav li > a:focus i {
color: #f5f5f5;
}
.sidebar-colored-inverse .sidebar-nav > .open > a,
.sidebar-colored-inverse .sidebar-nav > .open > a:hover,
.sidebar-colored-inverse .sidebar-nav > .open > a:focus {
color: #f5f5f5;
background-color: rgba(0, 0, 0, 0.1);
}
.sidebar-colored-inverse .sidebar-nav > .active > a,
.sidebar-colored-inverse .sidebar-nav > .active > a:hover,
.sidebar-colored-inverse .sidebar-nav > .active > a:focus {
color: #f5f5f5;
background-color: rgba(0, 0, 0, 0.2);
}
.sidebar-colored-inverse .sidebar-nav > .disabled > a,
.sidebar-colored-inverse .sidebar-nav > .disabled > a:hover,
.sidebar-colored-inverse .sidebar-nav > .disabled > a:focus {
color: #bdbdbd;
background-color: transparent;
}
.sidebar-colored-inverse .sidebar-nav > .dropdown > .dropdown-menu {
background-color: rgba(0, 0, 0, 0.1);
}
.sidebar-colored-inverse .sidebar-nav > .dropdown > .dropdown-menu > li > a:focus {
background-color: rgba(0, 0, 0, 0.1);
color: #f5f5f5;
}
.sidebar-colored-inverse .sidebar-nav > .dropdown > .dropdown-menu > li > a:hover {
background-color: rgba(0, 0, 0, 0.1);
color: #f5f5f5;
}
.sidebar-colored-inverse .sidebar-nav > .dropdown > .dropdown-menu > .active > a,
.sidebar-colored-inverse .sidebar-nav > .dropdown > .dropdown-menu > .active > a:hover,
.sidebar-colored-inverse .sidebar-nav > .dropdown > .dropdown-menu > .active > a:focus {
color: #f5f5f5;
background-color: rgba(0, 0, 0, 0.2);
}
.sidebar {
width: 0;
-webkit-transform: translate3d(-280px, 0, 0);
transform: translate3d(-280px, 0, 0);
}
.sidebar.open {
min-width: 280px;
width: 280px;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.sidebar-fixed-left,
.sidebar-fixed-right,
.sidebar-stacked {
position: fixed;
top: 0;
bottom: 0;
z-index: 1035;
}
.sidebar-stacked {
left: 0;
}
.sidebar-fixed-left {
left: 0;
box-shadow: 2px 0px 15px rgba(0, 0, 0, 0.35);
-webkit-box-shadow: 2px 0px 15px rgba(0, 0, 0, 0.35);
}
.sidebar-fixed-right {
right: 0;
box-shadow: 0px 2px 15px rgba(0, 0, 0, 0.35);
-webkit-box-shadow: 0px 2px 15px rgba(0, 0, 0, 0.35);
-webkit-transform: translate3d(280px, 0, 0);
transform: translate3d(280px, 0, 0);
}
.sidebar-fixed-right.open {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.sidebar-fixed-right .icon-material-sidebar-arrow:before {
content: "\e614";
}
@media (max-width: 768px) {
.sidebar.open {
min-width: 240px;
width: 240px;
}
.sidebar .sidebar-header {
height: 135px;
}
.sidebar .sidebar-image img {
width: 44px;
height: 44px;
}
}
<aside id="sidebar" class="sidebar sidebar-default open" role="navigation">
<ul class="nav sidebar-nav">
<li>
<a href="#">
item 1<br>rest of the text need to show
</a>
</li>
<li>
<a href="#">
item 2
</a>
</li>
<li>
<a href="#">
item 3
</a>
</li>
</ul>
<!-- Sidebar text -->
<!-- <div class="sidebar-text">Text</div> -->
</aside>
关于javascript - 垂直展开列表标签 (li) 以在 css 的多行中动态包含文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44569443/
如标题所示,ans_list是一个答案列表,ans_index是一个数字(答案在词汇表中的索引,但与atm无关) 这里生成的 tree.anslist 是什么? (例如,仅针对第一个),忽略迭代。 f
我目前将用户的输入存储在逗号分隔的列表中,如下所示: Userid | Options 1 | 1,2,5 用户在一个数组形式中勾选一组选项,然后用逗号连接起来 1,2,5 然后 MySQ
我目前将用户的输入存储在逗号分隔的列表中,如下所示: Userid | Options 1 | 1,2,5 用户在一个数组形式中勾选一组选项,然后用逗号连接起来 1,2,5 然后 MySQ
我想知道如何完全展平列表和包含它们的东西。除其他外,我想出了一个解决方案,它可以将具有多个元素的东西滑倒并将它们放回原处,或者在滑倒后将具有一个元素的东西拿走。 这与 How do I “flatte
我想知道如何完全展平列表和包含它们的东西。除其他外,我想出了一个解决方案,它可以将具有多个元素的东西滑倒并将它们放回原处,或者在滑倒后将带有一个元素的东西拿走。 这与 How do I “flatte
这个问题已经有答案了: Convert nested list to 2d array (3 个回答) 已关闭 7 年前。 java中有没有快捷方式可以转换 List> 到 String[][] ?
我在排序时遇到问题 List> 。我创建了一个自定义比较器,在其中编写了对数据进行排序的代码。 public class CustomComparator implements Comparator
这个问题已经有答案了: 已关闭10 年前。 Possible Duplicate: Java Generics: Cannot cast List to List? 我只是想知道为什么下面的java代
试图想出一个 LINQy 方法来做到这一点,但我什么也没想到。 我有一个对象列表<>,其中包含一个属性,该属性是逗号分隔的字母代码列表: lst[0].codes = "AA,BB,DD" lst[1
假设我有这些任务: points = [] point = (1, 2) 我怎么会这样做: points += point 它工作得很好,并且给了我点 = [1, 2]。但是,如果我这样做: poin
如何在 scala 中将 List[Task[List[Header]]] 类型转换为 Task[List[Header]]。 我有一个方法返回 Task[List[Header]] 并多次调用 do
如何在 Java 中查找二维列表的元素? 我有一个参数为 List> 的函数我想知道如何找到这个列表的行和列。 最佳答案 如果你喜欢 List> obj 然后你就可以像这样访问 obj.get(cur
分配 List到 List工作正常。 分配 List>到 List>不编译。 代码 public class Main { public static void main(String[] a
我正在用 Java 编写一个方法,该方法必须接收并迭代 Serializable 的 List。 有什么区别: public void myMethod(List list) { } 和 public
我看到很多人想用 mvvm 更新网格/列表/树的一部分,但他们不想刷新整个列表。 对于所有遇到此问题的人,我做了以下示例。 希望这对你有用。 最佳答案 这是一个简单的例子。整个代码中最重要的是: Bi
我正在为现有的 C++ 库编写包装器,该库使用列表,其中 T 是自定义结构。我被建议使用 vector 而不是列表,但我试图避免修改库。 为了更好地理解这个场景,我做了一个简单的应用程序,使用一个列表
List list List list 这两种声明有什么区别吗? 谢谢, 最佳答案 是的。 List可以包含所有派生自 Base 的不同事物的混合物. List包含同质项(从某种意义上说,它们必须全部
有人可以尽可能详细地解释以下类型之间的区别吗? List List List 让我更具体一点。我什么时候想使用 // 1 public void CanYouGiveMeAnAnswer(List l
我有一个元组列表,每个元组都是一对列表。所以我的数据看起来像: mylist = [(['foo', 'bar'], ['bar', 'bar']),(['bar', 'bar'],['bar', '
也许是一个时髦的标题,但我遇到了以下问题: 给定一个类型为 (a * b) list 的列表,我想创建一个类型为 (a * b list) list 的新列表。一个例子: 给定列表 let testL
我是一名优秀的程序员,十分优秀!