Current location: Hot Scripts Forums » General Web Coding » CSS » Chrome: larger font-size in tables


Chrome: larger font-size in tables

Reply
  #1 (permalink)  
Old 02-10-10, 06:45 AM
sman sman is offline
Newbie Coder
 
Join Date: May 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Chrome: larger font-size in tables

Hello,

i am regulating my font-size on websites globally with 9pt for the body-tag. There is no other font-size attribut in my css code for any subtag.

All browsers but IE6-7 and Google Chrome (I only tested version 3) display texts correctly.
The IE bugs displaying text in tables much larger is well-known and can be corrected by little IE hacks.

But why the new Chrome also displays text in tables with much larger font-size and how can i fix that?

Thank you in advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 02-10-10, 06:55 AM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,516
Thanks: 20
Thanked 109 Times in 106 Posts
Can you post the for the font size and the related HTML?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 02-10-10, 07:21 AM
sman sman is offline
Newbie Coder
 
Join Date: May 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Post Code snippet

Just following my describtion, you can easily write a minimum test file
HTML Code:
<html><head>
<style>body { font-size: 9pt; }</style>
</head><body>
Text for testing purpose.
<table><tr><td>Text for testing purpose.</td></tr></table>
</body></html>
I was surprised that this results in a larger font-size in the table for ALL browsers, why?

Now, using the doctype i was using as i found my problem:
HTML Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'[]>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<style>body { font-size: 9pt; }</style>
</head><body>
Text for testing purpose.
<table><tr><td>Text for testing purpose.</td></tr></table>
</body></html>
The font-size is displayed as i described, both are the same in Firefox3 and IE8, but not in Chrome3, the table text is still larger. But i still like to know: Why is the font-size interpretation changing as the doctype is changed?

On my way to play with this test file, I found a solution even for Chrome, just adding the following style to the existing one:
HTML Code:
body * { font-size: 100%; }
But it leads again to the fundamental question: What is the reason for that stupid behaviour?

I hope to learn from you and maybe get to know more insight into that weird display behaviours of CSS.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 02-10-10, 10:02 AM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,516
Thanks: 20
Thanked 109 Times in 106 Posts
Be sure to validate your code. It will save you a lot of time.

The W3C Markup Validation Service
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 02-10-10, 11:49 AM
sman sman is offline
Newbie Coder
 
Join Date: May 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Angry Thank you for no help

Thank you very much wirehopper for answering one-liners and no help.

This is a minimum test code, which properties are generally defined as having the same behaviour as the real code.
Naturally, i have validated my code before i posted the issue.

As you wish, here is exactly the same but validated code, behaving exactly the same weird way:
HTML Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'[]>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>foo</title>
<style type="text/css">
body { font-size: 9pt; }
</style>
</head><body>
<p>Text for testing purpose.</p>
<table><tr><td>Text for testing purpose.</td></tr></table>
</body></html>
Again: Chrome shows larger font sizes in the table.
Any ideas or hints?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 02-12-10, 07:50 AM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,516
Thanks: 20
Thanked 109 Times in 106 Posts
I'm sorry my suggestions didn't help you. I don't have an answer, or I would have posted it.

When I have one browser that's behaving differently, my solution has been to create a stylesheet that forces the page to display as I want it to, then use the server to check the browser and include that stylesheet if necessary.

Or, I just allow that browser to display slightly differently.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks

Tags
bug, chrome, font-size, table


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamically changing font with text size hemi HTML/XHTML/XML 3 11-17-09 08:57 AM
browser only renders font size change, no color, etc. labelle CSS 3 03-30-09 02:41 AM
Readfile Font Size ChrisXPPro PHP 6 11-09-07 06:15 PM
Looking for a script that will allow users to change the font size AND family AshleyQuick Script Requests 1 03-18-07 02:35 PM
Font Size Scaling / AutoScale mike_wilson Windows .NET Programming 0 05-13-05 11:33 AM


All times are GMT -5. The time now is 03:18 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.