We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
灵活运用CSS开发技巧
移动端使用rem布局需要通过JS设置不同屏幕宽高比的font-size
rem布局
font-size
/* 基于UI width=750px DPR=2的页面 */ html { font-size: calc(100vw / 7.5); }
.specified-scope { width: 300px; li { padding: 0 20px; height: 40px; line-height: 40px; color: #fff; &:nth-child(odd) { background-color: #f66; } &:nth-child(even) { background-color: #66f; } &:nth-child(n+6):nth-child(-n+10) { /*6-10行*/ background-color: #3c9; } } }
.vertical-text { writing-mode: vertical-rl; h3 { padding-left: 20px; font-weight: bold; font-size: 18px; color: #f66; } p { line-height: 30px; color: #66f; } }
.justify-text { li { margin-top: 5px; padding: 0 20px; width: 100px; height: 40px; background-color: #f66; line-height: 40px; /* !! */ text-align-last: justify; color: #fff; &:first-child { margin-top: 0; } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
阅读原文
灵活运用CSS开发技巧
CSS布局技巧
rem自适应布局
移动端使用
rem布局
需要通过JS设置不同屏幕宽高比的font-size
使用:nth-child()选择指定元素
使用writing-mode排版竖文
使用text-align-last对齐两端文本
The text was updated successfully, but these errors were encountered: