글목록(li 태그) 표시에 대한 새로운 아이디어 > html

본문 바로가기

html

글목록(li 태그) 표시에 대한 새로운 아이디어

작성일 06-09-14 11:30

페이지 정보

작성자서방님 조회 110회 댓글 0건

본문

다음은 전형적인 글목록인 <li> 태그를 사용한 것이 아니다. 대신 특수 문자(•)를 이용하였다.

예제는 첨부한 파일을 참고하세요.

<a href="/channel/index.asp?cid=2"><span class="myBullet"></span>뉴스</a><br>
<a href="/channel/index.asp?cid=3"><span class="myBullet"></span>e비즈니스</a><br>
<a href="/channel/index.asp?cid=4"><span class="myBullet"></span>웹개발</a><br>
<a href="/channel/index.asp?cid=5"><span class="myBullet"></span>테크</a>

글목록 표시 •를 class가 myBullet인 <span> 태그로 감쌌다. 그렇다면 myBullet 클래스에 대한 스타일 정의는 어떻게 되어 있을까?

<style type="text/css">
<!--
a { text-decoration: none; color: #333333}
a:hover { text-decoration: none; color: #336699}
a .myBullet { color: silver}
a:hover .myBullet { color: #CC0000}
-->
</style>

myBullet 클래스에 대한 a태그 스타일과 a:hover에 대한 스타일을 정의한 것인데 a:hover 발생시 color 속성을 #CC0000으로 변경해 주는 것이 핵심이다.

어려운 내용은 아니지만 이런 기법을 통해 CSS에 대한 새로운 아이디어를 많이 얻을 수 있으리라 생각한다.

http://korea.internet.com/

첨부파일

댓글목록

등록된 댓글이 없습니다.

게시물 검색
Copyright © 서방님.kr All rights reserved.
PC 버전으로 보기