-1

我无法让搜索框看起来像我想要的那样。

http://i39.tinypic.com/e8u8gn.jpg

我的 CSS 代码:

#searchform {
position: relative;
padding: 5px;
}

HTML 代码:

<body class="home">
<div id="container">
<header id="masthead">
<h1><p>Testing</p></h1></header>
<nav class="nav-buttons" id="primary">
<ul>                 
<li id="search" style="padding-left:400px;">
<form id="searchform" action="http://www.Google.com/" method="get"><label class="screen-  reader-text" for="s"> 
</label><input id="s" type="text" placeholder="Type your search here" name="s" value="">  </input><input id="searchsubmit" type="submit" value="Search"></input></form></li>

</ul>
</nav>
4

2 回答 2

1

Check this Fiddle

HTML

<div>
    <input type="text">
</div>

CSS

div {
    background: #e1e1e1;
    padding: 20px;
}
input {
    padding: 5px 5px;
    width: 300px;
    height: 30px;
    font-size: 16px;
    border: 1px solid #ccc;
    padding-right: 50px;
    background: #fff url(http://png.findicons.com/files/icons/1389/g5_system/16/toolbar_find.png) no-repeat;
    background-position: 330px center;
}
input:focus {
    border: 1px solid #ccc;
}
于 2013-09-07T03:04:43.153 回答
0

CSS

.hey { border:1px solid #efefef; padding:7px; font:normal 14px Tahoma; }

HTML(改成这个)

<input id="s" class="hey" type="text" placeholder="Type your search here" name="s" value="">  </input>
<input id="searchsubmit" type="image" src="search.gif"</input></form></li></input>

享受!

于 2013-09-07T03:00:21.617 回答