首页 > 解决方案 > 放在前面 - 搜索栏 HTML

问题描述

我知道这可能与 z-index 有关,但我似乎无法弄清楚。代码片段是:

<form method="get" action="http://www.google.com/search"> 
    <div> 
        <table border="0" cellpadding="0"> 
            <tr>
                <td> 
                    <input type="text" name="q" size="15" maxlength="255" value="" /> 
                    <input type="submit" value="GO" /></td></tr> <tr><td align="right" style="font-size:75%"> 
                    <input type="checkbox" name="sitesearch" value="<website_address>" checked /> SEARCH <br /> 
                </td>
            </tr>
        </table> 
    </div> 
</form>

两个块重叠到搜索栏中

我试过创建一个类,但它似乎不影响它:

.search{
    z-index:absolute;
    
}
<form method="get" action="http://www.google.com/search"> <div class="search">

在将搜索栏置于最前面并进行了相当多的实验时,我还没有找到太多信息。我可以尝试将其他人放在后面,但我真的很好奇是否有办法将搜索栏放在前面。

标签: javascripthtmlcssweb

解决方案


推荐阅读