不同的浏览器HTML对齐

时间:2013-07-29 14:56:44

标签: html css twitter-bootstrap browser alignment

我设置了搜索引擎网站的首页,我在网站构建期间在Chrome中使用它。

我刚刚在Firefox和IE中对网站进行了测试,收音机框和搜索框/按钮左对齐,这不是我希望它们如何显示,我该怎么解决这个问题?

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

<meta name="view-part" content="width=device-width, inital-scale =1.0">
<title> Clear Shot Results </title>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/bootstrap-responsive.css">
</head>

  <body>
<div class="navbar navbar-fixed-top">
  <div class="navbar-inner">


    <a href="#" class="brand">Clear Shot Results </a>
    <div class="nav-collapse collapse">
      <ul class="nav pull-right">
        <li  >  <a href='evaluation_form.php'>Survey</a></li>
        <li>  <a href='about.html'>About Us</a></li>
         <li     calss ="active">  <a href='#'>Home</a></li>
</div>
</div>
</div>
              </br>
            </br>
           </br>
   <form method="GET" action="" align="center">
   <div style="text-align: center;"><img border="0" src="sight.jpg" alt="Sniper" width="150" height="150"></div>



           </br>
           Aggregated 
            <input type="radio" name="choice" value="AGG"checked  >&nbsp
            Non-aggregated
             <input type="radio" name="choice" value="NonAGG" >&nbsp
             Blekko 
            <input type="radio" name="choice" value="Blekko" >&nbsp
              Bing                     
            <input type="radio" name="choice" value="Bing">&nbsp
            Google
            <input type="radio" name="choice" value="Google"><br />

            </br>
            </br>
            <input name="query" type="text" size="60" maxlength="60" value="<?php

if(isset($_GET["query"]))
   echo $_GET["query"];

?>" /><br />

            <input  class="btn btn-primary btn-large"  type="submit" value="Search" />
            </form>
            <form method="GET" action="" align="center">
            </br>
            </br>

1 个答案:

答案 0 :(得分:0)

您需要将text-align:center CSS属性添加到表单中。

View the JSFiddle here

form
{
    text-align:center;  
}

OR(不良做法..使用CSS代替内联样式

变化:

<form method="GET" action="" align="center">

收件人:

<form method="GET" action="" style="text-align:center;">

这在Firefox,Safari&amp;铬。

<强> View the working JSFiddle (Click here)