"HTML div 대각선 그리기"의 두 판 사이의 차이

7번째 줄: 7번째 줄:
<style>
<style>
.slash {
.slash {
   background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"><line x1="0" y1="100%" x2="100%" y2="0" stroke="gray" /></svg>');
   background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"><line x1="0" y1="100%" x2="100%" y2="0" stroke="#333333" /></svg>');
}
}
.backslash {
.backslash {

2020년 7월 29일 (수) 17:46 판

1 개요

CSS div 대각선 넣기
HTML div 대각선 넣기

2 소스 코드

<style>
.slash {
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"><line x1="0" y1="100%" x2="100%" y2="0" stroke="#333333" /></svg>');
}
.backslash {
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"><line x1="0" y1="0" x2="100%" y2="100%" stroke="gray" /></svg>');
}
div {
	display:inline-block;
	border:1px solid gray;
	padding: 5px;
} 
</style>

<div class="slash">안녕</div>
<div class="backslash">Hello<br>World</div>

3 같이 보기

4 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}