기본적으로 HTML의 모든 링크는 밑줄로 장식됩니다. CSS text-decoration 속성을 사용하여 이 밑줄을 제거할 수 있습니다.
구문
CSS text-decoration 속성의 구문은 다음과 같습니다 -
Selector {
text-decoration: /*value*/
} 예시
다음 예는 CSS text-decoration 속성을 보여줍니다.
<!DOCTYPE html>
<html>
<head>
<style>
p {
padding: 5px;
box-shadow: inset 0 0 5px violet;
}
a {
font-style: italic;
text-decoration: none;
}
</style>
</head>
<body>
<a href="#">Demo</a>
<p>
<a href="https://example.com/">Example domain</a>
</p>
</body>
</html> 출력
이것은 다음과 같은 출력을 제공합니다 -

예시
<!DOCTYPE html>
<html>
<head>
<style>
div {
margin: auto;
width: 50%;
text-align: right;
color: green;
border: thin dashed red;
}
a {
text-decoration: none;
}
a:last-child {
color: inherit;
background-color: moccasin;
}
</style>
</head>
<body>
<div>
<a href="#">Link Demo</a>
<p>
Watch this: <a href="https://example.com/">Example site</a>
</p>
</div>
</body>
</html> 출력
이것은 다음과 같은 출력을 제공합니다 -
