[HTML] <a> 태그는 인라인 태그라 display 줘야 width 가능
by mini_min[HTML]
<a> 태그는 인라인 태그라 display 줘야 width 가능
✔️ <a> 태그 + display
: a 태그는 인라인 태그라서 display 가 필요하다.
: 인라인 태그의 경우 width 가 안먹히기 때문에 display 로 블록 스타일을 줘야 padding 이랑 width 가 먹힌다.
/*display 안주면 width 가 안먹음. a태그는 inline 태그라서 width 안먹으니까 display 줘야한다.*/
nav a {
text-decoration: none;
color: white;
display: block;
padding: 10px 0;
width: 170px;
font-weight: 700;
}
'HTML' 카테고리의 다른 글
[HTML] <div> - float 속성 / clear 속성 / div 폭 계산 / box-sizing (0) | 2022.09.08 |
---|---|
[HTML] CSS(Cascading Style Sheet) 레이아웃 태그 - <div> 태그 (0) | 2022.09.08 |
[HTML] 주요 formatting 태그 / <b> / <em> / <i> / <pre> / <sub> / <sup> (0) | 2022.09.06 |
[HTML] 공통 속성(Global Attributes) / data-* / contenteditable (0) | 2022.09.06 |
[HTML] Block-level element / inline element / 특수문자 (0) | 2022.09.06 |
블로그의 정보
개발자 미니민의 개발로그
mini_min