2013-12-23 38 views
0

我試過調整CSS編碼,並沒有佔上風。事情要:隨着5px的 無法更改搜索框屬性

  • 邊界半徑

    • 搜索框,放大使用了得到它dispalced
    • 兩個搜索框和搜索圖標均勻擺放周圍的DIV

    HTML搜索圖標CODE:

     <div class="search" 
         <div class="searchbox"> 
          <form action="/search" method="get" class="search_form"> 
          <input type="text" value="Search Blog..." class="search_text" name="q"> 
          <input type="image" src="http://s25.postimg.org/d3fu892zz/search_button_without_text_md.png" height="20" width="20"class="button"> 
          </form> 
         </div> 
        </div> 
    

    CSS代碼:

    .search{position:fixed; 
        height:25px; 
        width:194px; 
        top:189px; 
        left:14px; 
        border:2px solid black; 
        background-color:black; 
        border-radius:10px; 
        padding-left:2px; 
        padding-bottom:4px; 
        opacity:.8;} 
    
  • +0

    我沒有看到很多的HTML代碼中定義的類,在你的CSS將EgClass =「search_form」 類=「SEARCH_TEXT」 類=「按鈕」 此外,在您的按鈕代碼上課前應該有一個空格字符=「按鈕」 –

    +0

    你好。是的,那是我的問題。我有這麼多的課程和id我不知道哪一個是哪個。但我現在明白了。謝謝!我只需要記住具體的課程和ID,所以我不把它們混合在一起 –

    回答

    0

    注意:Your class =「search」div is not closed !!

    下面是應該工作和fullfill你所有的三個條件

    <div class="search"> 
    <div class="searchbox"> 
        <form action="/search" method="get" class="search_form"> 
         <input type="text" value="Search Blog..." class="search_text" name="q"> 
    <input type="image" src="http://i42.tinypic.com/fayl43.png" class="button"> 
        </form> 
    </div> 
    

    CSS代碼代碼:

    .search{position:absolute; 
    height:28px; 
    width:190px; 
    top:140px; 
    left:100px; 
    border:2px solid black; 
    background-color:black; 
    border-radius:10px; 
    padding-left:2px; 
    padding-bottom:4px; 
    opacity:.8; 
    } 
    
    form#input{ 
        display:inline-block; 
    } 
    
    .searchbox{ 
    
    } 
    
    .search_text{ 
        margin-top:4px; 
        margin-left:5px; 
        border-radius:5px; 
        text-align:center; 
    } 
    
    .button{ 
        margin-top:5px; 
        margin-left:2px; 
        position:absolute; 
        height:20px; 
        width:20px; 
    } 
    .button:hover{ 
        -webkit-transform:scale(1.3); 
          -moz-transform:scale(1.3); 
          -o-transform:scale(1.3); 
          opacity: 3; 
    
    } 
    

    工作的jsfiddle演示 - http://jsfiddle.net/vg8Mn/

    希望這有助於:)

    +0

    「搜索博客...」居中使得它更整潔!謝謝 –