Page 190 - CA_165_V2.0_Flipbook
P. 190

CSS design can also be applied into an HTML document by using <STYLE> tag. This tag should be placed
                           inside the <HEAD>...</HEAD> tags. An internal style sheet is commonly used when one web page has a
                           unique style.
                          An inline style is used to apply a unique style for a single element. The syntax to use inline style is as follows:
                              <element style = "...style rules....">
                      3.   Discuss the different CSS outline properties.
                    Ans.   An outline is a line that is drawn around elements, to make the element "stand out". Outline differs from
                           borders as it is drawn outside the element's border, and may overlap other content. CSS has the following
                           outline properties:
                            'outline-width' property is used to set the width of the outline.
                            'outline-style' property is used to set the style of line for the outline and can have values like Dotted,
                              Dashed, Solid, Double, Groove, Ridge, Inset, Outset, None, Hidden, etc.
                            'outline-color' property is used to set the colour of the outline.
                             'outline-offset' property is used to add space between an outline and the edge/border of an element.
                              The space between an element and its outline is transparent.
                            'outline' property is used to set the above three properties in a single statement.
                      4.   Explain the CSS font properties that can be used to stylize the text.
                    Ans.   CSS font property is used to define the font, size and the style of the text. Some of the commonly used
                           font properties are font-family, font-style, font-size, etc.
                            The font-family property is used to change the face of the font.
                             The 'font-style' property is mostly used to make the text 'italic'. Other types of font styles are normal
                              and oblique.
                            The 'font-size' property is used to increase or decrease the size of a font.
                              <P STYLE="font-family:verdana; font-style:italic; font-size: 12px;">
                              The space between an element and its outline is transparent.
                              </P>
                      5.   Write the CSS code for following:
                          i.  A paragraph aligned to the right side with left and right margin of 200 px.
                          ii.  A paragraph with font style jokerman , font size 10 px.
                          iii.  An <h1> tag with border specifications- size 8px, color-blue and style dotted.
                          iv.   Heading of level 1 should have border color blue the border-type to be double. The thickness of the
                              border to be 4px and the background color to be green.
                          v.  The Paragraph font colour should be brown and the background color should be crimson.
                    Ans.   i.  <P STYLE="margin-left:200px; margin-right:200px; text-align:right">
                          ii.  P{font-family:jokerman;font-size:10px;}
                          iii.  H1{border-width:8px; border-color:blue; border-style:dotted}
                          iv.  H1{background-colour:green;border-style:solid;border-color:blue;border-width:4px;}
                          v.  P{color:brown;background-color:crimson;}

                  C.  Application Based Questions.
                      1.   Raghav wants to change the look of an entire website by updating just one CSS file. How can he do so?
                    Ans.   Web page must include a reference to the external style sheet file within a <link> element inside the
                          <HEAD> section.
                      2.   Nisha wants to individually customise all the four sides of a border to have different colours in each side.
                          What CSS property must be applied for the same?
                    Ans.   Border-Color


                   188   Touchpad Computer Applications-X
   185   186   187   188   189   190   191   192   193   194   195