Jump to content

Fixing Font sizes with CSS


miles5150

Recommended Posts

Hi everyone, I have just joined and therefore this is my first thread.I'm Justin from Bournemouth in the UK, I have just passed my final CIW exam and am now a "Master CIW Designer" though I don't feel like it, lol.Basically, I'm putting together my portfolio site and am trying to create it in Strict format entirely with CSS.One of the things I want to do is offer the visitor an opportunity to choose a different font size with an extra CSS file but I also want to stop the browser from being used to change the font size of the menu's and heading text. In IE this is fine because I have used absolute font sizes for these (in pixels), but in FF for example, the increase text size menu option still increases the absolute font sizes on my web page.So without anymore waffle, can I somehow specify that a text size is fixed at its pixel chosen size?Any help would be appreciated.Best wishesJustin :)[/font]

Link to comment
Share on other sites

found this reply to the same question on another forum

using 0 line-height and a top-padding of half the intended line-height (in pixels). But that won't show correctly in Opera, because of a bug.
There really isn't anyway to stop it.
Link to comment
Share on other sites

No he means... in IE if you set font-size with px then even whent he users changes the browser text size your content won't change. But in Firefox no matter what font unit you use the user can always resize the text.

Link to comment
Share on other sites

Yes, basically my main content on the page is in em's so that it can change size in any browser. But I do not want to lose the look and feel of my headings or my navigation menu's, so these are in pixel sizes as they are a good size anyway I think.However, Firefox still increases the text size even when stated in pixels :)Rather a pain I think.I am adding a link at the top of my page which will invoke a different style sheet with larger text and hopefully most users will use this before the browser menu. But I was hoping I could somehow MAKE the text stay one size permanently.Thanks for your thoughts so far.Best wishesJustin

Link to comment
Share on other sites

Accessibility issues appear when you stop people from being able to alter the text to suit themselves. Some elderly or vision impaired users won't like it. In some countries, it violates their rights and is mandated by laws that web-sites must be accessible. I am not totally familiar with them, but I think in the USA, certain sites which deal with the Government, for example, must be built to allow for accessibility or there are repercussions on the company's status with respect to being awarded Government contracts and such.In the meantime, have you tried declaring the css as "!important"? That affects the cascade and changes the priority of the attributes declared !important. I believe the author's sheet can overrule the user's sheet if so declared, but confirm it at the w3c site if you want to, or simply give it a whirl to see if that works.

Link to comment
Share on other sites

Accessibility issues appear when you stop people from being able to alter the text to suit themselves. Some elderly or vision impaired users won't like it. In some countries, it violates their rights and is mandated by laws that web-sites must be accessible. I am not totally familiar with them, but I think in the USA, certain sites which deal with the Government, for example, must be built to allow for accessibility or there are repercussions on the company's status with respect to being awarded Government contracts and such.In the meantime, have you tried declaring the css as "!important"? That affects the cascade and changes the priority of the attributes declared !important. I believe the author's sheet can overrule the user's sheet if so declared, but confirm it at the w3c site if you want to, or simply give it a whirl to see if that works.
I know all about accessibility issues, this was a major part of my "Master CIW Designer" course. As stated above I am only wanting to fix font sizes for the large headings and the goodly sized clear navigation. My problem is with Netscape and Firefox which still enlarge the text even when specified in absolute sizes. I don't really want to be using images for Headings and links as this is rubbish semantically. The main content is specified in em's so this will still be changeable for accessability issues and I am linking a second style sheet so that users can click this instead of using the browser menu for larger text.All I want to do, is make sure that headings and menu's stay as they, so that my layout doesn't fall to pieces the moment someone increases the text size.How does important work then? May it be that I have to use Javascript instead of CSS to disable a browser menu option (not really a route I want to take).RegardsJustin
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...