CSS Visual Rules

김서하·2021년 4월 1일
0

CSS

목록 보기
2/11
글꼴 타입:(font-family)
 h1 {
   font-family: Georgia;
 } - 서체 이름이 긴 경우 "Courier New" 처럼 큰따옴표(" ")쓰기
 
 글꼴 크기:(font-size)
  p {
   font-size: 18px;
  }
  
 글꼴 두께:(font-weight)
  p {
   font-weight: bold;
   }
   
 텍스트 정렬:(text-align)
  h1 {
    text-align: center;
   } -> left, right, center 중 하나로 설정!
   
  색깔:(color & background-color)
   h1 {
    color: red;
    background-color: blue;
    } -> 텍스트 색과 배경 색
    
  불투명도:(opacity)
   .overlay {
     opacity: 0.5;
    } -> 0~1까지, 1은 완전히 보이거나 불투명/0은 완전히 보이지 않음
    
  배경 이미지:(background-image)
   .main-banner {
     background-image:
    url("images/mountains.jpg");
    } -> 이미지 폴더에 이미지가 있는 경우
    
   중요도:(!important)
    p {
     color: blue !important;
     }   
   .main p {
     color: red;
    } -> 이 경우 .main p 가 더 구체적이라 red로 설정되어야 하지만
         !important의 영향으로 p 태그가 선언됨!!
  
   
   
   
   
   
   
   
   
   
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 
 
 
 
profile
개발자 지망생 서하입니당

0개의 댓글