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"> <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 " "; echo "| "; echo "<a href = 'logout.php'>log out</a> "; echo "| "; } echo "<a href = 'home.php'>home</a>"; if(!isset($_session['user'])||$_session['user']=="") { echo " | "; echo "<a href = 'login.php'>log in</a> | "; echo "<a href = 'signup.php'>sign up</a> "; } 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"> <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
Post a Comment