bookmark_borderCSS 고급활용

전환 : CSS Transitions

<style> 
div {
  width: 100px;
  height: 100px;
  background: red;
  transition: width 2s;
}

div:hover {
  width: 300px;
}
</style>
...
<p>Hover over the div element below, to see the transition effect:</p>
<div></div>
...

애니메이션 : CSS Animations

<style> 
div {
  width: 100px;
  height: 100px;
  background-color: red;
  animation-name: example;
  animation-duration: 4s;
}

@keyframes example {
  from {background-color: red;}
  to {background-color: yellow;}
}
</style>
...
<div></div>
<p><b>Note:</b> When an animation is finished, it goes back to its original style.</p>
...

그래디언트 : CSS Gradients

<style>
#grad1 {
  height: 200px;
  background-color: red; /* For browsers that do not support gradients */
  background-image: linear-gradient(to bottom right, red, yellow);
}
</style>
...
<p>This linear gradient starts red at top left, transitioning to yellow (at bottom right):/p>
<div id="grad1"></div>
...

텍스트 그림자 효과 : CSS Shadow Effects

<style>
h1 {
  color: white;
  text-shadow: 1px 1px 2px black, 0 0 25px blue, 0 0 5px darkblue;
}
</style>
...
<h1>Text-shadow effect!</h1>
...

상자 그림자 효과 : CSS Box Shadow

Text Card Shadow
<style>
div.card {
  width: 250px;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  text-align: center;
}

div.header {
  background-color: #4CAF50;
  color: white;
  padding: 10px;
  font-size: 40px;
}

div.container {
  padding: 10px;
}
</style>
...
<div class="card">
  <div class="header">
    <h1>1</h1>
  </div>
  <div class="container">
    <p>January 1, 2021</p>
  </div>
</div>
...
Image Shadow
<style>
div.polaroid {
  width: 250px;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  text-align: center;
}

div.container {
  padding: 10px;
}
</style>
...
<div class="polaroid">
  <img src="rock600x400.jpg" alt="Norway" style="width:100%">
  <div class="container">
    <p>Hardanger, Norway</p>
  </div>
</div>
...

페이징 : CSS Pagination Examples

<style>
.pagination {
  display: inline-block;
}

.pagination a {
  color: black;
  float: left;
  padding: 8px 16px;
  text-decoration: none;
}

.pagination a.active {
  background-color: #4CAF50;
  color: white;
}

.pagination a:hover:not(.active) {background-color: #ddd;}
</style>
...
<div class="pagination">
  <a href="#">&laquo;</a>
  <a href="#">1</a>
  <a class="active" href="#">2</a>
  <a href="#">3</a>
  <a href="#">4</a>
  <a href="#">5</a>
  <a href="#">6</a>
  <a href="#">&raquo;</a>
</div>
...

툴팁 : CSS Tooltip

<style>
.tooltip {
  position: relative;
  display: inline-block;
  border-bottom: 1px dotted black;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 120px;
  background-color: black;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px 0;

  /* Position the tooltip */
  position: absolute;
  z-index: 1;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
}
</style>
...
<div class="tooltip">Hover over me
  <span class="tooltiptext">Tooltip text</span>
</div>
...

2D변형 – rotate, scale, translate : CSS 2D Transforms

<style>
div {
  width: 300px;
  height: 100px;
  background-color: yellow;
  border: 1px solid black;
}

div#myDiv {
  transform: rotate(20deg);
}
</style>
...
<div>
This a normal div element.
</div>

<div id="myDiv">
This div element is rotated clockwise 20 degrees.
</div>
...
<style> 
div {
  width: 300px;
  height: 100px;
  background-color: yellow;
  border: 1px solid black;
  transform: translate(50px,100px);
}
</style>
...
<div>
This div element is moved 50 pixels to the right, and 100 pixels down from its current position.
</div>
...

과제 : 0305-css-homework-1.html

bookmark_border워드프레스 달력 스타일 변경

기본 달력의 모양이 심심하여 스타일을 변경함.

관리자 > 테마디자인 > 사용자 정의하기 > 추가 CSS 에 CSS 추가

참고 : Better WordPress Calendar Widget Sass/CSS Styles

/* calendar widget */
.widget_calendar {float: left;}
#wp-calendar {
	width: 100%;
	max-width: 37.5rem;
	background: #ccc;
	margin-left: auto;
	margin-right: auto;
	font-size: 12px;
}

#wp-calendar caption { 
   text-align: right;
   color: #333;
   font-size: 13px;
   margin-top: 5px;
   margin-bottom: 5px;
}

#wp-calendar thead tr {
	border: 1px solid #ccc;
}

#wp-calendar thead th {
	font-size: 90%;
	font-weight: bold;
	padding: 0.5rem;
	background: #ccc;
	text-transform: uppercase;
	text-align: center;
}

#wp-calendar tbody td {
	position: relative;
	padding: 0.25rem;
	text-align: center;
	border: 1px solid #ccc;
	background: #fff;
}

#wp-calendar tbody td.pad {
	opacity: 0.7;
}

#wp-calendar tbody td#today {
	font-weight: bold;
}

#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;
}