O
O
Olga Mironova2019-06-10 08:07:31
css
Olga Mironova, 2019-06-10 08:07:31

Why are styles not being applied (flexbox)?

<div class = "wrapper">
  <input class = "input"/>
  <button class = "button"></button>
</div>

Please tell me, I don’t know flex very well, and I don’t understand why this behavior (...
1. I set the wrapper class to display: flex, my input and the button become in a row, then I style the input - styles are applied, but not applied on the button ( ((
.wrapper {
  display: flex;
}

.input {
  height: 25px;
  width: 300px;
  border: 1px solid #cecece;
  border-radius: 6px;
  outline: none;
  padding: 2px 5px;
  font-size: 15px;
};

.button {
  height: 25px;
  width: 120px;
  background-color: red;
  margin-left: 40px;
  cursor: pointer;
};

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rustam Bainazarov, 2019-06-10
@olgamiro1990

The rule in CSS closes without a semicolon:

.class {
   color: #fff;
} /* Тут не надо точки с запятой, точнее, он тут запрещен, ибо он будет всё ломать в последующем правиле */

Actually, because of this, your button was not painted. All styles are applied if you fix the error:
Another mistake. This is not possible:
This is how it should be:
<div class="wrapper"></div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question