๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

Web/๐Ÿงฉ html + CSS

background ์†์„ฑ

background ์˜ ๋Œ€ํ‘œ์ ์ธ ์†์„ฑ 2๊ฐœ๋ฅผ ์†Œ๊ฐœํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.

1. background-color ์†์„ฑ

2. background-image ์†์„ฑ

 

1. background-color ์†์„ฑ

๋ฐฐ๊ฒฝ์ƒ‰์„ ์˜๋ฏธํ•˜๋ฉฐ, ๊ฐ’์€ color ์†์„ฑ์˜ ํฌ๋งท์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

 

<html>
  <head>
    <style>
      div#container div#text {
        width: 500px;
        height: 50px;
        background-color: teal;
        color: white;
      }
      
            div#container div#des {
        width: 500px;
        height: 200px;
        background-color: tomato;
      }
    </style>
  </head>

  <body>
    <div id="container">
      <div id="text">background-color</div>

      <div id="des"></div>
    </div>
  </body>
</html>

 

 

 

 

2. background-image ์†์„ฑ

 

๋ฐฐ๊ฒฝ์„ ์ด๋ฏธ์ง€๋กœ ์ง€์ •ํ•˜๋ฉฐ, url์— ๊ฒฝ๋กœ๋ฅผ ์ž…๋ ฅํ•ด์ค๋‹ˆ๋‹ค.

 

<html>
  <head>
    <style>
      div#container div#text {
        width: 600px;
        height: 50px;
        background-color: yellowgreen;
        color: white;
      }

      div#container div#des {
        width: 600px;
        height: 400px;
        background-image: url("./description/image/back.jpg");
      }
    </style>
  </head>

  <body>
    <div id="container">
      <div id="text">background-color</div>

      <div id="des"></div>
    </div>
  </body>
</html>

'Web > ๐Ÿงฉ html + CSS' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

ํ…Œ์ด๋ธ” ์†์„ฑ  (0) 2020.11.03
ํฌ๊ธฐ  (0) 2020.11.03
font ์†์„ฑ  (0) 2020.11.03
์ปฌ๋Ÿฌ  (0) 2020.11.03
๊ฒฐํ•ฉ ์„ ํƒ์ž  (0) 2020.11.03