다음 속성을 이용하시면 됩니다.
list-style-type: none;
1. Example
[Click Me]버튼을 클릭할 때마다 블릿표시가 토글됩니다.
[HTML Code]
[//HTML Code]
2. Source
더보기
<!-- ---------------------------------------------------------
--
-- Author: 1q74.tistory.com
--
--------------------------------------------------------- -->
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<title>[1q74.tistory.com] css/common/li/bullet-display</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
</head>
<body>
<div name="_1q74-example-root">
<div name="_1q74-example-1">
<li>블릿 마크가 표시됩니다</li>
</div>
<div name="_1q74-example-bottom">
<br/>
<button name="btn-execute">Click Me</button>
</div>
</div>
<hr/>
<h5>[HTML Code]</h5>
<div name="_1q74-source">
</div>
<h5>[//HTML Code]</h5>
<script>
var example = $("[name='_1q74-example-1'] > li");
var btnExecute = $("[name='btn-execute']");
btnExecute.click(function() {
if(!example.is("[style]")) {
example
.css("list-style-type", "none")
.text("블릿 마크가 없어집니다");
} else {
example.removeAttr("style").text("블릿 마크가 표시됩니다");
}
});
// ------------------------------------------------------
// 소스출력
// ------------------------------------------------------
var textSource = $("[name='_1q74-source']");
var exampleHtml = $("[name='_1q74-example-root']").html();
var specialCharLines = textSource.text(exampleHtml).html().split("\n");
textSource.html(specialCharLines.join("<br/>").replaceAll("\t", " "));
// ------------------------------------------------------
</script>
<style>
[name|="_1q74-example"] button {
background: lightgray;
border: 5px outset;
min-height: 30px;
}
[name|="_1q74-example"] button:active {
border: 2px inset;
min-height: 30px;
}
</style>
</body>
</html>
3. File
'CSS > Cookbook' 카테고리의 다른 글
【CSS/Cookbook】How are the display values different between block and inline block? (0) | 2023.05.24 |
---|---|
【CSS/Cookbook】<fieldset>, <legend> (Group으로 묶어서 표시하기) (0) | 2023.05.24 |
【CSS/table】Creating table with div(div로 테이블 만들기) #1 (0) | 2023.03.16 |
【CSS/Cookbook】Making HTML Random Color Code(HTML 랜덤 색상 만들기) (0) | 2023.03.16 |
pseudo-class에 대하여 (0) | 2023.02.23 |