Page 116 - DCAP408_WEB_PROGRAMMING
P. 116

Web Programming




                    Notes          4.4.13 Units of Measure

                                   CSS is used to render information to a device. These devices exist in the real world and have
                                   dimensions and capabilities that are measurable. Therefore, CSS provides a way for document
                                   content to explicitly specify how it will be mapped to  a physical device. If a property value
                                   contains an illegal unit measure, the entire style rule should be ignored.

                                                               UNITS of MEASUREMENT
                                       %                      Percentage
                                       cm                     Centimeter
                                       em                     1em = current font size of current element
                                       ex                     lex = 1/2 current size of current element
                                       in                     Inch
                                       mm                     Millimeter
                                       pc                     pica (= 12 points)
                                       pt                     point (= 1/72 inch)
                                       Px                     Pixel
                                                                     COLORS
                                       Color name             Red, blue, green, dark green
                                       rgb(x,y,z)             Red = rgb (255,0,0)
                                       rgb(x%,y%,z%)          Red = rgb( 100%,0,0)
                                       #rrggbb                Red = #00000 (or shorthand =#f00)


                                   Self Assessment

                                   Fill in the blanks:
                                   4.  Every property has its own syntax and ………………… on the values it accepts.

                                   5.  The ………………… within a font usually all share common characteristics such as size,
                                       style, and design.

                                   6.  An outline does not affect the position or size of the ………………… box.
                                   7.  Generated ………………… includes aural rendering as  well; auditory  icons can offer
                                       powerful usability enhancements for a listener.
                                   8.  An  element’s  rendering  box  consists  primarily  of  an  element’s  content  at  the
                                       …………………

                                   9.  CSS is used to render information to a …………………

                                   4.5 Different Ways to Implement CSS

                                   There are four (4) different ways to use CSS in your Web pages: Inline CSS, Embedded CSS,
                                   Linked CSS and Importing CSS. They all provide advantages over normal HTML.
                                   4.5.1 Inline CSS


                                   This is the HTML specific style inclusion method, in which style information is directly attached
                                   to the HTML elements, they affect. A universal element attribute, called STYLE, may be specified
                                   for an HTML element, taking as a value one or more style Declarations.



          110                               LOVELY PROFESSIONAL UNIVERSITY
   111   112   113   114   115   116   117   118   119   120   121