navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Equal size fonts.

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Cascading Style Sheets >> Equal size fonts.
Page: [1]
 
Avick

 

Posts: 181
From: Ireland
Status: offline

 
Equal size fonts. - 6/24/2005 10:31:01   
This might seem like a simple question but give it a try. You will most likely end up frustrated like me.

I am trying to create a default font (Size Type Colour) in a simple command.
As I move through my site I will increase the font or decrease it as required. I wanted to do this in a simple single line of CSS.

This is the problem so far. (Mostly tested in FireFox)

Body {Font: 80% Arial Gray} will not work in tables
Body, Table {Font: 80% Arial Gray} will not work in Tables and Paragraphs
Body, td, p {Font: 80% Arial Gray} font is different sizes in body and td


I would like to set things up that the font stays the same throughout the site.
Then If I want to make a font smaller in a footer DIV I can set it so:
div.footer {font-size: 70% …… }
This , hopefully, will change the font in the DIV but not the rest of the site.

Am I shooting in the dark with this one or would I be better to set all commands in required sections!!


_____________________________

Alan
http://www.newebirl.net
Tailslide

 

Posts: 6267
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: Equal size fonts. - 6/24/2005 11:03:30   
Hi Alan

The standard thing to do would be:
body {font: 76%  Verdana, Arial, Helvetica, sans-serif; color: #666;}


And then specify divs or tds separately:
#footer {font-size: 1em;}


There's lots of debate about the best way to size fonts in websites - not sure if there's any clear winner on that argument yet!



< Message edited by Tailslide -- 6/24/2005 11:16:06 >


_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to Avick)
Avick

 

Posts: 181
From: Ireland
Status: offline

 
RE: Equal size fonts. - 6/24/2005 11:37:25   
Tried this Tailslide

Everything in a table will apper larger then outside the table.

If I place a div box in the table and one outside, the one inside has larger text then the others!!!

_____________________________

Alan
http://www.newebirl.net

(in reply to Tailslide)
Tailslide

 

Posts: 6267
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: Equal size fonts. - 6/24/2005 11:45:52   
Are you using tables for layout?

Can you then give a specific fontsize just to the div that's inside the table cell to bring the font-size down.

i.e. #tablediv {font-size:60%;}



_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to Avick)
Avick

 

Posts: 181
From: Ireland
Status: offline

 
RE: Equal size fonts. - 6/24/2005 16:12:07   
I'm using a div for the header (Outside a table) and a table with two td's for the main content. everything else is built without tables within the main table.

If that makes sense:)

_____________________________

Alan
http://www.newebirl.net

(in reply to Tailslide)
Tailslide

 

Posts: 6267
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: Equal size fonts. - 6/24/2005 16:20:53   
It does.

Do you have more divs within the table and have you tried to apply a font-size to those inner divs specifically - i.e.

CSS:
#leftdiv {font-size: 1em; color: #666;} 
#rightdiv {font-size: .9em; color: #ccc;}


HTML:
<table>
<tr>
<td><div id="leftdiv"> Content goes here</div></td>
<td><div id="rightdiv"> More content goes here</div></td>
</tr>
</table>


Just an example.

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to Avick)
Avick

 

Posts: 181
From: Ireland
Status: offline

 
RE: Equal size fonts. - 6/24/2005 17:51:28   
What I am currently doing is

div {font-size: 0.90em;}

Then if I want to get a custom font for a margin box its as follows

div.marginBox {font-size: 0.70em;}

By doing it this way I get to keep the code clean without a ton of font-size tags.

I would realy like to move away from this and go more for a general all round font size in just one command.

Told you its not as easy as it looks :)

_____________________________

Alan
http://www.newebirl.net

(in reply to Tailslide)
Kitka

 

Posts: 2520
Joined: 1/31/2002
From: Australia
Status: offline

 
RE: Equal size fonts. - 6/24/2005 20:25:31   
quote:

By doing it this way I get to keep the code clean without a ton of font-size tags.


Try this:

body  {font: 80% arial; color:gray;}
p, td {font-size: 1em;}


Note that a font color cannot be included in font property declaration - it is not valid. You must declare it separately.

_____________________________

Kitka
**It is impossible to make anything foolproof because fools are so ingenious.**


(in reply to Avick)
c1sissy

 

Posts: 5084
Joined: 7/20/2002
From: NJ
Status: offline

 
RE: Equal size fonts. - 7/6/2005 15:33:46   
Actually the best way to do this is:

body, html {
font-size: 100.01%;
color: gray;
}
Then in any of the spots that you wish to change your font & color, you use ems, the reason for the 100.01%, but I have to go and look it up. You can find it on the css-d wiki list if you do a search for the sizing of the font.

Reason for using body, and html is because Explorer doesn't look at html as being the root of the document. So using both html and body takes care of this for you.

_____________________________

Deb-aka-c4Ksissy
high panjandurum and alpha female of the silverback tribe
As decreed by Jesper 5-24-2003.
The only stupid question is... the one that is never asked!!
http://directory.css-styling.com
http://fmsforum.com
http://positioniseverything.net/
http://www.tanfa.co.uk/

(in reply to Kitka)
Avick

 

Posts: 181
From: Ireland
Status: offline

 
RE: Equal size fonts. - 7/6/2005 17:42:30   
Thanks C1sissy
That seems to have worked a treat. :)
I have started a new technique to help clients update there own sites with very little effort.
Seems to be going very well! My problem above was one I could not get my head around.


_____________________________

Alan
http://www.newebirl.net

(in reply to c1sissy)
c1sissy

 

Posts: 5084
Joined: 7/20/2002
From: NJ
Status: offline

 
RE: Equal size fonts. - 7/6/2005 18:14:59   
I have to look up the reasoning for this, it has something to do with working cross browser. I have it in some of my tons of notes somewhere. I usually try to give the reason for what I give, but with so much out there to learn (which is one reason I am not in as much :)) Sometimes the things slip my mind.:)

Anyhow, I'm so glad that this worked for you! Let me know if I can do anything else for you.

Oh, also, don't forget to put this in your styles as well, it saves a ton of headaches.

* {
margin: 0px;
padding: 0px;
border: 0px;
}

What this does is zero's out all the paddings, margins and borders. Then you can add them when and where you need them. The global styling works so much better with this. ( that would be the * with your styles following it)

_____________________________

Deb-aka-c4Ksissy
high panjandurum and alpha female of the silverback tribe
As decreed by Jesper 5-24-2003.
The only stupid question is... the one that is never asked!!
http://directory.css-styling.com
http://fmsforum.com
http://positioniseverything.net/
http://www.tanfa.co.uk/

(in reply to Avick)
Page:   [1]

All Forums >> Web Development >> Cascading Style Sheets >> Equal size fonts.
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts