|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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> |
|
#2
|
|||
|
|||
|
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.
|
|
#3
|
|||
|
|||
|
try aligning it with a div tag...
<div align="center">Text goes hur</div> |
|
#4
|
|||
|
|||
|
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. |
|
#5
|
|||
|
|||
|
did you try this EXACTLY...
<SPAN style="font-size: 28pt; font-family: arial, helvetica; padding: 3px;"> <div align="center">Robert Eap</div> </SPAN> |
|
#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.
__________________
|
|
#7
|
|||
|
|||
|
thanks, works like a charm
![]() |
|
#8
|
||||
|
||||
|
Yer welcome
![]() |
|
#9
|
||||
|
||||
|
Quote:
this isn't valid html, an inline element cannot contain a block-level element, |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > CSS text and font help please |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|