Page 209 - Webapplication11_C11_Flipbook
P. 209

2.  Type the following code and see the output.
                           <!DOCTYPE html>
                           <html>
                           <head>
                           <style type="text/css">
                           p {font-family: Courier;background-color: yellow;}
                           h2 {background-color: grey;}
                           </style>
                           </head>
                           <body>
                           <h2>
                           Elephant seals are enormous, earless, ocean-going seals
                           </h2>
                           <p>
                            By the end of the 19th century, both the northern elephant seal and
                           the southern elephant
                            seal had been driven to extinction for oil, but their numbers have
                           since recovered
                           </p>
                           </body>
                           </html>




                   2.28 HANDLING IMAGES USING CSS

                 Any  webpage  would  be  incomplete  without  images.  Although  it  is  not  suggested  to  include  a  large  number  of
                 photographs, it is nevertheless necessary to include high-quality images wherever they are required. CSS is useful for
                 controlling image presentation. CSS can be used to set the following properties:

                          Property                                             Purpose

                  border                     Used to define the width of an image border.

                  Height                     Used to define the height of an image.

                  width                      Used to define the width of an image.

                  -moz-opacity               Used to define the opacity of an image.

                 Example:

                 <html>
                 <head>

                 <title>CSS Images</title>
                 </head>
                 <body>
                 <h1 style="color: green">Working with Images in CSS</h1>

                                                                                Website Building Using HTML and CSS  207
   204   205   206   207   208   209   210   211   212   213   214