STUDY/멀티미디어콘텐츠과정
#22 background url 주기
korino39
2021. 12. 28. 17:49

오늘 학습한 css.
background:url("images/notice_bg.gif") repeat-x;
불러오는 이미지를 x축으로 반복하라.
background:url("images/icon_more.gif") no-repeat left center;
여기서 left는 x축값, center는 y축 값이 된다.
line-height:52px;
이건 좀....들어도 이해를 못했다...
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>공지사항</title>
<style>
html, body, ul, ol, li, p h1, h2, h3, h4, h5, h6{margin:0; padding:0;}
li{list-style:none;}
a{
text-decoration: none;
}
.container{
overflow:hidden;
padding:20px;
}
.board{
position:absolute;
float:left;
width:410px;
height:372px;
padding:30px 30px 0 30px;
background:#ffff;
border:2px solid #3333
}
.board .list ul li{
overflow:hidden;
border-bottom: 1px solid #e6e6e6;
height:52px;
line-height: 52px;
}
.board h2{
color:#0262b2;
padding-bottom: 20px;
}
.board .list ul li a{
float:left;
width:280px;
overflow:hidden;
text-overflow: ellipsis;
white-space:nowrap;
color:#333
}
.board .list ul li span{
float:right;
}
.board .list{
background:url("images/notice_bg.gif") repeat-x;
padding-top:20px;
}
.more{
position:absolute;
top:20px;
right: 30px;
}
.more a{
display:block;
padding-left: 12px;
color:black;
text-decoration: none;
background:url("images/icon_more.gif") no-repeat left center;
}
/* 말줄임 3형제 */
.text{
overflow:hidden;
text-overflow: ellipsis;
white-space:nowrap;
}
</style>
</head>
<body>
<div class="container">
<div class="board">
<h2>이룸소식</h2>
<div class="list">
<ul>
<li>
<a href="#">제목이 길어질 경우 여기까지 말줄임이 나와야 합니다.</a>
<span>21.12.06</span>
</li>
<li>
<a href="#">제목</a>
<span>21.12.06</span>
</li>
<li>
<a href="#">제목</a>
<span>21.02.26</span>
</li>
<li>
<a href="#">제목</a>
<span>21.12.06</span>
</li>
</ul>
</div>
<!-- 절대위치 -->
<p class="more">
<a href="#">전체보기</a></p>
</div>
</div>
</body>
</html>
결과물.
반응형