The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Increasing Font Size With A Button

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #32187

    Hey guys, so I’m doing a website for a client that’s affiliated with the government so I need to pay special attention to W3C Accessibility Guidelines, one thing that the client has asked is for is a button on the webpage that will mimic pressing ctrl + in a browser to increase font size. Is this possible?


    Text resizers are everywhere. Check out the results:

    Chris Coyier

    What I’d probably do is use JavaScript, and class names on the html element. large-text-size, medium-text-size, etc. Then use those class names to set font sizes where you need to, as well as adjust whatever else you need to. Using class names at that hight of an element gives you lots of control.


    @zackw – If you roll with the implementation that @chriscoyier suggested, you may also want to consider addressing other visual impairments, like color blindness, which can effect the perception of contrast.

    Veerle Pieters has implemented a ‘high contrast’ mode button on her site’s articles which switches to a high-contrast stylesheet. It changes the background to white, most text to black, and it also gives images a 1px black border.

    Her site is the only one that I’ve ever seen this implemented on, and I’ve always thought it was incredibly thoughtful (like most things Veerle designs).

    The button can be seen, and used, on this page – just below the title, but before the first paragraph;


    As always thanks for the replies, great knowledge and fast, color contrast was taken into account in the creative work but I still may apply your suggestion @aaronsilber. I will re-post once my Jquery guy takes care of the problem to let you know how it went and exactly what code we used, thanks


    hey guys so I didn’t properly word my question the first time, so let me try it again. It turns out we don’t just want to increase the font size but actually zoom in as if we were pressing “ctrl +”. The client feels that many people don’t know this shortcut so they want a button that does the same thing, is this possible?

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.