473,395 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

CSS & Font Sizes

I'm just after a bit of wisdom here.

If I specify something like

body { font-size: 1em; }

is this really the same as

body { font-size: 100%; }
?

Which is preferred, or is it a matter of taste?

And what is the difference between the above and not specifying the
font-size at all?

Thanks

Mark
Apr 22 '07 #1
3 1548
Mark wrote:
I'm just after a bit of wisdom here.

If I specify something like

body { font-size: 1em; }

is this really the same as

body { font-size: 100%; }
?
They give the same result.
Which is preferred, or is it a matter of taste?
100% is preferred, due to a bug in IE6 and lower (maybe 7 too?) where em
unit will not scale correctly when user changes size (Medium to Large,
etc).
And what is the difference between the above and not specifying the
font-size at all?
None, except if you do declare it, you show your intent on being
correct. <g>

--
-bts
-Motorcycles defy gravity; cars just suck
Apr 22 '07 #2
Beauregard T. Shagnasty wrote:
Mark wrote:
> body { font-size: 1em; }
body { font-size: 100%; }
And what is the difference between the above and not specifying the
font-size at all?

None, except if you do declare it, you show your intent on being
correct. <g>
Also, if you do use em units elsewhere in the stylesheet, IE will give
more predictable results if you set font-size:100% first.

--
Berg
Apr 22 '07 #3
Bergamot wrote:
Beauregard T. Shagnasty wrote:
>Mark wrote:
>> body { font-size: 1em; }
body { font-size: 100%; }
And what is the difference between the above and not specifying the
font-size at all?
None, except if you do declare it, you show your intent on being
correct. <g>

Also, if you do use em units elsewhere in the stylesheet, IE will give
more predictable results if you set font-size:100% first.
Thanks for your help. I wasn't aware of the IE bug so that simplifies
things.

Mark
Apr 22 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: black tractor | last post by:
HI there.. l was just wondering, if l place a "table" in the "editable region" of my template, will the text, graphics placed inside the this "table" MOVE BY ITSELF?? l mean, recently l had a...
5
by: johnny | last post by:
hi all, I would like to know if the more and more websites offering the 3 font sizes option by style switching are just following a trend or have chose the best solution by an...
7
by: R0bert Nev1lle | last post by:
Internet Explorer always presents me with a challenge (partial repost). The current issue involves emulating max-width in IE using the technique described by Svend Tofte. ...
0
by: Paul D. Sullivan | last post by:
I've been trying to find out how to increase the font size in the text entry fields in Invision Power Board 1.3 for a while. The part where you enter your post and do the quick reply and all that...
0
by: Sarah Akers | last post by:
GgF ----gL5cJ72EqiGIQ0SK65Rz Content-Type: text/html; Content-Transfer-Encoding: quoted-printable <html> <head> <style type=3D"text/css">.eyebrow { FONT-WEIGHT: bold; FONT-SIZE: 10px; TE=
60
by: deko | last post by:
As I understand it, most browser manufacturers have agreed on 16px for their default font size. So, this should be an accurate conversion for percentages: px % 16 = 100 14 = 87.5 13 =...
16
by: maya | last post by:
I have heard so much preaching here about how font sizes should be set as percentages so users can change font-sizes on their browsers... ok, so now at work am working on a site where we need to do...
3
by: coyttl | last post by:
Hey guys, I'm sure I'm doing something dumb but can't figure out exactly what it is... Here are details: XHTML Transitional pages with a linked CSS page. (See the CSS bits below) On Firefox...
59
by: Andy Fish | last post by:
Hi, I am trying to output some html in monospaced font, and I want spaces to take up the same width as any other character. i thought this would be easy for monospaced fonts - surely &ensp; and...
1
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.