CSS text size

This is a discussion on "CSS text size" within the Web Page Design section. This forum, and the thread "CSS text size are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Sep 4th, 2006, 20:05
New Member
Join Date: Sep 2006
Location: durham
Age: 25
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
CSS text size

Could anyone help me with problem! i havent used CSS that much before! the problem is that i want to allow users to change the size of the text within my website but i having problems doing this from the browser (the text stays the default size i have set) !! I don't want to use javascript is there any code that i could use that lets the user click an image to change the text size (i have seen this on many websites and would like to do it on mine) ! Any help in this matter would be greatful.

Cheers Andy
Reply With Quote

  #2 (permalink)  
Old Sep 4th, 2006, 23:09
Junior Member
Join Date: Aug 2006
Location: Jordan
Age: 22
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS text size

Quote:
Originally Posted by agibbs1983 View Post
(i have seen this on many websites and would like to do it on mine)
Can you list some of the site you have seen this option on.
That will help more in understanding what you want!
Reply With Quote
  #3 (permalink)  
Old Sep 5th, 2006, 02:04
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS text size

The problem is that some browsers (most notably IE) won't let the user change the text size if it's set to an absolute size. Using a 12px for a font size, for instance. There is a way to get around this, however. Instead of using px or other measurements, use em.

font-size: 1em;

As the em measurement is relavent, you're going to want to reduce it globally in your CSS file so the numbers are easier to use. Add this to the body tag:

Code: Select all
body {
    font-size: 70%;
}
Here are some examples of it in use:

Code: Select all
h1 {
    font-size: 3em;
}
h2 {
    font-size: 1.8em;
}
h3 {
    font-size: 1.2em;
}
p {
    font-size: 1em;
}
Reply With Quote
  #4 (permalink)  
Old Sep 5th, 2006, 17:30
New Member
Join Date: Sep 2006
Location: durham
Age: 25
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS text size

Cheers for all the help! Here is a couple of site address i have seen this on,

http://www.dsgiplc.com, (located in the top right corner of website)

hope you know what i mean!!
Reply With Quote
  #5 (permalink)  
Old Sep 5th, 2006, 17:51
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS text size

Ah. That's not really a CSS thing. You need JavaScript to effect the changes. The first Google result for "text size changer"...

http://www.dyn-web.com/dhtml/sizefont/index.php
Reply With Quote
Reply

Tags
css, text, size

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Text Size crackafaza Website Planning 7 Aug 6th, 2007 14:18
Changing text-size ??? j4mes_bond25 JavaScript Forum 1 Jun 12th, 2006 09:26
text size problems Ice288 Web Page Design 3 Jul 18th, 2005 11:05
Text Size MajorTom Web Page Design 8 Jun 14th, 2005 12:08
text size dannygoor Web Page Design 6 Jan 9th, 2004 16:24


All times are GMT. The time now is 00:56.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43