Page 36 - LoudOffice_Guide-to-HTML_Part-II_Advanced.PDF
P. 36

2.  Embedded style sheets
                   3.  Linked style sheets


               Microsoft Internet Explorer (3.0 and above) and Netscape Communicator 4.0 provide the
               most extensive support for cascading style sheets at this time, with Internet Explorer being
               by far superior in it’s implementation of CSS.

               The specifications for the evolving CSS standard can be found at the W3C Consortium's Web
               page at http://www.w3.org/Style/CSS/. You will need to use the CSS standard section of
               the site or some other CSS reference to see all of the details for writing style commands.
               This chapter will focus on showing you how to apply style commands to your documents.




               Inline Styles
               The first method of adding Style to a web page is to use the STYLE attribute of a selected
               element. To use an inline style, you add a STYLE attribute to a specific instance of an
               element, using the following syntax:


                    < E L E M E N T  S T Y L E = " p r o p e r t y : v a l u e ;  p r o p e r t y : v a l u e ;  … " > < / E L E M E N T >
                                                                        n a v y . < / B >  This text would appear
               For example: < B   S T Y L E = " c o l o r : n a v y ; " > I n  t h e
               bold and navy in a browser.
               An inline style may be applied to any HTML element and modifies only the specific instance
               (occurrence in the document) of the element to which you apply it.

               Below is an example of an inline CSS element and it’s output:


                           < h t m l >

                           < h e a d >
                           < t i t l e > Q u i c k  E x a m p l e  o f  I n l i n e  C S S < / t i t l e >
                           < / h e a d >

                           < b o d y >
                           < h 1  S T Y L E = " c o l o r :  # 8 0 0 0 0 0 ;  f o n t - s i z e :  2 4 p t ;  f o n t -
                           w e i g h t :  b o l d " > F u n  w i t h  C S S < / h 1 >
                           < p > I  c h a n g e d  t h e  l o o k  o f  t h e  t a g  a b o v e  u s i n g
                           C S S . & n b s p ;  N o t i c e  t h a t  o n l y  t h e  H 1
                           t a g  a b o v e  w a s  e f f e c t e d ,  n o t  t h e  e n t i r e
                           d o c u m e n t . < / p >
                           < / b o d y >

                           < / h t m l >












               LoudOffice.com Guide to HTML – Part II                                               Page 36
   31   32   33   34   35   36   37   38   39   40   41