locked
standard aspx page: form tag problem RRS feed

  • Question

  • User1281392227 posted

    In my understanding the form tag should not be visible or have any effect on the display of the screen, but for some reason I got a strange problem with this page:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    	<title>test</title>
    	<style type="text/css">
    body
    {
    	margin:0px;
    	padding:0px;
    	background-color:red;
    }
    	</style>
    </head>
    	<body topmargin="0" leftmargin="0">
    		<form name="form1" method="post" action="Workflow0_Screen0.aspx" id="form1">
    			<div id="Toolbar0" style="background-color:#e1e1e1;height:26px;">
    				<img src="ico24_exit.gif" style="border-width:0px;border:solid 1px black;" />
    			</div>
    			<div>
    				test
    			</div>
    		</form>
    	</body>
    </html>
    

    The div "Toolbar0" should appear on top of the page without any padding or margin, but there is always one empty line before it starts. If I take away the form tag it is on top of the page without any margins. Is this a bug of some kind or do I have a typo somewhere? I do not see anything wrong with this little sample page.

    The device I am using for testing is a iPaq 43335 with Windows CE 4.2.

    Any help please!?

    Sunday, August 26, 2007 7:09 PM

Answers

  • User-821639555 posted

    First of all, take out the "topmargin='0' leftmargin='0'" thing out of your body tag... secondly, change your CSS to this:

    body
    {
        margin: 0;
        padding: 0;
        background: #f00;
    }

    form
    {
        margin: 0;
        padding: 0;
    }

    Peace,

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, August 26, 2007 9:32 PM

All replies

  • User-821639555 posted

    First of all, take out the "topmargin='0' leftmargin='0'" thing out of your body tag... secondly, change your CSS to this:

    body
    {
        margin: 0;
        padding: 0;
        background: #f00;
    }

    form
    {
        margin: 0;
        padding: 0;
    }

    Peace,

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, August 26, 2007 9:32 PM
  • User1281392227 posted

    I did add the topmargin and leftmargin during my experiments to figure out why it does not work. I guess I have to buy a CSS book, I thought the unit is always mandatory.

    But it works now, thanks!

    Monday, August 27, 2007 10:53 AM
  • User-821639555 posted

    Glad I could help (I love CSS)!

    I'd recommend you read this wonderful article: http://www.singingeels.com/Articles/How_To_Pure_CSS_Design.aspx

    It was written by an incredibly good looking developer. (j/k, but it is a good read if you're getting into CSS some more)

    Tuesday, August 28, 2007 10:36 AM