Page 194 - Webapplication11_C11_Flipbook
P. 194

Ð ÐPages load faster: You don't have to write HTML tag attributes every time you use CSS. Simply write a single CSS
                 rule for a tag and apply it to all instances of that tag. As a result, fewer lines of code mean faster download times.
               ÐSimple to maintain: To make a global change, simply alter the style, and all elements across all web pages will be
              Ð
                 instantly updated.

              Ð ÐSuperior styles to HTML: CSS offers a lot larger set of attributes than HTML, therefore you may give your HTML page
                 a far better look when compared to HTML attributes.

              Ð ÐNumerous device compatibility: Style sheets make it possible to optimise content for multiple devices. Different
                 versions of a website can be displayed for handheld devices such as PDAs and mobile phones, as well as for printing,
                 using the same HTML document.

              Ð ÐGlobal  web standards:  HTML  attributes  have  been  deprecated  by  web  standards  around  the  world,  and  it  is
                 recommended that you use CSS instead. It's a good idea to start adding CSS into all HTML pages to make them
                 compatible with future browsers.

              Disadvantages of CSS

              Some of the disadvantages of CSS are as follows:

              Ð ÐMultiple browsers checking: When it comes to CSS, what works in one browser may not function in another. The
                 web developers must test the program's compatibility by executing it in multiple browsers.

              Ð ÐBrowser compatibility: CSS works differently on different web browsers. Edge and Opera supports CSS as different logic.
              Ð ÐComplicated  for  non-developers:  For  non-developers  and  newbies,  the  world  of  programming  languages  is
                 confusing. CSS levels, such as CSS, CSS 2, and CSS 3, can be rather confusing.

                  Do You Know?


                  Ð  CSS was created in 1994 by Hkon Wium Lie while working at CERN with Tim Berners-Lee. The goal of CSS was to
                    create a system for styling the information that was being presented (which was completely non-existent at the
                    time) and to separate the styling process from the content production process.
                  Ð  We can make better backgrounds with CSS! As a result, boring and unchanging backgrounds are no longer required.
                    Previously, additional programming and scripting were required, but CSS3 now makes this possible.



                 2.17 LINKING STYLE SHEET

              In an HTML document, you can link CSS in three different ways which are as follows:

              Ð ÐExternal Style Sheet: Define style sheet rules in a separate.css file and then use the HTML link tag to include that
                 file in your HTML content.

              Ð ÐInternal Style Sheet: Using the <style> tag, define style sheet rules in the HTML document's header section.
              Ð ÐInline Style Sheet: Using the style attribute, define style sheet rules inline alongside HTML components.
              Let’s take a look at each of the three scenarios one by one using appropriate examples.
              External Style Sheet

              An external style sheet is used to apply a rule to several pages. It is a distinct CSS file that may be accessed by linking
              to it from the webpage's head section. The stylesheet can be accessed from several webpages using the same link.
              The link to an external style sheet is included in the page’s head section:

              <head>
              <link rel="stylesheet" type="text/css" href="style1.css">
              </head>

                192     Touchpad Web Applications-XI
   189   190   191   192   193   194   195   196   197   198   199