473,385 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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?
Aug 15 '08 #1
3 2156
drhowarddrfine
7,435 Expert 4TB
It is easy but the fix depends on how you wrote it so we need to see the markup.
Aug 15 '08 #2
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>
Aug 15 '08 #3
David Laakso
397 Expert 256MB
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/
Aug 17 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Ralph Freshour | last post by:
I bought the PHP and MySQL For Dummies book and I'm having trouble understanding how I use PHP to verify and check forms input text data - the book shows snippets of code so I know how to do the...
14
by: MLH | last post by:
GHudson has working procedures posted at http://www.access-programmers.co.uk/forums/showthread.php?t=66320 They work. Relationships, however, and some minor default settings are not preserved....
6
by: Kevin Chambers | last post by:
Hi all-- In an attempt to commit an Access MDB to a versioning system (subversion), I'm trying to figure out how to convert a jet table's metadata to text, a la SaveAsText. The end goal is to...
16
by: Cory Nelson | last post by:
Does anyone know how std::set prevents duplicates using only std::less? I've tried looking through a couple of the STL implementations and their code is pretty unreadable (to allow for different...
12
by: tim | last post by:
I am using foldoutmenu 3 and am having problems with viewing my menus in firefox. On my sub3 menus i have more than one line of text in some places. firefox does not recognise that there is more...
5
by: Coll | last post by:
Hi - I have a function that returns a value to a text field. I need to bold a portion of the text field to match up with the rest of the form. I'd rather not split it into two separate text fields...
1
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being...
2
by: esperanto234 | last post by:
I have a document with 3 pages and with VB I always insert text in page 1. The problem is that the text in page 2 always goes down when text in page 1 is inserted. My question is: How can i do to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.