Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Закруглить поле поиска


Recommended Posts

1 час назад, ironzorin2 сказал:

Пытаюсь сделать как здесь

search.png.5beff29bfeaebb7a348d05b5f90d8773.png

 

Я так понимаю, что за него отвечает вот эти классы bootstrap 

class="form-control input-lg"

Но как их поменять?

<style>
#search .input-lg {
    border-radius: 30px;
}
</style>

Но вам не добиться желаемого результата без правок в html, т.к. есть ещё кнопка вне input. 

Link to comment
Share on other sites


Сделал так

<div id="search" class="input-group">
  <input type="text" name="search" value="<?php echo $search; ?>" placeholder="<?php echo $text_search; ?>" class="form-control input-lg" />
  <span class="input-group-btn">
    <button type="button" class="btn button-search"><i class="fa fa-search"></i></button>
  </span>
</div>

<style>
#search .input-lg {
    border-radius: 30px;
}

.button-search {
  width: 1.2em;
  position: relative;
  left: -4em;
  vertical-align: middle;
  background:none;
  border:0;
  
}
</style>

Единственное, что коряво - при нажатии появляется рамка.

Link to comment
Share on other sites


Полный код

<div id="search" class="input-group">
  <input type="text" name="search" value="<?php echo $search; ?>" placeholder="<?php echo $text_search; ?>" class="form-control input-lg" />
  <span class="input-group-btn">
    <button type="button" class="btn button-search"><i class="fa fa-search"></i></button>
  </span>
</div>

<style>
#search .input-lg {
    border-radius: 30px;
}

.button-search {
  width: 1.2em;
  position: relative;
  left: -4em;
  vertical-align: middle;
  background:none;
  border:0;
  outline: none !important;
  
}
</style>

 

Поиск.png

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.