header font formatting question

This is a discussion on "header font formatting question" within the Web Page Design section. This forum, and the thread "header font formatting question are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Dec 21st, 2006, 14:26
New Member
Join Date: Dec 2006
Location: nc
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
header font formatting question

I have inherited a school website. I am currently removing all the tables embedded in tables embedded in tables used for formatting and going more toward CSS based code.

I am having a problem getting the header with the school name to display the way I want it.

I would like to have the font to be 24px vertically centered in an area with a height of 30.

If I just set the font to be 24px I get a huge amount of white space around my text. If I set the height in my CSS file the text is not centered vertically.

Is there any way to do what I want or will I be stuck using an img file to display my text?

CSS code:

.CssHeader

{ color: black
font-family: Arial;
font-size: 24px;
font-weight: bold;
padding-left: 5px;
height: 30;
}

HTML code:

<div class="CssHeader">
<p>My School Name</p>
</div> <!-- #header -->
Reply With Quote

  #2 (permalink)  
Old Dec 21st, 2006, 14:52
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: header font formatting question

Yeah, here's the shorthand method and the longhand method...

Longhand:
Code: Select all
.header {
    height: 30px;
    padding-left: 5px;
    color: #000;
    font-family: arial,sans-serif;
    font-size: 24px;
    font-weight: bold;
    line-height: 30px;
}
Shorthand:

Code: Select all
.header {
    height: 30px;
    padding: 0 0 0 5px;
    color: #000;
    font: bold 24px/30px arial,sans-serif;
}
There's a sticky in this forum with a link to an article I wrote about shorthand if you're intersted in learning more. It makes things much easier to edit
Reply With Quote
  #3 (permalink)  
Old Dec 21st, 2006, 14:55
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: header font formatting question

I forgot to mention it in my last post. When setting a font, always use the font family after it. E.g. sans-serif (like arial), serif (like times), cursive (like zapf chancery) or monospace (like courier) or fantasy (like papyrus).
Reply With Quote
Reply

Tags
css

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Simple Question: Why does Font Style change on Web Page in different Browse BlackReef Web Page Design 11 Dec 7th, 2007 09:39
Font size question on websites? ugadawgvi Starting Out 2 Aug 3rd, 2007 16:50
IE7 font size and formatting - help Xhristy Web Page Design 4 Apr 3rd, 2007 17:35
flash font question tigas langaw Flash & Multimedia Forum 8 Jan 6th, 2007 06:01
Font question itorch Graphics and 3D 58 Dec 13th, 2006 14:26


All times are GMT. The time now is 15:50.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43