CSS

css 글자색과 배경옵션

JDK's blog 2015. 5. 30. 22:50

css 글자색을 적용해보겠습니다.

file.css

#d{
 color:blue;
 background-color:red;
}
span{
 color:red;
 background-image:url(./XtoX.png);
}

 

1) background-color : 배경색

ex) background-color:red;

2) background-image:url(위치) : 위치는 css가 포함되어 있는 파일기준

​ex) background-image : url(./image.png);

3) background-repeat : 그림의 반복여부 (repeat, no-repeat, repeat-x, repeat-y) // repeat가 기본

ex) background-repeat : repeat;

4) background-attachment: 고정할 것인지, 스크롤할 것인지 정합니다.(fixed, scroll) // scroll 기본

ex) background-attachment:fixed;

 

5) background-position: 그림의 위치(left,center,right) (top,center,bottom), x% y%, xpx ypx;

//left top 기본

ex) background-position:center center;

 

6) background-size: 그림의 크기를 늘려줍니다. auto, cover, contain, 가로% 세로%, 가로px 세로px;

​ex)

background-size:100px 100px;

 

<link rel="stylesheet" type="text/css" href="./cssfile/file.css">