Page 66 - Computer - 8
P. 66

CASCADING STYLE SHEET (CSS)

          CSS  statements  are  used  to  specify  rules  for  presentation  and  formatting  of  an  HTML  element.
          The general syntax of a CSS rule is:

                           selector {property1: value; property2: value; …}
          where, the selector identifies the element to which the rule applies, and

                  the property is the attribute of the element and a value is used to define a property.
          For example, to display the text of all h1 headings in red and centred horizontally on the web page, you

          could use the following CSS rule:

                                     h1 {color: red; text-align: center}
          CSS can be inserted in an HTML document in one of the following ways:
             •  Embedded (or Internal) CSS: An Embedded CSS is defined in the <head> section of an HTML

                document using the <style> element.
             •  Inline CSS: An Inline CSS is defined inside the <body> section of an HTML document.

             •  External CSS: An External CSS is a separate document and is specified in the HTML document in
                the <head> section.

          Let us now learn how to create lists and insert images on a web page.

          WORKING WITH LISTS
          A List is made up of a number of related items written consecutively, such

          as the names of students in a class or a shopping list. A list can be used on a
          web page to display information in an easy-to-read and eye-catching format.

          List Item Tag <li> … </li>

          The List Item tag <li> is used to define each item of a list. It is a container tag and is closed by the
          </li> tag.


            Lab Activity 1                                                                         Experiential Learning
           To create a simple list.
            1.  Open Notepad and create the HTML document as shown below.

                 <!DOCTYPE html>                        2.  Open the HTML document in Microsoft Edge.
                 <html>
                 <head> <title> Machine Learning </title>
                 </head>
                 <body>
                 <h2> Types of Machine Learning </h2>
                 <p> Machine Learning approaches can be
                 classified as follows: </p>
                 <li> Supervised Learning </li>
                 <li> Unsupervised Learning </li>
                 <li> Semi-supervised Learning </li>
                 <li> Reinforcement Learning </li>
                 </body>
                 </html>


               64
   61   62   63   64   65   66   67   68   69   70   71