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 |
Tags
- 폰번호추출
- iostream.h
- 자동화 서버는 개체를 작성할 수 없습니다.
- 이메일광고
- Stand 4 U
- 이메일수집
- 이메일추출
- esperanca.kr
- 태마곡
- 김밥할머니 폭행사건
- VisualStudio 2003 .NET
- 전화번호찾기
- 이메일수집기
- 비주얼 C++
- 네이버1위
- 절대참조
- 애러
- 메일수집
- 전번
- 용역직원
- 김밥할머니 폭행 동영상
- esperanca
- Visual Studio .NET 9.0 Express Edition
- 누난 너무 예뻐
- 제2의 동방신기
- 자동화 서버
- 심플네이버
- 네이버
- http://www.microsoft.com/downloads/
- 폰번호정리
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 변수를 사용하기|작성자 블러그