0

Здравствуйте. Подскажите пожалуйста, почему у меня текст все время у нижнего края, а не сверху, как должно быть?

.about .title {
  height: 120px;
}
.about .title span {
  font-family: 'Roboto', sans-serif;
  line-height: 120px;
  font-size: 20px;
}
.about .services {
  width: 260px;
  display: inline-block;
}
.about .services .list .list-item {
  font-family: 'Roboto', sans-serif;
  height: 50px;
}
.about .services .list .list-item span {
  line-height: 50px;
  padding-left: 20px;
}
.about .services .list .list-item:first-child {
  background: #6cc437;
  color: #fff;
}
    <div class="about">
        <div class="services">
            <div class="title">
                <span>Our Services</span>
            </div>
            <div class="list">
                <div class="list-item">
                    <span>Responsive layout</span>
                </div>
                <div class="list-item">
                    <span>Best support</span>
                </div>
                <div class="list-item">
                    <span>Friendly interface</span>
                </div>
                <div class="list-item">
                    <span>Quality service</span>
                </div>
                <div class="list-item">
                    <span>Cool solution</span>
                </div>
            </div>
        </div>


        <span>just a random text</span>
    </div>

2
  • Ваш span после остальных элементов находится, почему он должен быть сверху?
    – n3r0bi0m4n
    4 июл 2017 в 0:46
  • Спасибо большое за ответ, я не так понял свойство display: inline-block.
    – Farianit
    4 июл 2017 в 2:55

1 ответ 1

1

Добавьте .about .services свойство float:left;

1
  • Спасибо, не знал о данном свойстве.
    – Farianit
    4 июл 2017 в 2:56

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.