프론트엔드/CSS

CSS 13 background-color 속성으로 배경 색상 지정하기

스펀지연구소 2021. 3. 20. 08:12

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>배경 색상</title>
    <style>
        body{
            background-color:#0000ff; /*파란색*/
        }
        h1{
            background-color: #ffff00; /*노란색*/
        }
        p{
            background-color: #ffffff; /*흰색*/
        }
        #cian{
            background-color: #00ffff; /*하늘색*/
        }
    </style>
</head>
<body>
    <h1>초보개발자의 성장블로그</h1>
    <p>놀라지마세요 
        <span id="cian">배경 색상 지정하는 css 효과</span>
        가 적용 되었어요.</p>    
</body>
</html>