- 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/
好吧,标题说明了一切。我的 javascript 函数构建一些“ block ”并使用 和 创建它们。问题是,它删除了所有其他 在网页上。 编辑:(好吧,我假设这个函数是造成这个的原因。删除我的意思是
这个 HTML 结构有效吗? Item 1 Item 2 Item 3 Item 4 Item 5 Item 6
我正在尝试在 UL 中添加标题因为你不能在 UL 中使用 H2如果按照我展示的方式使用它可以吗? News roll News 1 News 2 我的一位 friend 告诉我
这是我的 代码风格。 li{ font-family: Arial, sans-serif; font-size: 100%; color: black; display : list-item;
我正在使用 a 进行水平导航,感谢问题:Separators For Navigation ,我读到了使用 li + li 设置基于图像的元素分隔符的好方法。 (伪?)选择器。 在我的代码中,我为
我有一个 Div 容器,其中包含 4 我正在做的是在前面加上 进入并删除最后一个 我很容易使用 $('#news-ul li:last').remove() $('#news-ul').prepe
这是 html: menu item menu item menu item menu item menu item 如果我按“a”链接,它会将“当
我有 ul-li 列表 1 2 3 A B 我可以在列表中使用纯 css 最后一个选择器“.digit”吗? .digit 的数量未知 ul li.digit:nth-last-ch
我有这种情况,1- 我想删除一个带有两个图标的 li,它作为一个跨度在里面:一个是选中或取消选中相应的 li,另一个是删除那个 li。2- 我还想通过单击图标(选中图标)同时单击 li 来选中或取消选
如果标题不好理解,我来解释一下... 我有一个 css/jquery 切换菜单。按“+”号时它变大,按“-”号时它变小。我使几个元素的填充、边距和高度在切换/单击时发生变化。菜单顶部充满了链接,然后当
我有一个脚本 ( JsFiddle here ) 检测 li block 元素何时在页面上垂直居中并为其分配一个 .centered 类以使其更大通过 CSS。 .centered { hei
代码在这里:http://jsfiddle.net/C5mTf/49/我不知道为什么。下面的代码有问题吗? $("#menu").on('click','li',function (){ va
我为这个问题苦苦挣扎了几个小时,但仍然无法解决问题。 我有这样的 html 代码: aaaa11 bbbb11 我想知道如何使用 css 让 每里一行显示。但是 标签仍然具有垂
我需要使用水平缩放的 ul > li > ul 的组合来创建一个菜单。每个 ul 都应该有一个 max-height 并在溢出时滚动。悬停在 li 上时,如果里面有另一个 ul 标签,它应该会在右侧打
我了解到,如果我指的是 在 内或 在 CSS 中我应该使用 ol > li或 ul > li但是一旦我忘记在 ol 和 li 之间放置标志,我发现它仍然有效。执行此操作的正确方法是什么? 最佳答案
Question 1 Answer: $('#addquestion').click(function() { var $question_number
我如何在 中显示我的数组值? 我的代码: HTML JS var myList = [ ['1','one'], ['1','two'], ['1','th
我在使用代码编辑器时遇到了问题所以就在这里 Item1 Item 1.1 Item 1.2 Item2
我正在为我的网站创建响应式移动版本。正如您在此 jsfiddle 中看到的那样, 当用户将鼠标悬停在 上时项,菜单打开但覆盖了 而不是展开菜单。 我已经添加了 display: block在不同的地
我正在尝试创建一个网站,但我偶然发现了一个小问题,我正在使用 bootsnipp(一个侧面菜单)中的一个片段,我无法让它工作,所以链接将覆盖整个 LI,而不是你必须按自己的文字如果我改变它,那么它会坐
我是一名优秀的程序员,十分优秀!