PDA

View Full Version : Text Position is wrong


YNWA
01-23-2008, 04:29 PM
Hi, I am creating a webpage and I have installed a background image. for which I have centred and all is fine.

I am now using layers to add text so I can place the text wherever I want.

But when I save and view in IE and Firefox the text is not in the correct position. I have tried a number of things to solve this all to no avail.

Please can someone help me.

The text I have so far is:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Liverpool Hope University - IT Deanery Book Sales</title>

<style type="text/css">
<!--
body {
background-image: url(template.png);
background-repeat: no-repeat;
background-attachment: fixed;
background-position:center center;
margin-top:0;
margin-bottom:0;
margin-left:0;margin-right:0;

}
#Layer3 {
position:absolute;
width:200px;
height:115px;
z-index:1;
left: 334px;
top: 115px;
}
-->
</style></head>

<body>
<div id="Layer3">
<p>I want my text here </p>
</div>
</body>
</html>

tux
01-24-2008, 01:02 PM
Can you post a screen shot of exactly where you are trying to position your text.

In IE, Firefox and Opera on my screen, your text is positioned as I expected it to be according to your code.

Regards, Paul

hmobley
01-25-2008, 01:26 AM
I have been trying to find ou this same issue for the longest time, if you optimize layers in dreamweaver for IE its going to be off in firefox, vise versa. So since IE has the largest share I go with IE, but it causes me no end of grief

Cary
01-25-2008, 04:19 AM
I have been trying to find ou this same issue for the longest time...

Did you ever see this post (http://www.dreamweaverclub.com/forum/showthread.php?p=133654#post133654)?

mangofreak
01-27-2008, 03:31 PM
As far as I can see, you need to first create a div that will hold your Layer , then, you can set your position in relation to the div. If you only use one layer alone then it relates to the body. Does it make sense?

<div id="divShell">
<!-- layer -->

<div id="Layer3">
<p>I want my text here </p>
</div>

<!-- end layer -->
</div>

hmobley
01-27-2008, 04:50 PM
body {
background-color: #8D8B72;
margin: 0;
}


this worked for me so both firefox and IE are the same now, needed some slight tweaking