paulq
07-10-2006, 06:36 PM
I was wondering if anyone could help me in figuring out properly superimposing text over an image using XHTML and CSS. My goal is to display text of varying length (generated in PHP) centered over an image on a web page to be printed. This web page
http://www.htmlgoodies.com/tutorials/web_graphics/article.php/3480021
shows three ways to do this but none fit my exact needs.
The first method (making the image a background) would be perfect except that I need these images to persist when the user prints the page. The second method doesn't seem to work at all.
The third method uses absolute positioning which would work well except I need to center align a variable-length string of text (using PHP). So the best choice I have found is relative positioning of the text but that offers a downfall as well; the CSS moves the text exactly where I need it (centered and all) however, it leaves a blank space where the text originally was causing there to be large gaps in my page.
Does anyone have any tips for a neophyte web designer or a workaround to achieve the proper layout?
http://www.htmlgoodies.com/tutorials/web_graphics/article.php/3480021
shows three ways to do this but none fit my exact needs.
The first method (making the image a background) would be perfect except that I need these images to persist when the user prints the page. The second method doesn't seem to work at all.
The third method uses absolute positioning which would work well except I need to center align a variable-length string of text (using PHP). So the best choice I have found is relative positioning of the text but that offers a downfall as well; the CSS moves the text exactly where I need it (centered and all) however, it leaves a blank space where the text originally was causing there to be large gaps in my page.
Does anyone have any tips for a neophyte web designer or a workaround to achieve the proper layout?