14 replies [Last post]
bazmanblue
Offline
Regular
Last seen: 13 years 46 weeks ago
Joined: 2006-11-03
Posts: 12
Points: 0

hello there im trying to find out how some websites
are able to stop the user changing the font size. can anyone tell me as im trying to center all my div tags in the screen but dont want the letters pushing off the page. thanks in advance
baz

ClevaTreva
ClevaTreva's picture
Offline
Guru
A hilly place, UK
Last seen: 3 years 48 weeks ago
A hilly place, UK
Joined: 2004-02-05
Posts: 2902
Points: 0

Generally, you can't. Why

Generally, you can't. Why would you want to? It breaks all accessibility rules (which can be enforceable by some quite hefty fines depending on where in the world you are, not that I suspect anybody has yet been slapped that way).

IE will honor pt sizes but the other browsers won't. You could make an image of your text, if it were a button.

But, and just think on this, what if you were visually impaired and needed to increase the font size by a few sizes? Wouldn't you be miffed?

bazmanblue
Offline
Regular
Last seen: 13 years 46 weeks ago
Joined: 2006-11-03
Posts: 12
Points: 0

well im getting hacked off

well im getting hacked off trying to create a website and when viweing in firefox seeing the text run off the screen when increasing the size of the font. is there anyway to stop this in the div tags. ive tried setting them as absolute and fixed but when the text always extends the size?

bazmanblue
Offline
Regular
Last seen: 13 years 46 weeks ago
Joined: 2006-11-03
Posts: 12
Points: 0

If you check the orange

If you check the orange homepage they are able to stop the font size changing?

thepineapplehead
thepineapplehead's picture
Offline
Moderator
Last seen: 23 weeks 4 days ago
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9683
Points: 819

Do you actually understand

Do you actually understand the basics of using CSS to lay out websites?

Can we see the site you're having trouble with?

Don't think that because text is breaking your layout you need to force the text to stay the same size. Instead, think about how you can change your code to accommodate the changes.

Verschwindende wrote:
  • CSS doesn't make pies

thepineapplehead
thepineapplehead's picture
Offline
Moderator
Last seen: 23 weeks 4 days ago
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9683
Points: 819

bazmanblue wrote:If you

bazmanblue wrote:
If you check the orange homepage they are able to stop the font size changing?

No they're not, I can quite easily change the font size in firefox and it breaks their layout.

Verschwindende wrote:
  • CSS doesn't make pies

ClevaTreva
ClevaTreva's picture
Offline
Guru
A hilly place, UK
Last seen: 3 years 48 weeks ago
A hilly place, UK
Joined: 2004-02-05
Posts: 2902
Points: 0

bazmanblue wrote:If you

bazmanblue wrote:
If you check the orange homepage they are able to stop the font size changing?

The Orange uk website has 503 errors on validation. Nuff said.

bazmanblue
Offline
Regular
Last seen: 13 years 46 weeks ago
Joined: 2006-11-03
Posts: 12
Points: 0

cool i cant seem to do it

cool i cant seem to do it internet explorer. so how would you change the boder so that the text moves withen the browser changes size?

bazmanblue
Offline
Regular
Last seen: 13 years 46 weeks ago
Joined: 2006-11-03
Posts: 12
Points: 0

ah ha i see. yer it looks

ah ha i see. yer it looks rubbish in firefox! if i use tables it seems to work fine but i really want to get the smae effect with css

bazmanblue
Offline
Regular
Last seen: 13 years 46 weeks ago
Joined: 2006-11-03
Posts: 12
Points: 0

take my site for example at

take my site for example at freeadsgalore.me.uk. nothing special i know but the text will not float off the page when increased using tables. Im trying hard to adapt this to css? if anyone can help i would be greatly apreciative

thepineapplehead
thepineapplehead's picture
Offline
Moderator
Last seen: 23 weeks 4 days ago
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9683
Points: 819

Owch. Aside from the design

Owch.

Aside from the design (you seem to be stuck in the 1990s), you need to read up on some basic CSS and HTML tutorials, to learn how to mark up your content semantically, then use CSS for styling.

Verschwindende wrote:
  • CSS doesn't make pies

bazmanblue
Offline
Regular
Last seen: 13 years 46 weeks ago
Joined: 2006-11-03
Posts: 12
Points: 0

im not sure what you mean by

im not sure what you mean by your example but am reading up on it
thanks

thepineapplehead
thepineapplehead's picture
Offline
Moderator
Last seen: 23 weeks 4 days ago
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9683
Points: 819

Oh don't mind that code,

Oh don't mind that code, it's my forum "signature", nothing to do with this topic Wink

Verschwindende wrote:
  • CSS doesn't make pies

bazmanblue
Offline
Regular
Last seen: 13 years 46 weeks ago
Joined: 2006-11-03
Posts: 12
Points: 0

i dont see many sites that

i dont see many sites that can handle the text mods on firefox. im just gona rely on people not changing it to much

thepineapplehead
thepineapplehead's picture
Offline
Moderator
Last seen: 23 weeks 4 days ago
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9683
Points: 819

bazmanblue wrote:i dont see

bazmanblue wrote:
i dont see many sites that can handle the text mods on firefox. im just gona rely on people not changing it to much

Well if that's your attitude, then prepare to lose a LOT of traffic to your site.

It's really not that difficult to redo your layout to allow for changes in font-sizes, but to be honest I'd redesign your site anyway.

Verschwindende wrote:
  • CSS doesn't make pies