Как перенести элемент вниз
? Есть два слова "Смотреть работу" и они находятся не на одном уровне и я хочу переместить их на один уровень. Как это сделать?
Asked
Active
Viewed 568 times
1 Answers
1
Как один из вариантов можно так:
.block {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
width: 100%;
}
.bottom {
width: 100%;
-webkit-box-align: end;
-ms-flex-align: end;
align-items: flex-end;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
}
.div{
width:300px;
padding: 10px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-box-align: stretch;
-ms-flex-align: stretch;
align-items: stretch;
-ms-flex-line-pack: stretch;
align-content: stretch;
-ms-flex-item-align: stretch;
align-self: stretch;
}
/************TWO***************/
html, body{
height: 100%;
}
.two p {
height: 100%;
}
.block_two {
display: inline-block;
height: 100%;
}
.two {
width: 212px;
padding: 15px;
height: 100%;
max-height: 200px;
display: inline-block;
}
<div class="block">
<div class="div">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. </p>
<a href="#!" class="bottom">Смотреть работы</a>
</div>
<div class="div">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>
<a href="#!" class="bottom">Смотреть работы</a>
</div>
</div>
<h3>Вариант 2:</h3>
<div class="block_two">
<div class="two">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
<a href="#!">Смотреть</a>
</div>
<div class="two">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>
<a href="#!">Смотреть</a>
</div>
</div>
Даниил
- 3,443
-
У меня "смотреть работы" - это как ссылка :) Мне ссылку заворачивать в div? – Yaroslav Feb 07 '18 at 21:52
-
-
-
Да, ибо я уже час борюсь с этим вопросом :) Я новичок) Меня понять можно. Я никогда не видел ссылку в диве( – Yaroslav Feb 07 '18 at 22:00
-
-
Вот именно, что уже все перепробовал и ничего) Твой код даже попробовал. Если бы не был перфекционистом вообще плевать было бы на эти "Смотреть работы" – Yaroslav Feb 07 '18 at 22:03
-
В примере же работает, значит вы что то не так делаете :) Можно сделать это с помощью JS/Jquery – Даниил Feb 07 '18 at 22:04
-
Даниил, спасибо тебе большое!!!! Второй способ очень помог. Очень большое спасибо за помощь. – Yaroslav Feb 08 '18 at 16:22
-
1
