Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 单击时div的宽度已更改_Html_Css - Fatal编程技术网

Html 单击时div的宽度已更改

Html 单击时div的宽度已更改,html,css,Html,Css,我目前正在一个网站上工作。 我有一个特定的div,应该粘贴在content div的右侧,我注意到了一个非常奇怪的问题 当您单击div中的一个链接时,div的宽度将改变并变宽。为什么会这样 <div style="float:right;"> <br /><br /><br /><br /> <div id="login"> <form method="post">

我目前正在一个网站上工作。 我有一个特定的
div
,应该粘贴在content div的右侧,我注意到了一个非常奇怪的问题

当您单击
div
中的一个链接时,
div
的宽度将改变并变宽。为什么会这样

<div style="float:right;">
    <br /><br /><br /><br />
    <div id="login">

        <form method="post">
            <table>
                <tr>
                    <td>Welcome Test Test<br />Click <a href='#'>here</a> for admin.!</td>
                </tr>
                <tr>
                    <td>You are logged.</td>
                </tr>
                <tr>
                    <td><a href="#">Edit your details.</a></td>
                </tr>
                <tr>
                    <td><input type="submit" name="logout" value="Logout" /></td>
                </tr>
            </table>
        </form>
    </div>
</div>






欢迎测试
点击查看管理员。! 您已登录。


谢谢。

将登录填充从5%更改为5px

从主div或登录类中删除float:right似乎可以解决问题


在两个浏览器上都使用它是有原因的还是偶然的?

哪个浏览器显示了您看到的问题?我认为它解决了问题,但为什么要这样做?不知道为什么,看起来只有chrome才会这样。好吧,酷,我想您是在尝试做一些奇怪的花哨的事情!英雄联盟