What does the smiley face ":)" mean in CSS?
I spotted this CSS code in a project:
html, body { :)width: 640px;}
I have been around with CSS for a long time now but I never saw this ":)" code before. Does it mean anything or is it just a typo?
From an article at javascriptkit.com, that's applied for IE 7 and earlier versions:
별표와 같은 영숫자가 아닌 문자를 추가하는 경우(
*
) 속성 이름 직전에 IE에서 적용되며 다른 브라우저에서는 적용되지 않습니다.
Also there's a hack for <= IE 8:
div {
color: blue; /* All browsers */
color: purple\9; /* IE8 and earlier */
*color: pink; /* IE7 and earlier */
}
However that's not a good idea, they don't validate. You always feel free to work with Conditional comments for targeting specific versions of IE:
<!--[if lte IE 8]><link rel="stylesheet" href="ie-8.css"><![endif]-->
<!--[if lte IE 7]><link rel="stylesheet" href="ie-7.css"><![endif]-->
<!--[if lte IE 6]><link rel="stylesheet" href="ie-6.css"><![endif]-->
하지만 해킹을 실제로 보고 싶은 분들은 현재 보유하고 있는 IE의 최신 버전에서 이 페이지를 열어주시기 바랍니다.그런 다음 에뮬레이션 ctrl8섹션에서 (+) 문서 모드를 다음으로 변경하여 개발자 모드로 이동합니다.7
무슨 일이 일어나는지 봐요.
페이지에 사용된 속성은:)font-size: 50px;
.
It looks like a CSS hack to target IE7 and earlier browsers. While this is invalid CSS and browsers should ignore it, IE7 and earlier will parse and honor this rule. Here is an example of this hack in action:
CSS
body {
background: url(background.png);
:)background: url(why-you-little.png);
}
IE8 (ignores the rule)
IE7 (applies the rule)
Note that it does not have to be a smiley face; BrowserHacks mentions:
다음 문자의 조합:
! $ & * ( ) = % + @ , . / ` [ ] # ~ ? : < > |
[property name이 작동하기 전] Internet Explorer ≤ 7
The GAH hot dog stand example is here.
ReferenceURL : https://stackoverflow.com/questions/25444328/what-does-the-smiley-face-mean-in-css
'programing' 카테고리의 다른 글
Informix에서 Oracle로 여러 테이블을 포함하는 왼쪽 외부 조인 다시 쓰기 (0) | 2023.09.09 |
---|---|
Twitter 부트스트랩 텍스트 상자 글로우 및 섀도 재정의 (0) | 2023.09.09 |
다중 태그 도커 이미지 만들기 (0) | 2023.09.09 |
django test client는 url에 액세스할 때 301개의 리디렉션을 받습니다. (0) | 2023.09.09 |
축소 도구막대 배치를 프로그래밍 방식으로 축소 또는 확장 (0) | 2023.09.09 |