Setting Font Attributes
Is there anyway to set the default font on a webpage to a certain size and face in both browsers? Thanks in advance.
------------------
Good looking by Nature... Intelligent by Practice
http://dlo.net/process/profile.php3?user=Westwood
phyllis posted this at 14:07 — 7th April 2000.
They have: 59 posts
Joined: Mar 2000
You could set it with a stylesheet on "body" in the header. Here's a simple file that works cross-browser:
<html>
<head>
<style type="text/css">
<!--
body {font-family: Arial; font-size: 18pt; color: #ff0000}
-->
</style>
</head>
<body>
test test
</body>
</html>
If you have tables, you will probably have to set "td" the same as "body."
I hope this helps!
Phyllis
[This message has been edited by phyllis (edited 07 April 2000).]
Suzanne posted this at 19:13 — 7th April 2000.
She has: 5,507 posts
Joined: Feb 2000
Using pt won't work as IE makes fonts slightly larger than actual size.
In order to get as close as possible, you need to use px sizing and you need to be really careful with this as small pixel sizing will make the page illegible in Linux browsers, can interfere with printing size and will also prevent the user from utilizing the font increase and decrease buttons in their browsers that allow for adjustments based on need (like poor vision or a small monitor, or a really large monitor).
www.inforamp.net/~suzanne/index/links.htm#css is a list of CSS resources that you will find very valuable, including the master grid of what is supported.
Also, you need to specify all tags in the declaration that will be affected, or you run into issues with some versions of some browsers.
So instead of just body, td {}, you would have
body, table, tr, td, div, p, address, h1, h2, h3, h4, h5, h6, a {}
Just remove the ones you don't use (like the headings that won't be used) but include every basic link.
I start with that line, and if any of the tags are going to have more declarations, I pull them out of the list, keep the font-family declaration and build the rest.
As well, keep the font-family as the LAST declaration in every tag so that IE 3.0 won't stop reading after it sees it.
Suzanne
------------------
Zero Cattle
Suzanne
Tables DeMystified
[This message has been edited by Suzanne (edited 07 April 2000).]
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.