• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 7. Controls > Adding Font Size Controls

Adding Font Size Controls

Every visitor coming to your Web site has different needs. One of those needs is to read text on your page as comfortably as possible. Unfortunately, a comfortable font size for one visitor may be too small or too large for another. You can overcome this by allowing visitors to set the font size that is best for them.

In this example, we will provide four font-size buttons: small, default, medium, and large. The visitor’s font-size preference will be recorded in a cookie, then used when the visitor goes to any page in the Web site or returns later. The default size (the second button) will be used on the first visit to the Web site and if they don’t specify a custom font size. To implement this, we will set up four different external style files. The first (default.css) will contain all of the styles used for the site plus the default font size. The other three CSS files (small.css, medium.css, and large.css) will contain only font-size definitions.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint