1、符号换行和文字两端对齐充满当前行
在做项目时经常会遇到一放一些文字,文字右端排列不整齐和标点符号换到下一行开头;
在css总增加
word-break: normal;
text-align: justify;
2、解决ios 父元素 有定位时 滚动条失效
最近在做一个项目,遇到的一个问题
里面有一个功能是点击按钮弹出一个蒙层,蒙层上面显示一些图片文字,显示内容的模块有高度限制,内容较多就会超出内容模块的高度,就需要用到滚动条。
但是在ios上发现滚动条失效了,完全不能滑动了
下面代码段:
主要这里!!!
<div class="overlay_module" v-show="" @click=" = false">
<div class="correct_answer" @click.stop="">
<p class="ca_title">正确答案</p>
<p class="ca_answer">ABC</p>
<div class="ca_content">
<img src="" alt="">
<div class="ca_c_tips">
<p>小贴士</p>
<div class="ca_c_t_shadow"></div>
</div>
<div class="ca_c_text">
<p>一大片文字</p>
</div>
</div>
</div>
</div>
p {
word-break: normal;
text-align: justify;
}
.overlay_module {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background-color: rgba(0, 0, 0, .6);
position: fixed;
top: 0;
left: 0;
z-index: 100;
transition: .3s;
}
.correct_answer {
width: 343px;
background: linear-gradient(180deg, #FFEEE2 0%, #fff 30%, #fff 100%);
border-radius: 10px;
border: 1px solid #FFFFFF;
.ca_title {
font-size: 18px;
font-weight: 600;
color: #333333;
line-height: 25px;
text-align: center;
margin: 24px 0 16px 0;
}
.ca_answer {
font-size: 18px;
font-weight: 600;
color: #D93C79;
line-height: 25px;
text-align: center;
margin-bottom: 23px;
}
.ca_content {
width: calc(100% - 6px);
padding: 9px 0 50px 0;
margin: 23px auto 5px auto;
background: url() no-repeat;
background-size: 100% 100%;
img {
width: calc(100% - 46px);
display: block;
margin: 0 auto 12px auto;
}
.ca_c_tips {
margin: 0 0 10px 16px;
position: relative;
display: inline-block;
p {
display: inline-block;
font-size: 14px;
font-weight: 500;
color: #333333;
line-height: 20px;
position: relative;
z-index: 2;
}
.ca_c_t_shadow {
width: 100%;
height: 8px;
background: #F7B500;
position: absolute;
left: 0;
bottom: 2px;
z-index: 1;
}
}
.ca_c_text {
height: 240px;
margin: 0 16px;
overflow: auto;
-webkit-overflow-scrolling: auto;
p {
font-size: 14px;
font-weight: 400;
color: #666666;
line-height: 20px;
margin-bottom: 8px;
}
>>> span {
font-weight: 600;
}
}
}
}