Chrome输入文字宽度

时间:2013-07-03 18:11:27

标签: css google-chrome text input width

我遇到了Chrome的问题,我输入的宽度为250px,但在浏览器Chrome浏览器中,宽度总是与其他浏览器不同,例如在firefox中效果很好,在IE7中也是如此。

我还有一个css重置,就是这个:http://pastebin.com/jQVxwQqq

input[type="text"], input[type="password"]{
    width: 210px;
    height: 28px;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
    background-color: #292929;
    -webkit-box-shadow: 0 1px rgba(255,255,255,.25), inset 0 1px 1px #000;
    -moz-box-shadow: 0 1px rgba(255,255,255,.25), inset 0 1px 1px #000;
    box-shadow: 0 1px rgba(255,255,255,.25), inset 0 1px 1px #000;
    border: solid 1px #000;
    background-image: -webkit-linear-gradient(top, #222, #333);
    background-image: -moz-linear-gradient(top, #222, #333);
    background-image: -o-linear-gradient(top, #222, #333);
    background-image: -ms-linear-gradient(top, #222, #333);
    background-image: linear-gradient(to bottom, #222, #333);

    font-size: 11px;
    color: #fff;
    text-shadow: 1px 1px #000;
    padding-left:5px;
    padding-right: 5px;
}

<input type="text" class="username">

Chrome和Firefox: http://oi43.tinypic.com/fo0vq.jpg

我该如何解决这个问题?

修改

我想如果我从页面顶部删除这个php代码就会发现问题它会起作用

<?php
    include "core/functions.php";

    if(logged())
    {
        header("Location: index.php");
        exit();
    }

?>

芯/ functions.php的:

<?php
    session_start();

    function logged() {
        if(isset($_SESSION['username']))
        {
            return true;
        }
    }
?>

我仍然不知道为什么以及如何解决它......

编辑2:

好的,我已经找到了解决方法,这就是我所做的:

我有这个:

<?php
    include("core/functions.php");

    if(logged())
    {
        header("Location: index.php");
        exit();
    }

?>
<!DOCTYPE HTML>

我改变了这个:

<!DOCTYPE HTML>
<?php
    include("core/functions.php");

    if(logged())
    {
        header("Location: index.php");
        exit();
    }

?>

这似乎有效,我不知道为什么,如果有人能向我解释我很感激。无论如何,谢谢你的帮助;)

0 个答案:

没有答案