| Author |
how do I implement font size using ems so that they can resize in ie 6 on a pc
|
|
| newspost2000@yahoo.com 2006-04-19, 6:44 pm |
| http://www.htmldog.com/articles/elasticdesign/demo/
I found this wonderful site the demonstrates how you cannnot resize
text formated using styles in ie 6 if you specify font size using pt
units but you can if you specify font size using em. So guess what...
I tried it and it on my site did not work!
All I did was the following...
I changed my font propery from this
..body { font-size: 10pt }
To this
..body { font-size: 1.2ems }
Keeping in mind that I am not referencing a doctype dtd, I don't know
if this will make a difference or not. All I have for the first tag in
the code is this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN">
Now I am not entirely sure if I am going to switch measurement units
within my styles to accomodate resizing. I first want to get resizing
to work in ie before I make that decision. I did have my fonts set to
keywords... ie: small, medium and large but there was a descrepency on
the the size that these fonts got rendered in the different browsers
that can get rememied via a doctype dtd that will take ie out of quirks
mode but I want more control than 7 keywords to describe font size.
Big question... how do I implement font size using ems so that they can
resize in ie 6 on a pc?
Please helsp
| |
| frederick@southernskies.co.uk 2006-04-19, 6:44 pm |
| newspost2000@yahoo.com wrote:
> I changed my font propery from this
>
> .body { font-size: 10pt }
>
> To this
>
> .body { font-size: 1.2ems }
There's no such unit as "ems". "2em" + "2em" = "4em"!
--
AGw.
| |
| Beauregard T. Shagnasty 2006-04-19, 6:44 pm |
| newspost2000@yahoo.com wrote:
> .body { font-size: 1.2ems }
"em" rather than "ems" as mentioned.
Do consider using just one of them, rather than 1.2 of them though. Or
better yet: use percentages for font sizes, thus eliminating the bug in
some versions of IE where even "em" resizes incorrectly.
body { font-size: 100%; }
Oh, and no dot before 'body'. (Unless you've defined a specific class,
in which case the word 'body' is not appropriate.)
1em or 100% is everyone's default size.
--
-bts
-Warning: I brake for lawn deer
| |
| frederick@southernskies.co.uk 2006-04-19, 6:44 pm |
| Beauregard T. Shagnasty wrote:
> body { font-size: 100%; }
[snip]
> 1em or 100% is everyone's default size.
Doesn't explicitly defining a font-size of 100% for the body gets round
some of the rendering oddities of IE when dealing with the keywords
(and maybe also measurement in ems)?
--
AGw.
| |
| newspost2000@yahoo.com 2006-04-19, 6:44 pm |
| Clueless!? Huh, that's not nice.
Question... Why did you include this in your post?
| Content-Type: text/html; charset=UTF-8
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
What was it that you were trying to highlight?
Also, what do you mean "Do not specify a font size for your main text!
"
How does one specify a font size in their main text?
| |
| Beauregard T. Shagnasty 2006-04-19, 6:44 pm |
| frederick@southernskies.co.uk wrote:
> Beauregard T. Shagnasty wrote:
>
> [snip]
>
>
> Doesn't explicitly defining a font-size of 100% for the body gets
> round some of the rendering oddities of IE when dealing with the
> keywords (and maybe also measurement in ems)?
It can. As I seem to remember, it is certain versions/patches of IE that
have the 'em' problem. With a font set at 1em (or some value), and if
the visitor increased from, for example, Text Size: Smaller to say
Medium, the display *doubles* in size. Using percentages instead of em
negates that bug.
--
-bts
-Warning: I brake for lawn deer
| |
| Beauregard T. Shagnasty 2006-04-19, 6:44 pm |
| newspost2000@yahoo.com wrote:
> Also, what do you mean "Do not specify a font size for your main text!
If a size is not declared, the visitor still gets his preferred default
size. However, if you do declare a size, you reinforce your committment.
<g>
> How does one specify a font size in their main text?
body, td { font-size: 100%; }
h1 { font-size: 150%; }
h2 { font-size: 130%; }
h3 { font-size: 120%; }
.legalese, .footer { font-size: 85%; }
Very few other sizing styles should be needed for most web pages. All
divs, paragraphs, lists will inherit from body.
[Some browsers do not do inheritance from body into tables, hence the td
show in my little sample.]
--
-bts
-Warning: I brake for lawn deer
| |
| David Dorward 2006-04-19, 6:44 pm |
| newspost2000@yahoo.com wrote:
> Clueless!? Huh, that's not nice.
>
> Question... Why did you include this in your post?
> | Content-Type: text/html; charset=UTF-8
> | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
>
> What was it that you were trying to highlight?
The text/html content-type is for HTML documents and XHTML 1.0 documents
which follow the (very fuzzy and dependent on a browser bug) Appendix C
guidelines for HTML compatibility.
XHTML 1.1 is not covered by this and "SHOULD NOT" be served as text/html.
> Also, what do you mean "Do not specify a font size for your main text!"
If I were to say: body { font-size: 120%; } then I would be specifying a
font size for the main text. If I were to not do that, then I wouldn't (and
would thus be leaving it at the font size specified in the preferences of
the user's browser - which the user has control over).
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
| |
| frederick@southernskies.co.uk 2006-04-19, 6:44 pm |
| Andreas Prilop wrote:
> On 19 Apr 2006 newspost2000@yahoo.com wrote:
>
>
> | Content-Type: text/html; charset=UTF-8
> | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
>
> Clueless!
Interesting. I'm getting application/xhtml+xml with Firefox.
>
> Do not specify a font size for your main text!
I would amend that to:
Do not specify a *fixed* font size for your main text!
--
AGw.
| |
| frederick@southernskies.co.uk 2006-04-19, 6:44 pm |
| Johannes Koch wrote:
> frederick@southernskies.co.uk wrote:
>
>
> And I'm getting application/xhtml+xml, too, even when I prefer text/html
> (Accept: application/xhtml+xml;q=0.9, text/html;q=1.0). Even more clueless.
Further investigation reveals that Firefox is being given XHTML 1.1,
but IE is being given what claims to be 1.0 Strict.
What a load of old codswallop!
--
AGw.
|
|
|
|
| Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |