본문 바로가기

퍼블리싱/HTML | CSS | Javascript

텍스트의 각도 변경하기 (transform)

HTML

 

1
2
3
4
5
<div class="example-date">
    <span class="example-day">12</span> 
    <span class="example-month">September</span> 
    <span class="example-year">2016</span></div>
  </div>
cs

 

 

CSS

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
.example-date {
    width: 115px;
    background-color: #D09E88;
    position: relative;
    padding: 45px 5px 0;
    margin: 0 auto;
}
.example-date .example-day {
    font-size: 45px;
    line-height: 45px;
    position: absolute;
    left: 5px;
    top: 0px;
}
.example-date .example-month {
    text-transform: uppercase;
    font-size: 18px;
}
.example-date .example-year {
    display: block;
    position: absolute;
    right: -5px;
    top: 13px;
    letter-spacing: -.6px;
    -webkit-transform: rotate(-90deg);
    -moz-transform: rotate(-90deg);
}
cs
728x90

'퍼블리싱 > HTML | CSS | Javascript' 카테고리의 다른 글

flexbox  (0) 2017.04.02
배경'만' 투명도 조절  (0) 2017.04.02
테두리 여러개 그리기  (0) 2017.04.02
reset CSS  (0) 2017.04.02
각종 미디어쿼리!  (0) 2017.04.02