Solved

simple layer question in php

Posted on 2009-04-03
3
181 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

733 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