JS- CSS기초

Jeongwon·2022년 1월 12일
0

Java Script

목록 보기
5/14

1) style태그 속성을 사용해 글자 색 바꾸기

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>WEB1- JavaScript</title>
  </head>
  <body>
    <h1><a href="index.html">WEB</a></h1>
    <h2 style="background-color: coral;color:powderblue">JavaScript</h2>
    <p>JavaScript (/ˈdʒɑːvəˌskrɪpt/),[10] often abbreviated JS, is a programming
       language that is one of the core technologies of the World Wide Web,
       alongside HTML and CSS.[11] Over 97% of websites use JavaScript on the
       client side for web page behavior,[12] often incorporating third-party
       libraries.[13] All major web browsers have a dedicated JavaScript engine
        to execute the code on users' devices.
        JavaScript is a high-level, often just-in-time compiled language
         that conforms to the ECMAScript standard.[14] It has dynamic typing,
          prototype-based object-orientation, and first-class functions. It is
          multi-paradigm, supporting event-driven, functional, and imperative
          programming styles. It has application programming interfaces (APIs)
           for working with text, dates, regular expressions, standard data
           structures, and the Document Object Model (DOM).</p>
  </body>
</html>

👉결과

2) style태그 사용

<div> </div> - 아무런 의미가 없는 태그(디자인을 위해 사용)
<span> </span> -div는 전체를 사용하지만 span은 자신의 영역만 사용

1) JavaScript라는 글자를 js라는 클래스에 소속시킴

2) style태그를 통해 js클래스에 소속된 것들의 속성을 한번에 바꿈

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>WEB1- JavaScript</title>
    <style>
      .js {
        font-weight: bold;
        color: red;
      }
    </style>
  </head>
  <body>
    <h1><a href="index.html">WEB</a></h1>
    <h2 style="background-color: coral;color:powderblue">JavaScript</h2>
    <p>
      <span class = "js">JavaScript</span> (/ˈdʒɑːvəˌskrɪpt/),[10] often abbreviated JS, is a programming
      language that is one of the core technologies of the World Wide Web,
      alongside HTML and CSS.[11] Over 97% of websites use <span class = "js">JavaScript</span> on the
      client side for web page behavior,[12] often incorporating third-party
      libraries.[13] All major web browsers have a dedicated <span class = "js">JavaScript</span> engine
      to execute the code on users' devices.
      <span class = "js">JavaScript</span> is a high-level, often just-in-time compiled language
      that conforms to the ECMAScript standard.[14] It has dynamic typ  ing,
      prototype-based object-orientation, and first-class functions. It is
      multi-paradigm, supporting event-driven, functional, and imperative
      programming styles. It has application programming interfaces (APIs)
      for working with text, dates, regular expressions, standard data
      structures, and the Document Object Model (DOM).
    </p>
  </body>
</html>
profile
(❁´◡`❁)

0개의 댓글