DevPress

워드프레스 – 달력 위젯 CSS

2024-08-05 | Theme, WordPress | 코멘트 0개

배경색으로 달력 테이블 강조하기

일요일은 붉은색, 토요일은 푸른색으로 요일을 강조하면 달력을 알아보기 쉬워집니다.

아래 코드를 style.css 또는 사용자 정의 CSS 항목에 붙여넣습니다.

/* Calendar */
#wp-calendar {
    caption-side: top;
    width: 100%;
    max-width: 37.5rem;
    background: #ccc;
    margin-left: auto;
    margin-right: auto;
}
#wp-calendar caption {
    padding: 0.25rem;
    text-align: center;
}
#wp-calendar thead tr {
    border-right: 1px solid #ccc;
}
#wp-calendar thead th {
    font-size: 90%;
    font-weight: bold;
    padding: 0.25rem;
    background: #ccc;
    text-transform: uppercase;
}
#wp-calendar tbody td {
    position: relative;
    padding: 0.125rem;
    border: 1px solid #ccc;
    background: #fff;
}
#wp-calendar tbody td.pad {
    opacity: 0.7;
    background: #eee;
}
#wp-calendar tbody td#today {
    font-weight: bold;
    background: #ffff00;
}
#wp-calendar tbody td#today:after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-top: 10px solid #999;
    border-left: 10px solid transparent;
}
#wp-calendar tbody td a {
    display: block;
    background: rgba(50, 153, 187, 0.2);
}
#wp-calendar tbody td a:hover {
    background: #3299bb;
    color: #fff;
}
#wp-calendar tfoot tr {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #ccc;
}
#wp-calendar tfoot tr td {
    border: 0;
    padding: 0;
}
#wp-calendar tfoot tr a {
    display: block;
    padding: 0.25rem 0.75rem;
}
#wp-calendar tfoot tr a:hover {
    background: #fff;
}
#wp-calendar tfoot tr #prev {
    text-align: left;
}
#wp-calendar tfoot tr #next {
    text-align: right;
}
#wp-calendar :is(th, td) {
    text-align: center;
}
#wp-calendar tr :is(th:first-of-type, td:first-of-type):not([class]) {
    background-color: #f8a1a4;
}
#wp-calendar tr :is(th:last-of-type, td:last-of-type):not([class]) {
    background-color: #94d8f6;
}

0개의 댓글

댓글 제출

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다