လုပ်နည်း - CSS Calendar
CSS ဖြင့် ပြက္ခဒိန်တစ်ခုဖန်တီးနည်းကို လေ့လာပါ။
Calendar Layout ဖန်တီးနည်း
- ❮
- ❯
-
ဩဂုတ်လ
2021
- မို
- မင်း
- ကျွန်တော်တို
- Th
- Fr
- ရန်
- သူ့
- ၁
- ၂
- ၃
- ၄
- ၅
- ၆
- ၇
- ၈
- ၉
- ၁၀
- ၁၁
- ၁၂
- ၁၃
- ၁၄
- ၁၅
- ၁၆
- ၁၇
- ၁၈
- ၁၉
- ၂၀
- ၂၁
- ၂၂
- ၂၃
- ၂၄
- ၂၅
- ၂၆
- ၂၇
- ၂၈
- ၂၉
- ၃၀
- ၃၁
အဆင့် 1) HTML ကိုထည့်ပါ
ဥပမာ
<div class="month">
<ul>
<li class="prev">❮</li>
<li class="next">❯</li>
<li>August<br><span
style="font-size:18px">2021</span></li>
</ul>
</div>
<ul class="weekdays">
<li>Mo</li>
<li>Tu</li>
<li>We</li>
<li>Th</li>
<li>Fr</li>
<li>Sa</li>
<li>Su</li>
</ul>
<ul class="days">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
<li><span class="active">10</span></li>
<li>11</li>
...etc
</ul>
အဆင့် 2) CSS ကိုထည့်ပါ
ဥပမာ
ul {list-style-type: none;}
body {font-family: Verdana, sans-serif;}
/* Month header */
.month {
padding: 70px 25px;
width: 100%;
background: #1abc9c;
text-align:
center;
}
/* Month list */
.month ul {
margin: 0;
padding: 0;
}
.month ul li {
color: white;
font-size: 20px;
text-transform: uppercase;
letter-spacing: 3px;
}
/* Previous button inside month header */
.month .prev {
float: left;
padding-top: 10px;
}
/* Next button */
.month .next {
float: right;
padding-top: 10px;
}
/* Weekdays (Mon-Sun) */
.weekdays {
margin: 0;
padding: 10px 0;
background-color:#ddd;
}
.weekdays li {
display: inline-block;
width: 13.6%;
color: #666;
text-align: center;
}
/* Days (1-31) */
.days {
padding: 10px 0;
background: #eee;
margin: 0;
}
.days li {
list-style-type: none;
display: inline-block;
width: 13.6%;
text-align: center;
margin-bottom: 5px;
font-size:12px;
color: #777;
}
/* Highlight the "current" day */
.days li .active {
padding: 5px;
background: #1abc9c;
color: white !important
}