html - Form displays differently in IE and Google Chrome -


in ie, code displays form inside top div, should:

<div style = 'height:100px;background-color:#ff6600'> <form name = "search" action = "search_result.php" method = "get" style = "text-align:right;"> <input type = "text" name = "query" id = "query" maxlength = "100"> <br /> <input type = "radio" value = "search users" name = "user" id = "user">&nbsp;<input type = "radio" value = "search topics" name = "topics" id = "topics"> <input type = "submit" value = "go"> </form> </div> 

but in chrome, displays form below div. why this, , how can fix it?

edit: omitted php code echos of html. here full code:

<!doctype html> <html> <body> <?php session_start(); $connect = mysql_connect('localhost','phpuser','mypss'); $db = mysql_select_db('phpuser'); echo "<div style = 'float:none;clear:both;height:100px;background-color:#ff6600'>"; if(isset($_session['user'])&&$_session['user']!="") { echo "<a href = 'userinfo.php'>".$_session['user']."</a>"; echo "&nbsp;"; echo "|&nbsp;"; echo "<a href = 'logout.php'>log out</a>&nbsp;"; echo "|&nbsp;"; } echo "<a href = 'home.php'>home</a>"; if(!isset($_session['user'])||$_session['user']=="") { echo "&nbsp;|&nbsp;"; echo "<a href = 'login.php'>log in</a>&nbsp;|&nbsp;"; echo "<a href = 'signup.php'>sign up</a>&nbsp;"; }  function trimtext($text) { $newtext = substr($text,0,15); $newtext .= "..."; return $newtext; } ?> <h1 style = "color:black">my blog</h1> <form name = "search" action = "search_result.php" method = "get" style = "text-align:right;"> <input type = "text" name = "query" id = "query" maxlength = "100"> <br /> <input type = "radio" value = "search users" name = "user" id = "user">&nbsp;<input type = "radio" value = "search topics" name = "topics" id = "topics"> <input type = "submit" value = "go"> </form> </div> </body> </html>  

do have float property applied elements nearer form? if case, try adding <div style="float: none; clear: both;"></div>

or

just remove form's parent div , apply div's styles form itself.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -