CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 18th, 2004, 07:31 PM
jwfc jwfc is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 97 jwfc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 19 m 18 sec
Reputation Power: 6
CSS text and font help please

i copied some of this code from a page i liked. all it is is a background image and i want to type text over it that is in a table. the problem is i cannot center my text ("<?=$information[nickName]?>"). the text always is on the left, never in the center. i have tried different things such as
<td align=center> as opposed to the <td valign=center> the other author has in the 2nd block, the align:center does not work with font. and i have tried appending a ;text-align:center within that SPAN tag, but that does not work either. does anyone have any advice??? thanks!

<table border=0 cellspacing=0 cellpadding=0 width="750" style="border: solid black 2px;">
<tr><td style="background-image:url(images/name_test.jpg); background-attachment: 100% 0%">

<table border="0" cellspacing=0 cellpadding=1><TR><TD valign="center"><SPAN style="font-size: 14pt; font-family: arial black, helvetica; padding: 3px; align: center;"><?=$information[nickName]?></SPAN></TD></TR>
</table>

Reply With Quote
  #2  
Old April 18th, 2004, 07:57 PM
nycztonee nycztonee is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: New York City
Posts: 62 nycztonee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 sec
Reputation Power: 5
can you supply a link to the page you are referring to? i'll take a look at it and see if i can find a solution.

Reply With Quote
  #3  
Old April 18th, 2004, 08:32 PM
fuzic fuzic is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 10 fuzic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
try aligning it with a div tag...

<div align="center">Text goes hur</div>

Reply With Quote
  #4  
Old April 18th, 2004, 08:48 PM
jwfc jwfc is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 97 jwfc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 19 m 18 sec
Reputation Power: 6
i'm doing the page on my home computer so it's not on the net. but it looks something like this:

http://athletics.ucsd.edu/roster/player.php?id=588

where the name says "Robert Eap", i want that in the middle.


fuzic- tried the div, that does not work. thanks.

Reply With Quote
  #5  
Old April 18th, 2004, 09:02 PM
fuzic fuzic is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 10 fuzic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
did you try this EXACTLY...

<SPAN style="font-size: 28pt; font-family: arial, helvetica; padding: 3px;">

<div align="center">Robert Eap</div>

</SPAN>

Reply With Quote
  #6  
Old April 18th, 2004, 09:11 PM
Nunzio390's Avatar
Nunzio390 Nunzio390 is offline
Insignificant Peon
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Tharsis Ridge (Martian lowlands)
Posts: 194 Nunzio390 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 38 m 55 sec
Reputation Power: 6
OK. Let's go back to the first post in this thread, and work with the example posted there.

First this style within the <head></head> tags (or in an external stylesheet)...

<style type="text/css">
.param1 {text-align: center; font-size: 14pt; font-family: arial black, helvetica; padding: 3px}
.param2 {text-align: left; font-size: 14pt; font-family: arial black, helvetica; padding: 3px}
.param3 {text-align: right; font-size: 14pt; font-family: arial black, helvetica; padding: 3px}
.table1 {text-align: right; width: 100%; border: solid black 2px}
</style>

Then these examples of text-align center, left and right, anywhere after the <body> tag...

<table class="table1"><tr>
<td><div class="param1">text center-aligned</div></td>
</tr></table>

<table class="table1"><tr>
<td><div class="param2">text left-aligned</div></td>
</tr></table>

<table class="table1"><tr>
<td><div class="param3">text right-aligned</div></td>
</tr></table>

Here is a working example uploaded temporarily to my server.

Reply With Quote
  #7  
Old April 18th, 2004, 09:25 PM
jwfc jwfc is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 97 jwfc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 19 m 18 sec
Reputation Power: 6
thanks, works like a charm

Reply With Quote
  #8  
Old April 18th, 2004, 09:31 PM
Nunzio390's Avatar
Nunzio390 Nunzio390 is offline
Insignificant Peon
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Tharsis Ridge (Martian lowlands)
Posts: 194 Nunzio390 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 38 m 55 sec
Reputation Power: 6
Yer welcome

Reply With Quote
  #9  
Old April 19th, 2004, 06:43 AM
Akh's Avatar
Akh Akh is offline
|<.+#f@#+.&.|
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2002
Location: norway
Posts: 2,648 Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Weeks 6 Days 14 h 40 m 32 sec
Reputation Power: 571
Quote:
Originally Posted by fuzic
did you try this EXACTLY...

<SPAN style="font-size: 28pt; font-family: arial, helvetica; padding: 3px;">

<div align="center">Robert Eap</div>

</SPAN>


this isn't valid html,
an inline element cannot contain a block-level element,

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS text and font help please


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway