PDA

View Full Version : CSS Default Text In Cross Browsers



Markxxx
07-22-2006, 11:37 PM
I would like to know how to best do this.

For my website for I set the text for <h1> to be large

<h2> for text is set to <medium>

And everything else I set to small

The issue is I have been using columns cause I like the laylout. For the columns I used CSS

The isssue is the browsers. My colums look fine in Netscape, Firefox and K-Melon. But In IE the come out with barley a pixel between colums, and Opera's a complete mess

So I redid it so it's OK in opera, changing the spacing of the colums but then I found it looks horrible in Firefox (Mozilla browsers) but OK In IE and Opera is barely OK

I change the spacing of the columns and now it's readable in all 3 type of browsers Mozillla based, IE and Opera, but I find people have all sorts of "defaults" set and just because it looks good on my copy of IE someone downloads IE and it has default text as medium, so even though my <p> is set for small it's to big because the USER increased text size without knowing it.

I am sure you are seeing my issues. I thought about just giving a pixel size of 10 or 12, but I am told IE won't automatically scale like Mozilla based Firefox. Inother words I can't make the body font size 10px and say <h2> is 120%. I'm told that will work in Firefox but not IE.

So since you guys know the secrets how can I best use CSS. Ironically I can put the columns in tables and no matter what the size is it looks fine in all three browsers cause the positioning is fine but it just extends the column lower.

I know you can't use that. All my website pages are XHTML and run thru the validator till it reads no errors.

Thanks for you help

Twey
07-22-2006, 11:46 PM
Inother words I can't make the body font size 10px and say <h2> is 120%. I'm told that will work in Firefox but not IE. I think they're wrong. I can see no reason why that wouldn't work. IE has problems with ems when applied to font sizes, but not percentages used in any way insofar as I can tell. However, that doesn't mean you should use it. Specifying font sizes in pixels is a very bad idea, since they are unresizable and people who find them difficult to read have no recourse.
I find people have all sorts of "defaults" set and just because it looks good on my copy of IE someone downloads IE and it has default text as medium, so even though my <p> is set for small it's to big because the USER increased text size without knowing it.Yes. You should, therefore, base your paragraph size on those defaults. If you specify the paragraph size in ems, not only will the initial size be based on the browser's default text size, but the element should expand if the browser is unable to fit all the content into it.

Markxxx
07-23-2006, 04:23 PM
What you say makes sense, so what would you recommend for the best way to use CSS and columns. I like the way it kind of reads like a newspaper.

As you can see since everyone's browser is different if I use the CSS "float" to get 3 columns if one user has their browser defaulted different. I may set the three columns to look fine and float in "small" for <p> but on that browser it will be bigger (cause the user changed it or someone changed it) and the third column won't float right

I think that explains. Is there anyway to get around this without resorting to the "forbidden" table?

Twey
07-23-2006, 04:40 PM
As you can see since everyone's browser is different if I use the CSS "float" to get 3 columns if one user has their browser defaulted different. I may set the three columns to look fine and float in "small" for <p> but on that browser it will be bigger (cause the user changed it or someone changed it) and the third column won't float rightSet the widths to percentage values. With three columns, I recommend 30% width and 1.5% margin on each for a newspapery look, with a one-inch text-indent on the paragraphs.