Welcome to WebmasterWorld Guest from 54.160.177.33

Forum Moderators: not2easy

Message Too Old, No Replies

Opera Font Sizes in CSS

     
11:26 am on Aug 1, 2002 (gmt 0)

Preferred Member

10+ Year Member

joined:Mar 27, 2001
posts:392
votes: 0


I have just downloaded Opera to see what its users get when they visit my site. To my horror all of the fonts on my pages are absolutely huge compared to what is seen with IE.

the style is set in a CSS with the following

.Std { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size:"xx-small" ;}

while I acknowledge that "xx-small" is open to interpretation the font that is shown in Opera must be 14 - 16pt.

suggestions welcomed....

11:31 am on Aug 1, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 6, 2001
posts:917
votes: 0


don't set a standard font size...allow users to see the bulk of text at their default size and you have no worries about the differences between platforms at all
11:38 am on Aug 1, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 4, 2002
posts:5044
votes: 0


I don't think this is a xx-small issue, try this and tell me what you see:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">
<?xml version="1.0" encoding="iso-8859-1"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Font test</title>
<style type="text/css">
h1 {
font: 2em arial, verdana;
}
.keywords {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: xx-small;
}
</style>
</head>
<body>
<h1>Opera Font test</h1>

<p class="keywords">This is text sized with keywords</p>
</body>
</html>

It works just fine for me....

Nick

11:39 am on Aug 1, 2002 (gmt 0)

Preferred Member

10+ Year Member

joined:Mar 27, 2001
posts:392
votes: 0


Hi Eric

thanks for your suggestion but that does not really answer the question....

11:46 am on Aug 1, 2002 (gmt 0)

Preferred Member

10+ Year Member

joined:Mar 27, 2001
posts:392
votes: 0


Nick, that looks good to me.
I should point out that the css is an external file that i include with

<link rel="stylesheet" type="text/css" href="styles.css">

could that be an issue. does the DOCTYPE stuff have an impact ?

11:47 am on Aug 1, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 4, 2002
posts:5044
votes: 0


Shouldn't make any difference at all. Let's see the surrounding html....

Nick

12:02 pm on Aug 1, 2002 (gmt 0)

Preferred Member

10+ Year Member

joined:Mar 27, 2001
posts:392
votes: 0


Nick

I inserted the following into the <head></head> section of the html you sent:

<link rel="stylesheet" type="text/css" href="styles.css">

that file has the following:
P { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: "xx-small"; }

I then added some text at the end of your html:
<P>normal text</p>

so that now we have inline and external styles on the page.

All of thext shows correctly in IE but the text formated with the external style is incorrect in Opera.

12:18 pm on Aug 1, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 4, 2002
posts:5044
votes: 0


How is it incorrect, too large or too small? You may have an issue with applying a catchall rule to p tags and a class with keywords. I get exactly the smae normal behaviour if I move the styles out to a sheet.

Nick

12:25 pm on Aug 1, 2002 (gmt 0)

Preferred Member

10+ Year Member

joined:Mar 27, 2001
posts:392
votes: 0


Nick

the text is too large.
here is the document content:

<head>
<title>Font test</title>
<style type="text/css">
h1 {
font: 2em arial, verdana;
}
.keywords {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: xx-small;
}
</style>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<h1>Opera Font test</h1>

<p class="keywords">This is text sized with keywords</p>

<P>This is text sized with normal P</P>
</body>

------------
here is the stylesheet content:

P { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: "xx-small"; }

12:40 pm on Aug 1, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 4, 2002
posts:5044
votes: 0


Well, I've tried it exactly as you have it and do not get this: I get exactly what you would expect.

I reckon you should have a good look through the preferences. I'll bet you have some settings that are overiding the styles.

Nick

12:47 pm on Aug 1, 2002 (gmt 0)

Preferred Member

10+ Year Member

joined:Mar 27, 2001
posts:392
votes: 0


Okay, I might try and contact Opera.
The settings still on the default the ships with Opera. I downloaded it yesterday and have not configured it.
1:05 pm on Aug 1, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


Try removing the quotes from around xx-small. Opera is ignoring the declaration when you have quotes around it.
1:07 pm on Aug 1, 2002 (gmt 0)

Preferred Member

10+ Year Member

joined:Mar 27, 2001
posts:392
votes: 0


Hi tedster
that was indeed the problem!

i pasted the code into the W3 CSS validator and it gave an error on the xx-small until i removed the quotes.

Thanks to both you and Nick for your assistance.