PDA

View Full Version : Div positioning question.



Adder
Apr 9th, 2010, 09:53 AM
Hi all.

I have an email form on my site, the validation script is PHP and curently echo's the errors in a DIV.

The problem is that, it echo's the DIV at the top pf the page, messing up my layout.

How can I echo it in between two div's pushing one down.
(in between "Page Heading" & "textDiv")

Page. (http://www.rdfhsainty.com/feedBack2.php)
Code attached.

Thanks

Kor
Apr 9th, 2010, 12:13 PM
Simply put that "error" php code between those two divs, in the BODY, not between </head> and <body> as it is now.

A note: Your code is wrong. A legal HTML/XHTML document should follow the sequence:

Doctype
<html>
<head>
...
</head>
<body>
...
</body>
</html>

Adder
Apr 10th, 2010, 10:16 AM
Thanks man, I corrected the HTML errors (I think).

I updated my code as you said but it still dosn't work.

New code attached.

Any ideas?

Adder
Apr 11th, 2010, 07:41 AM
Sorry to be rude but, BUMP.

abduraooft
Apr 11th, 2010, 05:29 PM
I'd recommend you to get rid of all absolute positions (and all top/left properties) and then use margin:0 auto; to centre the block level elements.

Adder
Apr 12th, 2010, 07:16 AM
So use relative positioning?

Sorry for being so useless :)

abduraooft
Apr 12th, 2010, 10:26 AM
No, you don't have to use the CSS property position everywhere. Say, for your #header, he only the following is required.

div#header {
background:transparent url(images/banner_copy.jpg) repeat scroll 0;
height:130px;
/*left:50%;
margin:0 0 0 -390px;*/
padding:0;
/*position:absolute;*/
width:780px;
margin:0 auto;
}