Мне нужно «построить» изображение, состоящее из разных частей. Вот схема:
Между каждым фрагментом изображения нет места или отступов, и было бы неплохо, если бы все изображение было отзывчивым ... есть идея? Я пробовал это, но изображение теряет отзывчивость:
echo '<div id = "top_testa" style = "overflow: hidden; ">
<div class = "image-div" style = "float:right;margin-left:0px;max-width:
20%;max-height: 20%;" >
</div>
<div class = "image-div" style = "float:right;margin-right:8.5%;max-width:
20%;max-height: 20%;" >
<img
src = "TestaLuc.png" id = "top_head" name = "top_head">
</div>
<div class = "image-div" style = "float:left;margin-left:0px;max-width: 20%;max-height: 20%;">
</div>
<div style = "clear:right;"></div>
</div>';
echo '<div id = "base_testa" style = "overflow: hidden; ">
<div class = "image-div" style = "float:right;margin-left:0px;max-width: 20%;max-height: 20%;" >
</div>
<div class = "image-div" style = "float:right;margin-right:8.5%;max-width: 20%;max-height: 20%;" >
<img src = "BaseTestaMim.png" id = "bottom_head" name = "bottom_head">
</div>
<div class = "image-div" style = "float:right;margin-left:0px;max-width: 20%;max-height: 20%;">
</div>
<div style = "clear:right;"></div>
</div>';
echo '<div id = "asta" style = "overflow: hidden; ">
<div class = "image-div" style = "float:right;margin-left:0px;max-width: 20%;max-height: 20%;" >
</div>
<div class = "image-div" style = "float:right;margin-right:8.6%;max-width: 20%;max-height: 20%;" >
<img src = "AstSupNull.png" id = "top_asta" name = "top_asta">
</div>
<div class = "image-div" style = "float:right;margin-left:0px;max-width: 20%;max-height: 20%;">
</div>
<div style = "clear:right;"></div>
</div>';
echo '<div id = "middle" style = "overflow: hidden; ">
<div class = "image-div" style = "float:right;margin-left:0px;max-width: 20%;max-height: 20%;" >
</div>
<div class = "image-div" style = "float:right;margin-right:13.3%;max-width: 20%;max-height: 20%;" >
<img src = "AstInfLuc.png" id = "bottom_left_asta" name = "bottom_left_asta" align = "right">
</div>
Спасибо






Используйте класс no-gutters для своих строк Bootstrap, чтобы удалить заполнение, и класс img-fluid для ваших изображений, чтобы сделать их адаптивными.
Вот фрагмент рабочего кода:
<link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity = "sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin = "anonymous">
<div class = "container-fluid">
<div class = "row no-gutters">
<div class = "col-4">
<img class = "img-fluid" src = "https://placeimg.com/940/400/animals" alt = "">
</div>
<div class = "col-4">
<img class = "img-fluid" src = "https://placeimg.com/940/400/arch" alt = "">
</div>
<div class = "col-4">
<img class = "img-fluid" src = "https://placeimg.com/940/400/tech" alt = "">
</div>
</div>
<div class = "row no-gutters">
<div class = "col-6">
<img class = "img-fluid" src = "https://placeimg.com/940/400/nature" alt = "">
</div>
<div class = "col-6">
<img class = "img-fluid" src = "https://placeimg.com/940/400/people" alt = "">
</div>
</div>
<div class = "row no-gutters">
<div class = "col-12">
<img class = "img-fluid" src = "https://placeimg.com/1240/200/any" alt = "">
</div>
</div>
</div>col-4 не работает, col-md-4 работает, а no-gutter не работает. Какая версия бутстрапа мне нужна?
Та же версия, что и тег, который вы использовали для этого вопроса, и та же версия, что и CSS, указанный в моем фрагменте.
Хорошо, но если я не смог использовать bootstrap 4?
Тогда я удалю свой ответ.
Это была ошибка, извините
вам нужно установить отзывчивый тег шириной 100%
<img src = "img.jpg" width = "100%">
О вашем коде: закройте разметку PHP перед тем, как писать весь этот HTML, ваш код будет легче читать. И сделайте отступ в HTML.