?
Solved

simple layer question in php

Posted on 2009-04-03
3
Medium Priority
?
185 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 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
These days socially coordinated efforts have turned into a critical requirement for enterprises.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

777 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