Solved

simple layer question in php

Posted on 2009-04-03
3
182 Views
Last Modified: 2012-05-06
hi a,

I got a question as regards echoing from php onto my html page. As you can see, the left position is 10 for all three divs. It regards 10 as 10 pixels to the right of the last div. I want it to be 10 pixels to the right of absolute position (0,0). Otherwise when I position stuff on my page I will eventually be using stuff like left:-100: etc. Not good.

Where am I going wrong? Can anyone correct me? (Obviously for the end result I won't have them all at left:10; this is just for illustration. Thanks. )
echo "<div style='position:absolute; left:10; top:10; width:700px;'>
<p style=' font-family:Verdana; font-size: 12pt'><b>Training record for ".$userref." ".$brand." ".$branchID.".</b></p>
<div>";
 
echo "<div style='position:absolute; left:10; top:40; width:150px;'><p style=' font-family:Verdana; font-size: 12pt'><b>some text</b></p><div>";
 
echo "<div style='position:absolute; left:10; top:40; width:200px;'>
<p style=' font-family:Verdana; font-size: 12pt'>Training Courses</p>
<div>";

Open in new window

0
Comment
Question by:RupertA
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Expert Comment

by:SirBrisc
ID: 24060932
try instead of absolute -> relative and play with it
0
 
LVL 34

Accepted Solution

by:
Beverley Portlock earned 500 total points
ID: 24060969
You are not closing your DIVs. It should be </div>

echo "<div style='position:absolute; left:10px; top:10px; width:700px;'>
<p style=' font-family:Verdana; font-size: 12pt'><b>Training record for ".$userref." ".$brand." ".$branchID.".</b></p>
</div>";
 
echo "<div style='position:absolute; left:10px; top:40; width:150px;'><p style=' font-family:Verdana; font-size: 12pt'><b>some text</b></p></div>";
 
echo "<div style='position:absolute; left:10px; top:80; width:200px;'>
<p style=' font-family:Verdana; font-size: 12pt'>Training Courses</p>
</div>";
0
 

Author Comment

by:RupertA
ID: 24061100
ah dang it - lol - u are absolutely right bportlock. What a silly mistake to make.

Thanks - points given.
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question