HTML 속성

예진·2020년 7월 23일

HTML5

목록 보기
2/17
#### HTML속성

  style="" 색상, 글꼴 크기 등과 같은 요소에 스타일을 추가하는 데 사용한다.
  
  	**색상**
    
      RGBA 와 hsla에서는 alpha 값에 투명도를 추가할 수 있다.
      
      hsl(색조, 채도, 밝기)
      
      글꼴색상: ex)
      	<p style="color:red;">This is a red paragraph.</p>
        
      요소의 배경색 ex)
      	<h1 style="background-color:powderblue;">This is a heading</h1>
       	<p style="background-color:tomato;">This is a paragraph.</p>
        
      페이지 배경색 ex) 
      	<body style="background-color:powderblue;"
      
      테두리  ex) 
      	<h1 style="border:2px solid Tomato;">Hello World</h1>
        
    **글꼴**
    
      글꼴크기:
         ex) 
        1. <h1 style="font-size:60px;">Heading 1</h1>
        2. <h1 style="font-size:300%;">This is a heading</h1>
        
      글꼴: 
      	ex) <h1 style="font-family:verdana;">This is a heading</h1>
        
      글꼴 색: 
      	ex)<p style="color:red;">This is a red paragraph.</p>
        
      정렬: 
      	ex) <h1 style="text-align:center;">Centered Heading</h1>
        
  lang="" 웹 페이지의 언어를 선언할 때 사용.
  	ex) <html lang="en">
    
  title="설명"  요소에 대한 추가 정보를 정의한다. 요소에 마우스를 올리면 설명이 툴팁으로 표시된다. 
  	ex) <p title="I'm a tooltip">This is a paragraph.</p>

0개의 댓글