2014-01-29 88 views
0

這是我的搜索欄和按鈕的代碼。我使用的圖片作爲背景,並想輸入域邊界dissappear,但它似乎並不奏效輸入字段周圍的不可見邊框不起作用

.masthead-search input[type=search] { 
background: url(http://localhost:6868/wp-content/uploads/2014/01/search-button11.png) no-repeat; 
float: left; 
border: 1px solid #fff; 
font-size: 11px; 
padding: 0 10px; 
width: 130px; 
height: 28px; 
line-height: 28px; 
border: none; 
-webkit-appearance: none; 
border-radius: 10px;} 

這是我在php文件中的代碼爲WordPress:

<input type="search" class="field" name="s" style="border: 1px #fff;"value="<?php echo esc_attr(get_search_query()); ?>" id="s" placeholder="<?php echo esc_attr_x('Search &hellip;', 'placeholder', 'wpex'); ?>"/> 

回答

0

你在你的CSS兩個邊界的定義:

.masthead-search input[type=search] { 
.... 
border: 1px solid #fff; 
... 
.... 
border: none; 
-webkit-appearance: none; 
border-radius: 10px;} 

,並應用到你的領域(其中缺少一個參數)樣式:

<input type="search" class="field" name="s" style="border: 1px #fff;" 

瀏覽器應該做什麼?他可能會用最後一個,即1px邊框。

+0

哎呀我剛剛擺脫了一個邊界的定義,但它似乎仍然沒有奏效! – user3219859

+0

跟隨:'

+0

yupp我正在嘗試它,但它似乎對我的搜索欄沒有任何影響。定義是否可以在另外一個位置而不是這兩個位置? – user3219859

0

試試這個

.masthead-search input[type=search] { 
background: url("http://localhost:6868/wp-content/uploads/2014/01/search-button11.png") no-repeat; 
float: left; 
border: 1px solid #fff; 
font-size: 11px; 
padding: 0 10px; 
width: 130px; 
height: 28px; 
line-height: 28px; 
border: none; 
-webkit-appearance: none; 
border-radius: 10px;} 
+0

在一個塊中還有兩種不同的邊界定義? –