我读了其他类似问题的帖子,但那里的内容都没有帮助到我。以下是针对此网站出现的问题:http://bit.ly/1gmeHtu
请看这张图片,其中蓝色部分有放大镜:
在Chrome中它看起来很完美。然而,当我插入一个高度CSS进行修复时,在Firefox中它被修复了,但是在Chrome中却出现了问题:
因此,我尝试改变文本的字体大小,但那也不起作用。我尝试了一些padding的方法,但也不行。现在我需要帮助。
以下是搜索框的代码:
![Firefox Browser](https://istack.dev59.com/TSD7F.webp)
![enter image description here](https://istack.dev59.com/YvnXE.webp)
以下是搜索框的代码:
<div class="test_line_1"><?php echo stripslashes(get_option('Pricerr_main_how_it_works_line1')) ?></div>
<div class="test_line_2"><?php echo stripslashes(get_option('Pricerr_main_how_it_works_line2')) ?></div>
<div class="test_line_3">
<form method="get" action="<?php echo get_bloginfo('url') ?>">
<input type="hidden" value="<?php echo get_option('PricerrTheme_advanced_search_id') ?>" name="page_id" />
<input type="text" name="term1" value="" id="big_search_m" placeholder="<?php _e('Search for services here...','PricerrTheme') ?>" />
<input type="image" src="<?php bloginfo('template_url') ?>/images/search_sel.png" id="search_magnifier" />
</form>
</div>
</div>
</div>
以下是这三个元素的CSS:
.test_line_3 {
margin: 40px auto auto;
height: auto;
display: inline-block;
border: 8px solid rgba(10, 10, 10, 0.8);
}
#big_search_m {
padding: 12px;
border: 0px none;
margin: 0px;
font-size: 20px;
width: 400px;
float: left;
}
#search_magnifier {
float: left;
}
我该如何修复这个问题?
编辑:搜索框中不包含 PHP 代码:
<div class="test_line_1"></div>
<div class="test_line_2"></div>
<div class="test_line_3">
<form method="get">
<input type="hidden" name="page_id" />
<input type="text" name="term1" value="" id="big_search_m" />
<input type="image" id="search_magnifier" />
</form>
</div>
</div>
</div>
test_line_2
和test_line_3
都设置为height: 100%
,这样它们都会填满test_line_1
的高度。 - Kevin Ni