본문 바로가기
Web/CSS

CSS 밑줄( _, underscore) 또는 빼기(-,hyphen) 의미

by pcm9881 2022. 9. 1.

1. 밑줄 ( _ , underscore)

 

css 예제를 보다보면 가끔 기존 제공되는 속성 이름 앞에 _이 붙어있는걸 볼 수 있다. 

 

궁금해서 관련 내용을 검색해보니 이것은 과거 IE 버전 (5, 5.5 & 6)에서 지원하지 않는 내용을 사용하기 위해 작성해놓는

CSS-Hack이라고 찾아 볼 수 있었다.

 

아래에 예제 처럼 기본적으로 제공되는게 있고 제공이 안되는 브라우저 내용으로 쓰는 건데 지금은 거의 상관없다고 보면 될 거 같다.

 

이런게 있구나 참고용 자료.

selector {
    property: value; /* all browsers */
    property: value\9; /* < IE9 */
    *property: value; /* < IE8 */
    _property: value; /* < IE7 */
}

 

2. 빼기 ( - , hyphen)

 

CSS 규칙으로 벤더 프리픽스(vendor prefix)라고 합니다.

서로 다른 브라우저 제작사들 테스트나 호환되지 않는 방식을 써본 것이 펴진거라고 볼 수 있다.

현재는 많이 줄어들고 있다.

 

-epub- 국제 디지털 출판 포험 ePub 형식
-moz- 파이어폭스 등 모질라 기반 브라우저
-ms- 마이크로소프트 인터넷 익스플로러
-o- 오페라 기반 브라우저
-webkit- 사파리나 크롬 등 웹키트 기반 브라우저

 

 

참조

 

- stack overflow: https://stackoverflow.com/questions/18106356/what-does-an-underscore-mean-in-css 

 

What does an underscore "_" mean in CSS?

I just found the following snippet in a CSS file: position: fixed; _position: absolute; What does this underline mean in front of the second position statement?

stackoverflow.com

- mdn web dosc: https://developer.mozilla.org/en-US/docs/Glossary/Vendor_Prefix

 

Vendor Prefix - MDN Web Docs Glossary: Definitions of Web-related terms | MDN

Browser vendors used to add prefixes to experimental or nonstandard CSS properties and JavaScript APIs, so developers could experiment with new ideas. This, in theory, helped to prevent their experiments from being relied upon and then breaking web develop

developer.mozilla.org

 

728x90

'Web > CSS' 카테고리의 다른 글

[CSS] table td tr 간격 추가하기  (0) 2023.06.20
[CSS] div 위아래 수직정렬  (0) 2023.03.30
[CSS] 리스트 스타일링 ( ul, li )  (0) 2023.03.23
[CSS] 알아두면 좋은 참조 사이트  (0) 2022.12.29
[CSS] 미디어 쿼리 (media query)  (0) 2022.09.26

댓글