CSS
- 16 ответов
- 0 вопросов
23
Вклад в тег
$(function(){
$('.some_block').height($('.some_block').width()/2.5);
$(window).resize(function(){
$('.some_block').height($('.some_block').width()/2.5);
});
});
<div class="box">
<div class="block block_1">block # 1</div>
<div class="block block_2">block # 2</div>
<div class="block block_3">block # 3</div>
</div>
.box{
width: 400px;
margin: 50px auto;
}
.box:before {
background-color: rgb(100, 250, 100);
display: block;
content: "full";
}
.block {
width: 33.3333%;
height: 100px;
border: 1px dotted black;
box-sizing: border-box;
display: inline-block;
}
.block_1 {
float: none;
}
.block_2 {
float: left;
}
.block_3{
float: right;
}
@media (max-width: 600px) {
.box:before {
background-color: rgb(150, 150, 250);
content: "mobile";
}
.block_1 {
width: 100%;
}
.block_2 {
width: 50%;
}
.block_3{
width: 50%;
float: left;
}
}