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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS Newbie Question [Font-Size] 1

Status
Not open for further replies.

jmeckley

Programmer
Jul 15, 2002
5,269
US
I have an asp.net web app i'm working on. I would like to use a sytle sheet with this project.

In the style sheet that is created with the asp.net project (styles.css) there is a BODY tag.

Within the BODY tag is:[tt]
{
font-size: .58em;
font-family: Verdana;
background-color: white;
}[/tt]

When I load the page on my computer I The background is white, the font is Verdana, but I cannot get the font size to change. If I type in 2em or .5em the font stays the same size.
I can't figure out what's wrong. any ideas?

Jason Meckley
Database Analyst
WITF
 
that does not seem to work either.

I have been testing different properities, some seem to take effect, others do not.

For instance, background color, font color work. Bold, Italic, Underline, Overline, caps, they do not.

I created my own class and attached it to the different text items. Not the cleanest solution, but it works.

Jason Meckley
Database Analyst
WITF
 

Can you post your complete CSS and HTML code (or a URL to them)?

Don't forget to wrap them in
Code:
[
Code:
code]
tags!

Thanks,

Dan
 
CSS
Code:
BODY
{
	font-family: Verdana;
	background-color: white;
}

.Color_Block, .Color_Block2, .Link_Block, .Font_Color, .Item_Label, .Text, A:link, A:visited, A:active, A:hover
{
	font-size: .8em;
}

A:link, A:visited, A:active, A:hover
{
	color: #DD4B03;
	text-decoration: none;
}

A:hover
{
	text-decoration: underline;
}

.Color_Block
{
	background-color: #ECCA72;
	color: #DD4B03;
	font-weight: bold;
}

.Color_Block2
{
	background-color: #ECCA72;
	color: Black;
}

.Link_Block
{
	color: #DD4B03;
	background-color: Black;
	text-align:center center;
}

.Font_Color
{
	color: #DD4B03;
	font-weight: bold;
}

.Item_Label
{
	font-weight: bold;
}
-----------------------------------------------------
-----------------------------------------------------
HTML

<%@ Register TagPrefix=&quot;incSearch&quot; TagName=&quot;Search&quot; Src=&quot;Search.ascx&quot; %>
<%@ Register TagPrefix=&quot;incHeader&quot; TagName=&quot;Header&quot; Src=&quot;Header.ascx&quot; %>
<%@ Page Language=&quot;vb&quot; AutoEventWireup=&quot;false&quot; Codebehind=&quot;Default.aspx.vb&quot; Inherits=&quot;GalleryCatalog._Default&quot; EnableSessionState=&quot;True&quot;%>
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;>
<HTML xmlns:st1 xmlns:o>
	<HEAD>
		<title>Welcome to WITF's Online Gallery</title>
		<meta content=&quot;Microsoft Visual Studio.NET 7.0&quot; name=&quot;GENERATOR&quot;>
		<meta content=&quot;Visual Basic 7.0&quot; name=&quot;CODE_LANGUAGE&quot;>
		<meta content=&quot;JavaScript&quot; name=&quot;vs_defaultClientScript&quot;>
		<meta content=&quot;[URL unfurl="true"]http://schemas.microsoft.com/intellisense/ie5&quot;[/URL] name=&quot;vs_targetSchema&quot;>
		<LINK media=&quot;screen&quot; href=&quot;styles.css&quot; type=&quot;text/css&quot; rel=&quot;StyleSheet&quot;>
	</HEAD>
	<body MS_POSITIONING=&quot;GridLayout&quot;>
		<form id=&quot;Form1&quot; method=&quot;post&quot; runat=&quot;server&quot;>
			<TABLE id=&quot;tblForm&quot; style=&quot;Z-INDEX: 101; LEFT: 8px; WIDTH: 735px; POSITION: absolute; TOP: 8px&quot; cellSpacing=&quot;0&quot; cellPadding=&quot;0&quot; border=&quot;0&quot;>
				<TR>
					<TD>
						<incHeader:Header id=&quot;uclHeader&quot; runat=&quot;server&quot;></incHeader:Header>
					</TD>
				</TR>
				<TR>
					<TD>
						<TABLE id=&quot;tblBody&quot; cellSpacing=&quot;0&quot; cellPadding=&quot;5&quot; border=&quot;0&quot;>
							<TR>
								<TD style=&quot;WIDTH: 108px&quot; vAlign=&quot;top&quot; align=&quot;left&quot;>
									<incsearch:search id=&quot;uclSearch&quot; runat=&quot;server&quot;></incsearch:search>
								</TD>
								<TD vAlign=&quot;top&quot; align=&quot;left&quot; colSpan=&quot;1&quot; rowSpan=&quot;1&quot;>
									<TABLE id=&quot;tblCenter&quot; style=&quot;WIDTH: 192px; HEIGHT: 345px&quot; cellSpacing=&quot;1&quot; cellPadding=&quot;1&quot; border=&quot;0&quot;>
										<TR>
											<TD>
												<P class=&quot;Text&quot;>Welcome to the 2004 Online Catalog for the WITF Gallery 2004 On Air 
													Art & Crafts Auction! In it's 37th year, we are pleased to be able to 
													present to you, works from some of the finest artists and crftsmen inthe 
													Central PA area. Because the catalog has close to 1,000 works in it, you will 
													be required to seach on specific interests, and then those works matching your 
													interests will be displayed.</P>
											</TD>
										</TR>
										<TR>
											<TD>
												<div class=&quot;Color_Block&quot;>Step 1</div>
											</TD>
										</TR>
										<TR>
											<TD class=&quot;Text&quot;>Begin to Search Catalog on left by entering search criteria</TD>
										</TR>
										<TR>
											<TD>
												<div class=&quot;Color_Block&quot;>Step 2</div>
											</TD>
										</TR>
										<TR>
											<TD class=&quot;Text&quot;>Select Artist or Title and review artwork. You can place an 
												Advance Bid and/or Vote for the People's Choice located to the right of the 
												search box. One vote per person, please.</TD>
										</TR>
										<TR>
											<TD>
												<div class=&quot;Color_Block&quot;>Step 3</div>
											</TD>
										</TR>
										<TR>
											<TD class=&quot;Text&quot;>Continue search the hundreds of pieces in our catalog and/or 
												become a member of WITF or renew Your membership.</TD>
										</TR>
									</TABLE>
								</TD>
								<TD vAlign=&quot;top&quot; align=&quot;left&quot;>
									<TABLE id=&quot;Table1&quot; style=&quot;WIDTH: 192px; HEIGHT: 72px&quot; cellSpacing=&quot;1&quot; cellPadding=&quot;1&quot; border=&quot;0&quot;>
										<TR>
											<TD>
												<div class=&quot;Color_Block2&quot;>Watch and Bid on these works Airing on WITF-TV</div>
												<div class=&quot;Color_Block&quot;>Friday thru Sunday,<BR>
													April 16-18, 2004<BR>
													<asp:Image id=&quot;Show&quot; runat=&quot;server&quot; ImageUrl=&quot;/GalleryCatalog/Image/show_169x141.gif&quot; BackColor=&quot;#ECCA72&quot;></asp:Image></div>
											</TD>
										</TR>
										<TR>
											<TD></TD>
										</TR>
										<TR>
											<TD>
												<div class=&quot;Color_Block&quot;>Step 4</div>
											</TD>
										</TR>
										<TR>
											<TD class=&quot;Text&quot;>To secure your Advance Bid Call 1-800-222-2222 and give us your 
												credit card number. To hasten the process, secure your own Speed Bid Number 
												now.</TD>
										</TR>
										<TR>
											<TD>
												<div class=&quot;Color_Block&quot;>Speed Bid!</div>
												<div class=&quot;Color_Block2&quot;>What is it and how do I<BR>
													Get my number?</div>
											</TD>
										</TR>
									</TABLE>
								</TD>
								<TD vAlign=&quot;top&quot; align=&quot;left&quot; colSpan=&quot;1&quot; rowSpan=&quot;1&quot;>
									<P>
										<TABLE id=&quot;tblRight&quot; cellSpacing=&quot;1&quot; cellPadding=&quot;1&quot; border=&quot;0&quot;>
											<TR>
												<TD>
													<div class=&quot;Color_Block2&quot;>See This Year's<BR>
														WITF's Gallery 2004</div>
													<div class=&quot;Color_Block&quot;>Featured Editions</div>
												</TD>
											</TR>
											<TR>
												<TD><asp:linkbutton id=&quot;lnkLE&quot; runat=&quot;server&quot; Font-Underline=&quot;True&quot; ForeColor=&quot;Black&quot; CausesValidation=&quot;False&quot;>2004 Limited Editions</asp:linkbutton></TD>
											</TR>
											<TR>
												<TD><asp:linkbutton id=&quot;lnkJudge&quot; runat=&quot;server&quot; Font-Underline=&quot;True&quot; ForeColor=&quot;Black&quot; CausesValidation=&quot;False&quot;>Judge's Award Winners</asp:linkbutton></TD>
											</TR>
											<TR>
												<TD><asp:linkbutton id=&quot;lnkPeople&quot; runat=&quot;server&quot; Font-Underline=&quot;True&quot; ForeColor=&quot;Black&quot; CausesValidation=&quot;False&quot;>2004 People's Choice Winners</asp:linkbutton></TD>
											</TR>
											<TR>
												<TD style=&quot;FONT-SIZE: 0.8em; COLOR: #dd4b03; FONT-FAMILY: 'Courier New', Monospace; POSITION: relative&quot;>To 
													Be Determined April 1st Vote<BR>
													Now. One vote per person please.</TD>
											</TR>
											<TR>
												<TD><asp:linkbutton id=&quot;lnkJudgeCitation&quot; runat=&quot;server&quot; Font-Underline=&quot;True&quot; ForeColor=&quot;Black&quot; CausesValidation=&quot;False&quot;>2004 Judge's Citations Winners</asp:linkbutton></TD>
											</TR>
											<TR>
												<TD><asp:linkbutton id=&quot;lnkLEEncore&quot; runat=&quot;server&quot; Font-Underline=&quot;True&quot; ForeColor=&quot;Black&quot; CausesValidation=&quot;False&quot;>2003 Encore Limited Editions</asp:linkbutton></TD>
											</TR>
											<TR>
												<TD>
													<div class=&quot;Font_Color&quot;>Quick Links</div>
												</TD>
											</TR>
											<TR>
												<TD class=&quot;Text&quot;>
													> For answers to all your Gallery<BR>
													   Questions visit our FAQs section<br>
													> Who are the Art Markets?<br>
													> Pick Up Locations
												</TD>
											</TR>
											<TR>
												<TD class=&quot;Text&quot;>
													<div class=&quot;Font_Color&quot;>Questions and Conerns</div>
													<A href=&quot;mailto:deanna_bourgault@witf.org&quot;>Deanna Bourgault</A> or<BR>
													<A href=&quot;mailto:marta_murray@witf.org&quot;>Marta Murray</A> at:<BR>
													1-800-366-9483<BR>
													ext. 2965 or ext. 2949
												</TD>
											</TR>
										</TABLE>
									</P>
								</TD>
							</TR>
						</TABLE>
					</TD>
				</TR>
			</TABLE>
		</form>
	</body>
</HTML>

Jason Meckley
Database Analyst
WITF
 
I've just tried this:
[tt]
<html>
<head>
<title>Test</title>
<style type=&quot;text/css&quot;>
body {
font-size: .58em;
font-family: Verdana;
background-color: white;
}
</style>
</head>
<body>
<p>This is a test</p>
</body>
</html>
[/tt]
and it works fine in IE 5.5 and NS7, what browser are you using?

-- Chris Hunt
 

Jason,

The reason that changing the font-size in the BODY css isn't having any effect on your text, is because it is all wrapped in TD or P tags with a class of 'text'. You have no body text.

If you want to change the size of your text, change the font-size in the second CSS block (the one with '.Text' in). This way, your text will change size.

Hope this helps,

Dan
 
thank you. BillRayPreacherSon, that did it! I will play with changing the font size on the table properity instead.

Jason Meckley
Database Analyst
WITF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top