Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old August 15th, 2008, 11:30 PM
Newbie
 
Join Date: Aug 2008
Posts: 2
Default How do I get text to stay in relation to the page

This may seem very basic but I am just learning all this stuff. I have text that
I want to stay centered within my background image. When I resize the window it moves over my image. Is there a way to make it stay centered when i resize the window?
Reply
  #2  
Old August 15th, 2008, 11:42 PM
drhowarddrfine's Avatar
Expert
 
Join Date: Sep 2006
Posts: 4,616
Default

It is easy but the fix depends on how you wrote it so we need to see the markup.
Reply
  #3  
Old August 15th, 2008, 11:50 PM
Newbie
 
Join Date: Aug 2008
Posts: 2
Default

This is my css/html for the page. I am new at this and am still learning so if you can explain what I need to do that would be very helpful. If I am doing it all wrong please let me know. Thanks
Expand|Select|Wrap|Line Numbers
  1. @charset "UTF-8";
  2. #Blog {
  3.     position: absolute;
  4.     top: 59%;
  5.     right: 58%; z-index:2; font:Georgia, "Times New Roman", Times, serif;
  6.     font-size: 21px;
  7. }
  8. #BG {z-index: 1;}
  9. #Classes {
  10.     position: absolute;
  11.     top: 68%;
  12.     right: 52%;
  13.     z-index:2;
  14.     font-size: 22px;
  15. }
  16. #Gallery {
  17.     position: absolute;
  18.     top: 59%;
  19.     right: 39%;
  20.     z-index:2;
  21.     height: 35px;
  22.     font-size: 22px;
  23. }
  24. #AboutUs {
  25.     position: absolute;
  26.     top:68%;
  27.     right: 34%;
  28.     z-index:2;
  29.     height: 35px;
  30.     font-size: 22px;
  31. }
  32.  
  33. #Mail {
  34.     position: absolute;
  35.     top: 76%;
  36.     right: 40%;
  37.     z-index:2;
  38.     height: 35px;
  39.     font-size: 22px;
  40. }
  41. #.width {width:100%; min-width:600px;}
  42. #.height {height:100%; min-width:532px;}
  43.  
  44. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  45. <html xmlns="http://www.w3.org/1999/xhtml">
  46. <head>
  47. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  48. <title>Untitled Document</title>
  49. <link href="website templates/untitled.css" rel="stylesheet" type="text/css" />
  50. <style type="text/css">
  51. <!--
  52. body {
  53. }
  54. -->
  55. </style></head>
  56.  
  57. <body>
  58. <div id="BG"><img src="website templates/background.jpg" width="100%" height="100%"/>
  59.   <div id="Blog"><a href=""><img src="website templates/flowerlink.gif">Blog</a></div>
  60. <div id="Classes"><img src="website templates/flowerlink.gif">Classes/Calendar</div>
  61. <div id="Gallery"><img src="website templates/flowerlink.gif">Photo Gallery</div>
  62. <div id="AboutUs"><img src="website templates/flowerlink.gif">About Us</div>
  63. <div id="Mail"><img src="website templates/flowerlink.gif">Join Our Mailing List</div>
  64.  
  65. </div>
  66. </body>
  67.  
  68. </html>

Last edited by eWish; August 16th, 2008 at 12:34 AM. Reason: Please use the [code][/code] tags
Reply
  #4  
Old August 17th, 2008, 11:08 PM
David Laakso's Avatar
Expert
 
Join Date: Aug 2008
Location: US
Posts: 302
Default

You'll have far better luck if you structure the page using floats rather than absolute positioning. Start with a layout that is known to be stable, robust, and cross-browser reliable. Here are some [1].

Code to compliant browsers-- Opera, Safari, Firefox. Make frequent check-backs to IE/6 and IE/7.

[1]
http://blog.html.it/layoutgala/
Reply
Reply

Bookmarks

Thread Tools

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

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles