我的文字是9月,应该按我的意愿轮换,
现在我的问题是文本应该以数字为中心。
如果我更改文本到5月,that should also want to be centered with that number
。
我有一个屏幕,我希望如何输出
这是到目前为止我尝试过的小提琴。JSFIDDLE
这是我的代码
的HTML
<div class="width35 fll">
<div class="mgl5">
<div class="section month fll ng-binding">september</div></div>
<div class="section day fs80 mgrt10 mgrt13 mgr30 osb fll ng-binding">03</div>
</div>
的CSS
.width35 {
width: 35%;
}
.fll {
float: left;
}
.mgl5 {
margin-left: 5px;
}
.month {
-webkit-transform: rotate(-90deg) translate(-129%, 50%) !important;
font-weight: bold;
font-family: arial;
font-size: 13px;
height: 85px;
width: 20px;
color: #CDCBCB;
}
.mgrt13 {
margin-top: -13px !important;
}
.osb {
font-family: open sans bold;
}
.mgr30 {
margin-right: 30px;
}
.mgrt13 {
margin-top: -13px !important;
}
.mgrt10 {
margin-top: -10px;
}
.fs80 {
font-size: 80px;
}
.day {
width: 68px;
height: 60px;
margin-right: 10px;
font-size: 60px;
font-weight: bold;
color: #A79C9C;
margin-left: -8px;
}
.section {
padding-bottom: 7px;
}
任何帮助表示赞赏。
container {
position: relative;
}
.month {
-webkit-transform: rotate(-90deg)
translate(
calc((150px - 20px) / -2),
calc((150px - 20px) / -2)
);
position: absolute;
font-weight: bold;
font-family: arial;
font-size: 20px;
line-height: 20px;
height: 20px;
width: 150px;
color: #CDCBCB;
float: left;
text-align: center;
}
.day {
height: 150px;
line-height: 150px;
font-size: 150px;
font-weight: bold;
color: #A79C9C;
margin-left: 30px;
float: left;
}
<div class="container">
<div class="section month">june</div>
<div class="section day">03</div>
</div>
相同示例使用一些sass来更容易地调整大小:Plunkr
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句