Подскажите по списку с оформлением. Что изменить в коде, чтобы если было больше одной строчки в абзаце не сжимался background для номера? Возможно нужно ввести какое-нибудь выравнивание текста?
.num2 {
color: white;
background: #5389ED;
display: inline-block;
text-align: center;
margin: 1px 6px;
line-height: 32px;
line-width: 32px;
width: 32px;
border-radius: 20px;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
font-family: "Trebuchet MS", "Lucida Sans";
font-size: 14pt;
margin-left:1px;
}
.cont1 {
margin-top: 10px;
margin-bottom: 0px;
display: flex;
align-items: center;
height: 100%;
width: 100%;
}
.p2 {
display: inline-block;
padding-left: 15px;
text-align: justify;
white-space: pre-wrap;
}
<div class="cont1">
<div class="num2">
1</div>
<div class="p2">
Апрель 1945-го.</div>
</div>
<div class="cont1">
<div class="num2">
2</div>
<div class="p2">
Американские войска ведут ожесточенные бои с японцами на острове Окинава. Пулеметный шквал и прицельный минометный огонь</div>
</div>
Как вариант дать кругам position:absolute; :
.num2 {
color: white;
background: #5389ED;
display: inline-block;
text-align: center;
margin: 1px 6px;
line-height: 32px;
line-width: 32px;
width: 32px;
border-radius: 20px;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
font-family: "Trebuchet MS", "Lucida Sans";
font-size: 14pt;
margin-left: 1px;
position: absolute;
}
.cont1 {
margin-bottom: 0px;
display: flex;
align-items: center;
height: 100%;
width: 100%;
}
.p2 {
display: block;
padding-left: 30px;
text-align: justify;
white-space: pre-wrap;
vertical-align: text-top;
padding-bottom: 10px;
}
<div class="cont1">
<div class="num2">
1</div>
<div class="p2">
Апрель 1945-го.</div>
</div>
<div class="cont1">
<div class="num2">
2</div>
<div class="p2">
Американские войска ведут ожесточенные бои с японцами на острове Окинава. Пулеметный шквал и прицельный минометный огонь</div>
</div>
Сборка персонального компьютера от Artline: умный выбор для современных пользователей