0

我设计了我的搜索引擎网站的首页,我在网站建设期间在 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>
4

1 回答 1

0

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

在此处查看 JSFiddle

form
{
    text-align:center;  
}

或(不好的做法.. 使用 CSS 而不是内联样式

改变:

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

至:

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

这在 Firefox、Safari 和 Chrome 上按预期工作。

查看工作中的 JSFiddle(单击此处)

于 2013-07-29T15:10:27.167 回答