Forum Moderators: not2easy
If i delete: require("connect_db.php");
and
<form method = "post">
...
Everything ok. How i can remowe this space?
And why "New user" in ner rows?
<?php
session_start();
require("connect_db.php");
?>
<html>
<head>
<style type="text/css">
body {
margin:0;
margin-top: 0;
margin-bottom: 0;
text-align: center;
}
div.body2{
width: 666px;
background-color: #e43546;
}
</style>
</head>
<body>
<div class = "body2">
<?php echo 'Text, text<br>'; ?>
<?php
echo '
<form method = "post">
Name: <input type = text name = name>
Pass: <input type = password name = password>
<input type = submit id = login value = login>
</form>
<a href = "reg.php">New user</a>
';
?>
<?php echo 'Text, text<br>'; ?>
</div>
</body>
</html>
Thanks for help
[edited by: swa66 at 1:58 am (utc) on Aug. 8, 2009]
[edit reason] No links, please see ToS and Forum Charter [/edit]
I'd check a few things:
- any output before the html done by your scripts ?
- try getting the browsers out of quirks mode (use a full doctype -for IE6: with nothing in front of it)
- try resetting margins and padding on the form
- ...
<html>
<head>
<style type="text/css">
body {
margin:0;
margin-top: 0;
margin-bottom: 0;
text-align: center;
}
div.body2{
width: 666px;
background-color: #e43546;
}
</style>
</head>
<body>
<div class = "body2">
Text, text<br>
<form method = "post">
Name: <input type = text name = name>
Pass: <input type = password name = password>
<input type = submit id = login value = login>
</form>
<a href = "reg.php">New user</a>
Text, text<br>
</div>
</body>
</html>
How i can remowe this space?
I am not clear as to what space you want removed. Please clarify.
Regarding: And why "New user" in ner rows?
You are closing the <form>, which is a block level element. Therefore, the link that follows is shifting down the page; as it should.
Note: You should fix the margin declaration in the body. {margin: 0;} is setting 0 top, right, bottom, and left. To follow that with margin-top: and margin-bottom: in the same declaration is looking for trouble.
Note: I would quote the values in the input elements.