Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- Visual Studio .NET 9.0 Express Edition
- 이메일광고
- 네이버1위
- esperanca.kr
- 비주얼 C++
- 제2의 동방신기
- 이메일수집
- 네이버
- iostream.h
- 애러
- Stand 4 U
- esperanca
- 메일수집
- 전화번호찾기
- http://www.microsoft.com/downloads/
- 심플네이버
- VisualStudio 2003 .NET
- 자동화 서버는 개체를 작성할 수 없습니다.
- 이메일수집기
- 자동화 서버
- 폰번호추출
- 절대참조
- 용역직원
- 김밥할머니 폭행사건
- 폰번호정리
- 김밥할머니 폭행 동영상
- 태마곡
- 누난 너무 예뻐
- 전번
- 이메일추출
Archives
- Today
- Total
BLOG ESPERANCA
css 파일에서 php 변수를 사용하기 본문
http://css-tricks.com/css-variables-with-php/
Style.php
Instead of using the .css file extension, use .php
<link rel='stylesheet' type='text/css' href='css/style.php' />
Content-type
At the top of your new style.php file set the Content-type back to CSS:
<?php
header("Content-type: text/css; charset: UTF-8");
?>
Setup variables
Now you can set up variables for whatever you like:
<?php header("Content-type: text/css; charset: UTF-8"); $brandColor = "#990000"; $linkColor = "#555555"; $CDNURL = "http://cdn.blahblah.net"; ?>
Use variables
Below all that PHP stuff, you can just commence regular CSS writing, only you can intermix some PHP to spit out those variables
#header {
background: url("<?php echo $CDNURL; ?>/images/header-bg.png") no-repeat;
}
a {
color: <?php echo $linkColor; ?>;
}...
ul#main-nav li a {
color: <?php echo $linkColor; ?>;
}
[출처] css 파일에서 php 변수를 사용하기|작성자 블러그