Newbie problem with font-size in body
Posted: 10 February 2009 09:48 PM   [ Ignore ]
Newbie
Rank
Total Posts:  1
Joined  2009-02-10

Hello everybody, I am working on my first webpage in along time and am trying to learn css and php as I go. I am embarrased to ask this question but I have tried and tried and can’t seem to get my font-size tag to adjust the size of my font in the body. I have included my stylesheet. Hopefully somebody can help me out with this! Thanks in advance.

body {
  font
-size20pt;
  
color#0000FF;
  
background#E0FFFF;
  
}
  
a
:link { 
  color
#9933FF;
  
text-decorationnone
  
}

a
:visited {
  color
#660066;
  
text-decorationnone;
  
}
  
a
:hover {
  color
red;
  
text-decorationnone;
  
}
  
a
:active {
  color
red;
  
text-decorationnone;
  
}
  
#navbar {
  
margin0;
  
padding0;
  
displayinline;
  
floatcenter;
  
width100%;
  
}  
#navbar li {
  
background#0000FF;
  
displayinline;
  
margin0;
  
padding0;
  
}
  
#navbar a:link,  
#navbar a:visited {
  
colorwhite;
  
background#0000FF;
  
text-decorationnone;
  
text-aligncenter;
  
font-weightbold;
  
floatcenter;
  
width130;
  
padding0px 20px 0px 20px;
  
}

#navbar a:hover,
#navbar a:active {
  
color#0000FF;
  
text-decorationnone;
  
text-aligncenter;
  
font-weightbold;
  
background#E0FFFF;
  
floatcenter;
  
width130;
  
padding0px 20px 0px 20px;
  
Profile
 
 
Posted: 07 March 2009 07:49 AM   [ Ignore ]   [ # 1 ]
Newbie
Rank
Total Posts:  6
Joined  2009-03-07

The problem may be that you’re defining the font size for the body, but elements inside the body (like divs and paragraphs) that contain text are not inheriting the change.

Try this instead:

*{
  font-size: 20pt;
  color: #0000FF;
  }

Profile
 
 
Posted: 12 March 2009 04:28 PM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  17
Joined  2009-03-09

You should configure the size of your font with px or %

Try this:

body {
  font
-size12px;
  
color#0000FF;
  
background#E0FFFF;
  

Or

body {
  font
-size100%;
  
color#0000FF;
  
background#E0FFFF;
  

You can change values 12 and 100 to see the difference.

Profile