2011-09-01 86 views

回答

0

因爲我不能給你做的絕對方式這讓我給你品嚐

HTML

<div class="search"> 
    <div class="listbox"> 
     <ul> 
      <li>Google</li> 
      <li>Yahoo</li> 
      <li>Bing</li> 
     </ul> 
    </div> 
    <input type="text" value="type here to search" /> 
    <a href="#" class="submitBtn"></a> 
</div> 

CSS

.search { 
    width:200px 
    position: relative; /* So you can position the other elements /* 
} 
.search .listBox { 
    position: absolute; 
    top:0; 
    left:0; 
    /* You will need to use javascript to open and close this one */ 
} 

.search input { 
    border: 1px solid #aaa; 
    padding-left: 50px; /*so you can have have your list on the left; 
    width: 150px; 
} 
.search .submitBtn { 
    position: absolute; 
    top: 2px; 
    right: 5px; 
    display: block; 
    width: 25px; 
    height: 25px; 
    background-image: url (img.png); 
} 

這是非常通用的,但會讓你開始

相關問題