Page 186 - CITS - CSA - TP (Volume 1) - Hindi
P. 186

कंप्यूटर सॉफ्टवेयर एप्लीकेशन- CITS


























           टा  10: गितशील  प से <style> एिलम ट बनाएँ  और उसे डॉ ूम ट म  जोड़

           1  टे  एिडटर ओपन कर

           2  िन िल खत कोड िलख

              <html>
              <head>

              <meta charset=”UTF-8”>

              <meta name=”viewport” content=”width=device-width, initial-scale=1.0”>
              <title>Creating a Style Element</title>

              </head>

              <body>

              <div id=”content”>This text will be styled.</div>
              <script>

              // Create a style element

              const styleElement = document.createElement(‘style );
              // Define your CSS rules

              const cssRules = `

              #content {
              color: blue;

              font-size: 20px;

              font-weight: bold;

             }
           `;

           // Set the CSS rules to the style element

           styleElement.innerHTML = cssRules;


                                                           170

                                     CITS : IT & ITES - कं  ूटर सॉ वेयर ए ीके शन - अ ास 44
   181   182   183   184   185   186   187   188   189   190   191