Wrox Programmer Forums
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 16th, 2004, 02:56 AM
Authorized User
 
Join Date: Aug 2004
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default Styles problem

Hello,

  I designed pages in dreamweaver mx 2004. I used template. In my win 2000 server/prof, XP its displaying well. But in win me its displaying in large fonts. Why it is happening like this.
I checked the resolution also. Its 800x600 in all the systems.
can u suggest me the sollution?



 
Old November 16th, 2004, 03:19 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Because the dpi is different on the two machines or because you have set the font-size differently in the two browsers?

(o<
//\ =^..^=
 
Old November 16th, 2004, 09:40 PM
Authorized User
 
Join Date: Aug 2004
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default


Hello,

  I checked the font size and dpi. Both are same with small fonts and normal(96 dpi). But output is different.

What could be the problem?

 
Old November 16th, 2004, 10:14 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Can you please provide a link to this page, that we might suggest a more cross-platform or cross-browser way to code it?

-Snib
Where will you be in 100 years?
Try new FreshView 0.2!
 
Old November 17th, 2004, 12:46 AM
Authorized User
 
Join Date: Aug 2004
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello,

  This is the link

http://m.1asphost.com/tsimsha/montex/default.htm




 
Old November 17th, 2004, 08:15 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

I beleive it is your use of the small keyword for the font-size property. I know for certain that there are inconsistencies with the absolute font size keywords between browsers, and between browser versions.

To correct most of the inconsistency you could specify a base font size on the <body> element. For instance,

body {
    font-size: 16px;
}

And this will give IE, Gecko, Opera, etc, some common starting ground. 16px is the default size in Gecko, BTW, whereas in IE I think its 12pt.

HTH!

Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
 
Old November 17th, 2004, 08:16 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

That base size corrects inconsistency for the use of percentage measuments, BTW, there's nothing to be done about absolute keywords. (Sorry typing in a hurry).



Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
 
Old November 17th, 2004, 08:28 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I think you mean em. :)
A font-size for body corrects IE's resizing problem with em. It doesn't have to be an absolute size either. That kind of kills the usefulness of relative sizes.
% doesn't have any bugs (well, maybe in IE3 or other ancient browsers).

(o<
//\ =^..^=
 
Old November 17th, 2004, 09:30 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

> I think you mean em.
> A font-size for body corrects IE's resizing problem with em. It
> doesn't have to be an absolute size either. That kind of kills the
> usefulness of relative sizes.

No, I meant percentages, I didn't see any ems in the source. Percentage sizes don't have any bugs that I know of, per say. But when using percentage sizing you need a common starting point, since each percentage size is based on the font size of the parent/containing block. If there is no font size specified for the <body> or <html> elements, and all the children use percentage sizing, then it goes to the UAs default and those percentages are based on that, thus creating some inconsistency. When I loaded up this page there was a noticeable size difference between Firefox and IE which led me to that conclusion.

Personally I wouldn't worry that much about it, a good design should scale with the user's font preferences, IMHO (using percentage/em fonts and em measurements for everything else will create this type of design). But if it is bothersome specifying a font size on the <body> or <html> elements should fix it, e.g. a pixel font size (I'd avoid points, and other absolute units all together).

Absolute keyword sizing, OTOH, which I noticed at least once in the source of this project changed at some point in IE's evolution but I can't remember between which versions, and there's a new sizing algorithm for that in CSS 2.1. So CSS 1, 2 and 2.1 each specify different scaling factors for absolute font size keywords, so there's sure to be some inconsitency with older browsers there as well. (Just assuming it's an older IE on Win ME).

I saw one error in the CSS as well:
font-family: 'arial,verdana,helvetica sans-serif';

This isn't valid, no quotes are required and you're missing a comma.

Sorry for the confusion I was typing in a hurry!


Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
 
Old November 17th, 2004, 09:58 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Oh,I misunderstood you then. Sorry.
Still, the beauty of % and em is that they ultimately respect the user-chosen size. What's the point of using them at if one "pixelizes" them?

I assumed tsimsha used the same browser on both machines and that all the text was differently sized. Maybe time to tell us the whole story, eh? :)




(o<
//\ =^..^=





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with styles toddw607 Javascript 3 June 3rd, 2008 12:37 PM
problem with order of application of styles hertendreef ASP.NET 2.0 Basics 0 May 15th, 2007 03:28 AM
Styles tsimsha HTML Code Clinic 2 February 9th, 2006 11:32 AM
XP Visual Styles problem katsarosj VB.NET 2 April 14th, 2005 11:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.