Apply CSS to a button

Asked

Viewed 451 times

2

In the company where I work we have an ERP system, and I am passing some things to the Web, but in the system there is a button 'inside' an input that is already proper to the Dataflex language

inserir a descrição da imagem aqui

How do I make this look or alluding to being inside the input so users don’t notice so many differences ?

<div class="col-lg-10"><!-- Inicio Input Descrição -->
    <label for="ex1">Descrição:</label><button type="button" data-toggle="modal" data-target="#meuModal">...</button>
    <input type="text" required class="form-control descricao-input" style="text-transform:uppercase" maxlength="20"  name="descri"><br>
</div>

2 answers

3

You are using correct bootstrap ? need to indicate a .input-group.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>

    <div class="input-group">
      <input type="text" class="form-control" placeholder="input com botão">
      <span class="input-group-btn">
        <button class="btn btn-secondary" type="button">Botão</button>
      </span>
    </div>

Below is related documentation: Documentation

  • thanks, met my need, in case there is no way to leave identical even, the closest possible would be this right. @Guilhermenascimento actually already have the bootstrap imported in the project, I will only add even the classes

  • @Victort. And the situation changes, this type of information is totally relevant to be added in the question. Now I do not recommend, because the author of the other question left in "pure CSS", but since he informed the use of this, then the answer of Anthraxisbr seems to me the best +1

  • I took the two forms to use, but thank you

  • I noticed that he used the bootstrap for the @Victort element classes. from a glance at the documentation I sent there, it has to look good yes, expands a little bit the input, and throws a margin to the left on the button, kind of mixing what I answered and what the caique answered

  • thanks, I’ll do it, but now I face another problem, on the screen I’m replicating has a checkbox on the side but when placing the checkbox the button is down input

  • @Victort. I recommend opening another question to this question.

Show 1 more comment

3


Thus the button is not inside the input but gives the feeling to the user.

.grupo {
  margin: 0;
  padding: 0;
}

button, input, label {
  float:left;
  border:0;
}


.input_button {
  margin-left:3px;
  border:1px solid black;
  float:left;
}
<div class="grupo col-lg-10">
  <label for="ex1">
    Código:
  </label>
  <div class="input_button">
    <input type="text" id="ex1"/>
    <button onclick="console.log('clique no botão do input');">
      ...
    </button>
  </div>
</div>

  • 1

    very good, simple and without needing external libs +1

  • thank you, attended my need

Browser other questions tagged

You are not signed in. Login or sign up in order to post.