티스토리 뷰
게시판 형태로 자료를 작성할때 마우스를 가져다 대면 한줄이 전체 선택되는 CSS class가 있을까?
이런 의문에서 찾아보고, 실제 구현한 내용을 공유해 봅니다.
결과를 보면 아래와 같이 한줄이 마우스를 갖다 대면 이렇게 나옵니다.
보통은 a태그를 이용해서 글씨를 클릭해서 선택하는 것이 많은데, 좀 더 UI가 이쁜 것 같아서 이렇게 하는 것도 좋을 것 같네요. 더 직관적이고...
위의 형태를 하려면 당연히 CSS 내용이 있어야 합니다.
style.css 파일에 아래의 내용이 있어야 저런 동작을 이끌어 낼 수 있는 거죠.
@import url(//devizzer.github.io/fonts/ko/notosanskr/font.css);
body {margin: 0; line-height: 150%; font-family: 'Noto Sans KR',sans-serif;}
h1,h2,h3,h4,h5,h6 {margin: 0;}
ul, ol {margin: 0; padding: 0; list-style: none;}
a {text-decoration: none;}
.limit {overflow: hidden; width: 1680px;}
.header-logo {padding: 20px 0;}
.btn_state {padding: 3px 8px;border: 1px solid gray;border-radius: 3px;font-weight:bold;font-size:14px}
@keyframes blink-effect { 50% { opacity: 0; } }
.blink {animation: blink-effect 1s step-end infinite;}
.color-red {color:red}
.color-green {color:green}
.color-black {color:black}
.color-blue {color:blue}
.color-purple {color:purple}
.color-brown {color:brown}
.list-header {padding: 20px 0;}
.list-header .list-title > span {font-weight:normal;}
.list-row {display: table; width: 100%;border-bottom: 1px solid #eee; font-size: 13px; color: #666;}
.list-row a:link, .list-row a:visited {color:black}
.list-row--header {padding: 10px 0; background: #f8f8f8; border-top: 2px solid #333;font-weight: bold; color: #222;}
.list-link {display: table; width: 100%; color: #666;}
.list-link:hover {background: #ddd; }
.list-cell {display: table-cell; padding: 10px 5px;text-align: center; vertical-align: middle;}
.list-cell--10 {width: 10px;}
.list-cell--20 {width: 20px;}
.list-cell--30 {width: 30px;}
.list-cell--40 {width: 40px;}
.list-cell--50 {width: 50px;}
.list-cell--60 {width: 60px;}
.list-cell--70 {width: 70px;}
.list-cell--80 {width: 80px;}
.list-cell--90 {width: 90px;}
.list-cell--100 {width: 100px;}
.list-cell--110 {width: 110px;}
.list-cell--120 {width: 120px;}
.list-cell--130 {width: 130px;}
.list-cell--140 {width: 140px;}
.list-cell--150 {width: 150px;}
.list-cell--160 {width: 160px;}
.list-cell--170 {width: 170px;}
.list-cell--180 {width: 180px;}
.list-cell--190 {width: 190px;}
.list-cell--200 {width: 200px;}
.list-cell--210 {width: 210px;}
.list-cell--220 {width: 220px;}
.list-cell--230 {width: 230px;}
.list-cell--240 {width: 240px;}
.list-cell--250 {width: 250px;}
.list-cell--260 {width: 260px;}
.list-cell--270 {width: 270px;}
.list-cell--280 {width: 280px;}
.list-cell--290 {width: 290px;}
.list-cell--300 {width: 300px;}
.list-cell--350 {width: 350px;}
.list-cell--400 {width: 400px;}
.list-cell--500 {width: 500px;}
.list-cell span {display: block;}
.ui-button {text-align: right;}
.ui-button a {display: inline-block; background: #eee; font-size: 12px; color: #aaa; padding: 10px 20px; border-radius: 5px;}
/* index */
.section-index {margin-top: 50px;}
.section-index__title {padding: 5px 0;font-size: 18px;}
/* form */
.form-unit {}
.form-unit--ib {display: inline-block; margin-right: 20px;}
.work-order {margin-top: 20px; padding: 10px; border: 1px solid #000;}
.work-gubun {border-bottom: 1px solid #000;}
.component {padding: 10px;border: 1px solid #eee;}
.nav-group {overflow: hidden;}
.nav-item {float: left; margin-right: 15px;}
.main {}
.main__title {padding: 30px 0;}
.section__title {}
.sort {padding: 20px; border: 1px solid #eee; box-sizing: border-box;}
.sort__item {display: inline-block; margin-right: 20px;}
.pagenation {padding: 30px 0;text-align: center;}
.pagenation__arrow {display: inline-block;}
.pagenation__group {display: inline-block; margin: 0 30px;}
.pagenation__item {display: inline-block; margin: 0 10px;}
.footer {padding: 50px 0;}
@media screen and (max-width: 1279px) {}
@media screen and (min-width: 1280px) {}
가장 중요한 부분은 .list~~~~~~~~~ 이렇게 생긴 것이 결국 화면구성을 도와줍니다.
실제 프로그램은 아래와 같이 구현되는 것입니다.
<link rel="stylesheet" type="text/css" href="../css/style.css">
<main class="main">
<div class="limit">
<div class="list-header">
<ul class="list-group">
<li class="list-row list-row--header">
<div class="list-cell list-cell--40">번호</div>
<div class="list-cell list-cell--90">출고일자</div>
<div class="list-cell list-cell--70">접수일</div>
</li>
<li class="list-row">
<div class="list-cell list-cell--40"><?=$start_num ?></div>
<div class="list-cell list-cell--90"><?=$outdate?></div>
<div class="list-cell list-cell--70"><?=$item_indate?></div>
</li>
</ul>
</div>
</div>
</main>
위의 코드로 만들면 보기 좋은 게시판 라인선택 UI가 될 것입니다.
'IT tech Coding > CSS' 카테고리의 다른 글
CSS 파일 효율적 관리 방법 (0) | 2023.11.12 |
---|---|
부트스트랩의 글자색 변경 쉬운방법 (0) | 2020.08.16 |
부트스트랩 폰트크기 변경등 폰트변형하는 방법 (0) | 2020.08.15 |
크롬에서 F5로 새로고침할때 바로 바로 적용이 안될때, 특히 CSS파일 (0) | 2019.07.10 |
- Total
- Today
- Yesterday
- #InnoSetup
- 테크에능한여성
- 자바스크립트한글입력시반응하도록만드는코드
- 카페24가비아phpinfo수정
- Bootstrap 5
- General error: 2031
- #InstallForge
- 작업공정에 대한 코드작성
- #소프트웨어배포
- 오토핫키에디터창업데이트금지하기
- sql문장 날짜계산
- .htaccess수정
- 뫄프로그래밍
- 프로그래머생활
- #파이썬패키징
- 2분후종료오토핫키
- 자바스크립트 한글초성
- #파이썬인스톨러
- #프로그램설치
- 코딩튜토리얼
- 오토핫키가이드
- #NSIS
- #독립실행파일
- td요소중에 1행과 1열은 제외
- 효율적코딩방법
- 코딩효율성
- chatGPT3.5파이썬버전
- #cx_Freeze
- 스크립트작성기초
- 파이썬코드줄바꿈방법
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |