Solved

simple layer question in php

Posted on 2009-04-03
3
180 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
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: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP Installer 5 37
Logic behind "best rated" calculation 11 30
Custom Wordpress Loop 22 38
AWK: How to strip all double quotes from a file? 7 24
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

809 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