Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Body lines not affecting the page

Status
Not open for further replies.

Cineno

Programmer
Jul 24, 2006
142
US
I'm new to CSS. I've looked around and couldn't find a post like this, but sorry if it's been asked before.

In my css file I want to set a default size and color for the text on my page. I assumed this can be done in the body, and that everything that would be different I would put in different classes (like headings etc.). Right now, I can't change the size of the normal text though. The color and font changes, but not the size. Here's my css:

body
{
color: #006699;
font-size: 10px;
font-family: Tahoma;
}

#questionMain
{
font: bold 14px Tahoma;
color: #006699;
}

#progress
{
font: 11px Tahoma;
color: #006699;
}

#errorMsg
{
font: 13px Tahoma;
color: #FF0000;
}

Anyone know what's wrong with this, and why the size won't change? Any help is appreciated!
 
The sizes you specify are too close to each other in size to warrant a size jump in the font. Some fonts only come in certain sizes, otherwise they wouldn't look right.

[monkey][snake] <.
 
Thanks for the response. I'm not sure that's it though. I changed the font-size in #progress to 2px, and it worked. When I tried to do that in the body, nothing happened.

Do you have any other suggestions?
 
haha, damn I'm stupid, it's cause you don't have font[!]-size[/!] written.


[monkey][snake] <.
 
Sorry, I'm very not with it today. I do have a question.
Can you post your HTML?

[monkey][snake] <.
 
Sure here you go:

<%
id=1
max=23
%>
<html>

<head>

<link rel="STYLESHEET" type="text/css" href="css/textFormat.css">

<SCRIPT language="JavaScript">
function submitform()
{
document.survey.submit();
}
</SCRIPT>

</head>

<body>

<div align="center">

<table border="0" cellpadding="0" cellspacing="0" width="728" height="559">
<!-- MSTableType="layout" -->
<tr>
<td valign="top" colspan="5" height="104">
<!-- MSCellType="ContentHead" -->
<img border="0" src="images/banner.jpg" width="720" height="102"></td>
</tr>
<tr>
<td colspan="5" height="21" align="center">
<div id=errorMsg>
<%
Response.write "Please only enter valid numeric values for the fields marked with an (*)."
%>
</div>
</td>
</tr>
<tr>

<td height="25" valign="top" colspan="5" bgcolor="#DBECF6" background="images/topArc.jpg">

</td>

</tr>
<tr>

<td valign="top" rowspan="6" bgcolor="#DBECF6">

</td>

<td valign="top" colspan="3" bgcolor="#DBECF6" height="35">
<div id=questionMain>
1. Is health insurance provided by your organization?
</div>
</td>

<td valign="top" rowspan="6" bgcolor="#DBECF6">




</tr>
</tr>
<tr>
<form name="survey" method="POST" action="surveyValidate.asp">
<td valign="top" colspan="3" bgcolor="#DBECF6">

<input type="radio" name="healthIns"> Only employee-only coverage is offered<br>
<input type="radio" name="healthIns"> Family coverage available in addition to employee-only

</td>
</tr>
<tr>

<td valign="top" colspan="3" bgcolor="#DBECF6" height="191">
<br>
<div id=questionMain>
a. What percent of your employee population is enrolled in the following plan categories?
</div>
<table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0">
<tr>
<td width="424">&nbsp;</td>
<td width="9">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td width="424" align="right">Traditional Indemnity Medical
Plan</td>
<td width="9">&nbsp;</td>
<td>
<input type="text" name="orgName" size="7" value="<%=check2%>"></td>
</tr>
<tr>
<td width="424" align="right">HMO</td>
<td width="9">&nbsp;</td>
<td>
<input type="text" name="orgName" size="7" value="<%=check2%>"></td>
</tr>
<tr>
<td width="424" align="right">PPO / POS</td>
<td width="9">&nbsp;</td>
<td>
<input type="text" name="orgName" size="7" value="<%=check2%>"></td>
</tr>
<tr>
<td width="424" align="right">High Deductible Health Plan /
Consumer Driven Health Plan</td>
<td width="9">&nbsp;</td>
<td>
<input type="text" name="orgName" size="7" value="<%=check2%>"></td>
</tr>
<tr>
<td width="424" align="right">Not Covered Under Any Plan</td>
<td width="9">&nbsp;</td>
<td>
<input type="text" name="orgName" size="7" value="<%=check2%>"></td>
</tr>
</table>

</td>

</tr>
<tr>

<td valign="top" colspan="3" bgcolor="#DBECF6" height="46">
<br>
<div id=questionMain>
b. Do you charge higher healthcare premiums for smokers?
&nbsp;&nbsp;<select name="region">
<option value="">Select</option>
<option value="1"<%if check1="1" then response.write "SELECTED" end if%>>Yes</option>
<option value="2"<%if check1="2" then response.write "SELECTED" end if%>>No</option>
</select></div>
</td>

</tr>

<tr>

<td valign="top" colspan="3" bgcolor="#DBECF6" height="95">
<div id=questionMain>
<table border="0" width="100%" id="table2" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" width="87"><br>Comments:</td>
<td><br><TEXTAREA NAME="comments" COLS=56 ROWS=3></TEXTAREA></td>
</tr>
</table>
&nbsp;
</td>

</tr>
<tr>

<td valign="bottom" align="left" bgcolor="#DBECF6">
<a class="back" href="javascript: submitform()">&nbsp;</a>
</td>

<td bgcolor="#DBECF6" background="images/progress.jpg" align="center">

<p align="right">
<%revealWidth = 423 -(16.15 * id)%>

<img border="0" src="images/revealer.jpg" width="<% Response.write revealWidth %>" height="34"></td>

<td valign="bottom" align="right" bgcolor="#DBECF6" height="34">
<a class="next" href="javascript: submitform()">&nbsp;</a>
</td>

</tr>
</form>
<tr>

<td valign="top" colspan="5" bgcolor="#DBECF6" height="25" background="images/bottomArc.jpg" align="center">
<div id=progress>
<p align="center">Progress <% Response.write "( " & id & "/" & max & " )" %>
</div>
</td>
</tr>
<tr>
<td width="34"></td>
<td width="100"></td>
<td width="472"></td>
<td width="93"></td>
<td height="10" width="29"></td>
</tr>
<tr>
<td valign="top" colspan="5" height="40">
<!-- MSCellType="ContentFoot" -->
<img border="0" src="images/copywrite.jpg" width="720" height="38"></td>
</tr>
</table>

</div>

</body>

</html>


Thanks again for the help!
 
Is your normal text inside tables?

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Okay, obviusly it is and my post overlapped yours. Add this:
Code:
body, [b]td[/b]
{
color: #006699;
font-size: 10px;
font-family: Tahoma;
}
or
Code:
body, [b]p[/b]
{
color: #006699;
font-size: 10px;
font-family: Tahoma;
}


Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Yes! Thank you so much it's working now!
 
traingamer is about to answer your question, if he has not.

Yes, traingamer the "normal" text is in tables.

[monkey][snake] <.
 
This was just discussed in some detail in thread215-1344909

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
I would suggest, since you're changing the size within the subsequent ids, that you use [tt]font-size[/tt] to do so instead of [tt]font[/tt]. I'd further suggest that you use ems instead of pixels in those ids, like this:
Code:
#progress
{
font-size: 1.1em /* 11px / 10px = 1.1 */
color: #006699;
}
This has nothing to do with your problem (the cause of which is covered in the thread traingamer linked to) but improves your flexibility: if you decide to change the font or the size of text in your site, you'll only have to change the [tt]body[/tt] rule and everything else will fall into place. It's useful to be able to tweak the typography on a global basis like that.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Great point, thanks again for the help. I'm still getting used to CSS so all this is really good for me know.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top