Commit c5c40c32 by xuzhenghua

超出显示省略号

parent bc87a39e
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
margin-top: 15px; margin-top: 15px;
margin-bottom: 5px; margin-bottom: 5px;
position: relative; position: relative;
img { img {
width: 100%; width: 100%;
height: 119px; height: 119px;
...@@ -13,8 +14,5 @@ ...@@ -13,8 +14,5 @@
color: $color_333; color: $color_333;
line-height: 19px; line-height: 19px;
margin-top: 9px; margin-top: 9px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
} }
...@@ -5,9 +5,9 @@ const Course = (props) => { ...@@ -5,9 +5,9 @@ const Course = (props) => {
return ( return (
<li className='course-item'> <li className='course-item'>
{props.top} {props.top}
<a href=""> <a href="/#">
<img src={props.data.src} alt=""/> <img src={props.data.src} alt=""/>
<p className="course-title">{props.data.title}</p> <p className="course-title text-overflow-2">{props.data.title}</p>
</a> </a>
{props.bottom} {props.bottom}
</li> </li>
......
...@@ -10,7 +10,7 @@ $link-visited: #333; // 设置链接访问后的颜色 ...@@ -10,7 +10,7 @@ $link-visited: #333; // 设置链接访问后的颜色
$main-color: #09f; // 主体颜色 $main-color: #09f; // 主体颜色
// 字体 // 字体
$font-family-zh: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif; $font-family-zh: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
$font-family-en: Arial, sans-serif !default; $font-family-en: Arial, sans-serif !default;
// 盒子模型 // 盒子模型
...@@ -80,14 +80,17 @@ body { ...@@ -80,14 +80,17 @@ body {
a { a {
text-decoration: none; text-decoration: none;
outline: none; outline: none;
&:hover, &:hover,
&:link, &:link,
&:focus { &:focus {
text-decoration: none; text-decoration: none;
} }
&:visited { &:visited {
} }
} }
// 暂时放置样式,后期需处理 // 暂时放置样式,后期需处理
.homeImg { .homeImg {
display: block; display: block;
...@@ -112,21 +115,27 @@ a { ...@@ -112,21 +115,27 @@ a {
} }
// 背景颜色 // 背景颜色
.bg-white { background-color: #fff } .bg-white {
background-color: #fff
}
// 间隔 // 间隔
.pt20 { .pt20 {
padding-top: 20px; padding-top: 20px;
} }
.pt30 { .pt30 {
padding-top: 30px; padding-top: 30px;
} }
.pt40 { .pt40 {
padding-top: 40px; padding-top: 40px;
} }
.pt50 { .pt50 {
padding-top: 50px; padding-top: 50px;
} }
.pt60 { .pt60 {
padding-top: 60px; padding-top: 60px;
} }
...@@ -137,16 +146,45 @@ a { ...@@ -137,16 +146,45 @@ a {
} }
// 请保证你的设计稿为750px宽,如果有其余字体大小,请在私有样式中设置 // 请保证你的设计稿为750px宽,如果有其余字体大小,请在私有样式中设置
.font-20 {font-size: 0.2rem;} .font-20 {
.font-24 {font-size: 0.24rem;} font-size: 0.2rem;
.font-26 {font-size: 0.26rem;} }
.font-28 {font-size: 0.28rem;}
.font-30 {font-size: 0.3rem;} .font-24 {
.font-32 {font-size: 0.32rem;} font-size: 0.24rem;
.font-34 {font-size: 0.34rem;} }
.font-36 {font-size: 0.36rem;}
.font-38 {font-size: 0.38rem;} .font-26 {
.font-40 {font-size: 0.4rem;} font-size: 0.26rem;
}
.font-28 {
font-size: 0.28rem;
}
.font-30 {
font-size: 0.3rem;
}
.font-32 {
font-size: 0.32rem;
}
.font-34 {
font-size: 0.34rem;
}
.font-36 {
font-size: 0.36rem;
}
.font-38 {
font-size: 0.38rem;
}
.font-40 {
font-size: 0.4rem;
}
// 设置block // 设置block
.block { .block {
...@@ -203,6 +241,7 @@ a { ...@@ -203,6 +241,7 @@ a {
flex-direction: row; flex-direction: row;
flex-wrap: wrap; flex-wrap: wrap;
} }
// 水平居中 // 水平居中
.hor-center { .hor-center {
display: flex; display: flex;
...@@ -210,6 +249,7 @@ a { ...@@ -210,6 +249,7 @@ a {
flex-wrap: nowrap; flex-wrap: nowrap;
justify-content: center; justify-content: center;
} }
// 垂直居中 // 垂直居中
.ver-center { .ver-center {
display: flex; display: flex;
...@@ -295,7 +335,9 @@ img { ...@@ -295,7 +335,9 @@ img {
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 1; -webkit-line-clamp: 1;
/* autoprefixer: off; */
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
/* autoprefixer: on; */
} }
// 字符超出两行溢出隐藏 // 字符超出两行溢出隐藏
...@@ -304,7 +346,9 @@ img { ...@@ -304,7 +346,9 @@ img {
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
/* autoprefixer: off; */
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
/* autoprefixer: on; */
} }
// 字符超出三行溢出隐藏 // 字符超出三行溢出隐藏
...@@ -313,7 +357,9 @@ img { ...@@ -313,7 +357,9 @@ img {
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 3; -webkit-line-clamp: 3;
/* autoprefixer: off; */
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
/* autoprefixer: on; */
} }
// 浮动控制 // 浮动控制
...@@ -323,6 +369,7 @@ img { ...@@ -323,6 +369,7 @@ img {
content: ''; content: '';
display: table; display: table;
} }
&:after { &:after {
clear: both; clear: both;
} }
...@@ -351,21 +398,27 @@ img { ...@@ -351,21 +398,27 @@ img {
.z-50 { .z-50 {
z-index: 50; z-index: 50;
} }
.z-100 { .z-100 {
z-index: 100; z-index: 100;
} }
.z-150 { .z-150 {
z-index: 150; z-index: 150;
} }
.z-200 { .z-200 {
z-index: 200; z-index: 200;
} }
.z-250 { .z-250 {
z-index: 250; z-index: 250;
} }
.z-max { .z-max {
z-index: 999999; z-index: 999999;
} }
.overflow-h { .overflow-h {
overflow: hidden; overflow: hidden;
} }
...@@ -390,6 +443,7 @@ input[type="radio"] { ...@@ -390,6 +443,7 @@ input[type="radio"] {
background: none; background: none;
outline: none; outline: none;
} }
input[type="radio"]:before { input[type="radio"]:before {
position: absolute; position: absolute;
content: ''; content: '';
...@@ -404,6 +458,7 @@ input[type="radio"]:before { ...@@ -404,6 +458,7 @@ input[type="radio"]:before {
border-radius: 50%; border-radius: 50%;
outline: 0; outline: 0;
} }
input[type="radio"]:checked:after { input[type="radio"]:checked:after {
position: absolute; position: absolute;
z-index: 50; z-index: 50;
...@@ -418,6 +473,7 @@ input[type="radio"]:checked:after { ...@@ -418,6 +473,7 @@ input[type="radio"]:checked:after {
border-radius: 50%; border-radius: 50%;
outline: 0; outline: 0;
} }
input[type="radio"]:checked:before { input[type="radio"]:checked:before {
position: absolute; position: absolute;
z-index: 100; z-index: 100;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment