我需要將文本包裹在我的 CSS 檔案中,以便在手機上查看時文本不會重疊(請參見下面的螢屏截圖)。我認為這就像添加overflow-wrap: break-word;一樣簡單。并更改.skills .progress .skill中的高度,但我嘗試了多種組合,但無法使其正常作業。任何幫助,將不勝感激。
網站視圖
HTML 檔案 - 這是一個 Django 專案,它從模型中呼叫變數名稱和分數
# Skills
.skills .content h3 {
font-weight: 700;
font-size: 32px;
color: #37517e;
font-family: "Poppins", sans-serif;
}
.skills .content ul {
list-style: none;
padding: 0;
}
.skills .content ul li {
padding-bottom: 10px;
}
.skills .content ul i {
font-size: 20px;
padding-right: 4px;
color: #47b2e4;
}
.skills .content p:last-child {
margin-bottom: 0;
}
.skills .progress {
height: 50px;
display: block;
background: none;
}
.skills .progress .skill {
padding: 10px 0;
margin: 0 0 6px 0;
width: 50vw;
text-transform: uppercase;
display: block;
font-weight: 600;
font-family: "Poppins", sans-serif;
color: #37517e;
}
.skills .progress .skill .val {
float: right;
font-style: normal;
}
.skills .progress-bar-wrap {
background: #e8edf5;
width: 100vw;
}
.skills .progress-bar {
width: 1px;
height: 10px;
transition: .9s;
background-color: #4668a2;
}
#skills {
display: flex;
}
<section id="skills" class="skills">
<div class="skills-content">
<div class="progress">
<span class="skill">{{Product.name}}  <i class="val">{{Product.score}}%</i></span>
<div class="progress-bar-wrap">
<div class="progress-bar" role="progressbar" aria-valuenow="{{Product.score}}" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
</div>
</section>
uj5u.com熱心網友回復:
你有沒有試過使用@media (max-width: 650px) {}
它應該可以解決問題。
uj5u.com熱心網友回復:
如果沒有看到準確的實時版本,就很難確定問題的確切根源。但是,我會嘗試display: flex;
在父項上添加一個#skills
并使您的進度條寬度100vw
# Skills
.skills .content h3 {
font-weight: 700;
font-size: 32px;
color: #37517e;
font-family: "Poppins", sans-serif;
}
.skills .content ul {
list-style: none;
padding: 0;
}
.skills .content ul li {
padding-bottom: 10px;
}
.skills .content ul i {
font-size: 20px;
padding-right: 4px;
color: #47b2e4;
}
.skills .content p:last-child {
margin-bottom: 0;
}
.skills .progress {
height: 50px;
display: block;
background: none;
}
.skills .progress .skill {
padding: 10px 0;
margin: 0 0 6px 0;
width: 50vw;
text-transform: uppercase;
display: block;
font-weight: 600;
font-family: "Poppins", sans-serif;
color: #37517e;
}
.skills .progress .skill .val {
float: right;
font-style: normal;
}
.skills .progress-bar-wrap {
background: #e8edf5;
width: 100vw;
}
.skills .progress-bar {
width: 1px;
height: 10px;
transition: .9s;
background-color: #4668a2;
}
#skills {
display: flex;
}
<section id="skills" class="skills">
<div class="skills-content">
<div class="progress">
<span class="skill">{{Product.name}}  <i class="val">Social Media Marketing 100%</i></span>
<div class="progress-bar-wrap">
<div class="progress-bar" role="progressbar" aria-valuenow="{{Product.score}}" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
</div>
</section>
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/401321.html
下一篇:如何使用香草精為子元素設計樣式?