无法在文本框内键入文本

时间:2017-01-20 07:55:49

标签: html css

  test() {
    console.log('Search button clicked!!!');
  }
.container-4{
//   overflow: hidden;
//   width: 300px;
  vertical-align: middle;
  white-space: nowrap;
   position: absolute; 
   top: 270px; 
   left: 300px; 
   width: 100%; 
   // z-index: 9;
}

.container-4 input#search{
  width: 700px;
  height: 50px;
  background: white;
  border: 2px solid #045697;
  font-size: 10pt;
  float: left;
  color: #65737e;
  padding-left: 15px;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  border-radius: 5px;
  margin-top:15px;
//    z-index: 10;
}

.container-4 button.icon{
  -webkit-border-top-right-radius: 5px;
  -webkit-border-bottom-right-radius: 5px;
  -moz-border-radius-topright: 5px;
  -moz-border-radius-bottomright: 5px;
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
 
  border: 2px solid #045697;
  background: #eee;
  height: 50px;
  width: 50px;
  color: #045697;
  opacity: 0;
  font-size: 10pt;
  margin-top:15px;
 
  -webkit-transition: all .55s ease;
  -moz-transition: all .55s ease;
  -ms-transition: all .55s ease;
//   -o-transition: all .55s ease;
  transition: all .55s ease;
}

.container-4 input#search::-webkit-input-placeholder {
   color: #65737e;
}
 
.container-4 input#search:-moz-placeholder { /* Firefox 18- */
   color: #65737e;  
}
 
.container-4 input#search::-moz-placeholder {  /* Firefox 19+ */
   color: #65737e;  
}
 
.container-4 input#search:-ms-input-placeholder {  
   color: #65737e;  
}

.container-4 button.icon, .container-4:active button.icon, .container-4:focus button.icon{
    outline: none;
    opacity: 1;
    margin-left: -50px;
    background: white;
  }
 
  .container-4 button.icon:hover{
    background: white;
  }

.container-4{

   left: 400px; 
}

.container-4{

    left: 30px; 
    top: 130px; 

}

.container-4{

    left: 5px; 
    top: 60px; 

}

.container-4 input#search{
    width:415px;
}

.container-4 input#search{
    width:365px;
}

.container-4 input#search{
    width:310px;
    font-size:13px!important;
}

.container-4{

    left: 5px; 
    top: 50px; 

}

.container-4{

    left: 5px; 
    top: 40px; 
}
  <div class="container-4">
    <input class="form-control searchbar" type="text" id="search" placeholder="Discover more about any career you like" />
    <button (click)="test()" class="icon"><i class="fa fa-search"></i></button>
    
  </div>

我无法在Chrome浏览器的文本框中键入文本,但是当我从其他页面导航时,它可以正常工作。相同的代码在IE上工作正常,有时在Firefox中。

这是我的HTML代码:----------------------------------------- -----------------

 <div class="container-4">
    <input class="form-control searchbar" type="text" id="search" placeholder="Discover more about any career you like" />
    <button (click)="test()" class="icon"><i class="fa fa-search"></i></button>
  </div>

这是我的css:------------------------------------------ -----------------------

.container-4{
//   overflow: hidden;
//   width: 300px;
  vertical-align: middle;
  white-space: nowrap;
   position: absolute; 
   top: 270px; 
   left: 300px; 
   width: 100%; 
   // z-index: 9;
}

.container-4 input#search{
  width: 700px;
  height: 50px;
  background: white;
  border: 2px solid #045697;
  font-size: 10pt;
  float: left;
  color: #65737e;
  padding-left: 15px;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  border-radius: 5px;
  margin-top:15px;
//    z-index: 10;
}

.container-4 button.icon{
  -webkit-border-top-right-radius: 5px;
  -webkit-border-bottom-right-radius: 5px;
  -moz-border-radius-topright: 5px;
  -moz-border-radius-bottomright: 5px;
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;

  border: 2px solid #045697;
  background: #eee;
  height: 50px;
  width: 50px;
  color: #045697;
  opacity: 0;
  font-size: 10pt;
  margin-top:15px;

  -webkit-transition: all .55s ease;
  -moz-transition: all .55s ease;
  -ms-transition: all .55s ease;
//   -o-transition: all .55s ease;
  transition: all .55s ease;
}

.container-4 input#search::-webkit-input-placeholder {
   color: #65737e;
}

.container-4 input#search:-moz-placeholder { /* Firefox 18- */
   color: #65737e;  
}

.container-4 input#search::-moz-placeholder {  /* Firefox 19+ */
   color: #65737e;  
}

.container-4 input#search:-ms-input-placeholder {  
   color: #65737e;  
}

.container-4 button.icon, .container-4:active button.icon, .container-4:focus button.icon{
    outline: none;
    opacity: 1;
    margin-left: -50px;
    background: white;
  }

  .container-4 button.icon:hover{
    background: white;
  }

.container-4{

   left: 400px; 
}

.container-4{

    left: 30px; 
    top: 130px; 

}

.container-4{

    left: 5px; 
    top: 60px; 

}

.container-4 input#search{
    width:415px;
}

.container-4 input#search{
    width:365px;
}

.container-4 input#search{
    width:310px;
    font-size:13px!important;
}

.container-4{

    left: 5px; 
    top: 50px; 

}

.container-4{

    left: 5px; 
    top: 40px; 
}

0 个答案:

没有答案