Forum Moderators: not2easy

Message Too Old, No Replies

I have trouble with spaces

         

Lolalola

11:05 am on Aug 7, 2009 (gmt 0)



I have trouble with spaces, wher is php tag, i have spaces.
foto:
<snip>

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]

swa66

2:02 am on Aug 8, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It would be easier to have the generated html, not the php code used to generate it.

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
- ...

Lolalola

3:39 pm on Aug 12, 2009 (gmt 0)



This is generated html code:


<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>

D_Blackwell

11:52 pm on Aug 12, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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.

MarrkoR

4:48 pm on Aug 17, 2009 (gmt 0)

10+ Year Member



I can not add links, it can not accurately show the.

Befor the <form> has a space.
After form i delete space wiht:
form {
margin: 0;}

No page looks like:
-----------
text
<space>

username:
password:
....
-------------