Welcome to Dream.In.Code
Become an Expert!

Join 149,536 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,526 people online right now. Registration is fast and FREE... Join Now!




CSS ~ Font Size Not Working?

 
Reply to this topicStart new topic

CSS ~ Font Size Not Working?

Israel
15 Jun, 2007 - 08:50 PM
Post #1

D.I.C Addict
Group Icon

Joined: 21 Nov, 2004
Posts: 626


Dream Kudos: 175
My Contributions
Ok, this is so lame again. I know I've done this stuff a million times 2 semesters ago but something is baffling me about the simplest stuff. I just can't seem to adjust my font-size with CSS. Here's what I have so far:

CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<title>The Inn - Beverages</title>

<style type="text/css">
body{background-image:url("./_borders/mgt00721.jpg");}
td{width:50%;
   color:#E6C78E;}
A.txt:link  {color:white;
              text-decoration: underline}
A.txt:visited {cursor: crosshair;
                color:white;
                text-decoration: underline}
A.txt:hover {cursor: crosshair;
              color:white;
              text-decoration: underline}
p.one{font-family:Technical;
                font-size: 5;
                color:#FFFFFF;}
p.two{font-size:6;
       color:#FFD8A4}
</style>
</head>

<body>

<p><center>
<img src="./_borders/logo2.jpg" alt="The Inn" width="479" height="123"></p>
<p class="one">106
South Main Somewhere, GA 30666<br />
e-mail ~ <a class="txt" href="mailto:Someone@aol.com">
frontdesk@theinn.com</a></center></p>

<table dir="ltr" border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td valign="top">
<p></p>
<p class="two"><center>Beverages</p>
<!-- end of problematic part of code -->


Ps- I'm still editing this code I know there's more old html to be fixed.
User is offlineProfile CardPM
+Quote Post

girasquid
RE: CSS ~ Font Size Not Working?
15 Jun, 2007 - 10:22 PM
Post #2

Barbarbar
Group Icon

Joined: 3 Oct, 2006
Posts: 1,294



Thanked: 18 times
Dream Kudos: 725
My Contributions
Try setting some units, like this:
CODE

p.one {font-size:1em}
p.two {font-size:3pt}

User is offlineProfile CardPM
+Quote Post

quim
RE: CSS ~ Font Size Not Working?
16 Jun, 2007 - 06:57 AM
Post #3

D.I.C Head
Group Icon

Joined: 11 Dec, 2005
Posts: 145



Thanked: 2 times
Dream Kudos: 350
My Contributions
yup girasquids, right. I think that you should set the unit like:
pt, px ...

This post has been edited by quim: 16 Jun, 2007 - 06:58 AM
User is offlineProfile CardPM
+Quote Post

Israel
RE: CSS ~ Font Size Not Working?
16 Jun, 2007 - 10:33 AM
Post #4

D.I.C Addict
Group Icon

Joined: 21 Nov, 2004
Posts: 626


Dream Kudos: 175
My Contributions
Odd... when I tried px before I posted nothing happened. But em works on p.one. However, p.two only changes the font color, not the font-size, even though I'm using em, just like in p.two? Maybe its just the browser?
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<title>The Inn - Beverages</title>
<style type="text/css">
body{background-image:url("./_borders/mgt00721.jpg");}
td{width:50%;
   color:#E6C78E;}
A.txt:link  {color:white; text-decoration: underline}
A.txt:visited {cursor: crosshair; color:white; text-decoration: underline}
A.txt:hover {cursor: crosshair; color:white; text-decoration: underline}
p.one{font-family:Technical; font-size: 1.1em; color:#FFFFFF;}
p.two{font-size: 2em; color:#FFD8A4}
</style>
</head>

<body>

<p><center>
<img src="./_borders/logo2.jpg" alt="The Inn" width="479" height="123"></p>
<p class="one">106
South Main Somewhere, GA 30666 ~ 912-489-8628 or 800-846-9466<br />
e-mail ~ <a class="txt" href="mailto:Someone@aol.com">
frontdesk@theinn.com</a></center></p>

<table dir="ltr" border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td valign="top">
<p></p>
<p class="two"><center>Beverages</center></p>
<table border="1" width="100%">

User is offlineProfile CardPM
+Quote Post

William_Wilson
RE: CSS ~ Font Size Not Working?
16 Jun, 2007 - 10:41 AM
Post #5

lost in compilation
Group Icon

Joined: 23 Dec, 2005
Posts: 4,101



Thanked: 25 times
Dream Kudos: 3275
Expert In: Java, C, Javascript

My Contributions
it may not solve your problem, but i believe it is your html and not the css.
You have 2 closing </center> tags, as well as the placement of them does not work with your paragraph tags. ex:
<p><center></center></p> is ok

<p><center></p></center> is not ok, and you have setups like this in your code.
User is offlineProfile CardPM
+Quote Post

Israel
RE: CSS ~ Font Size Not Working?
16 Jun, 2007 - 07:11 PM
Post #6

D.I.C Addict
Group Icon

Joined: 21 Nov, 2004
Posts: 626


Dream Kudos: 175
My Contributions
Strange... it would not work when I tried arranging the <center> tags more orderly like you said. But on a whim I tried the text-align:center; in my CSS and it worked fine.

Now I'm just concerned because the link is unclickable? When you hover the mouse over it there's an X not a hand.(I use Linux, so that's what I see).
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 09:10PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month