Как позиционировать изображение на разных сторонах контейнера с помощью CSS?CSS

Разбираемся в CSS
Ответить
Anonymous
 Как позиционировать изображение на разных сторонах контейнера с помощью CSS?

Сообщение Anonymous »

Я пытаюсь позиционировать изображение с помощью урожая класса и предприятия на разных сторонах контейнера (слева, справа) и сосредоточить оба изображения на середину, но оно не работает, как и ожидалось. < /p>

Код: Выделить всё

.us-container {
height: 400px;
display: flex;
justify-content: center;
margin-top: 60px;
}

.native {
width: 550px;
height: 300px;
margin-left: 600px;
}

.city {
width: 430px;
font-size: 30px;
color: rgb(0, 0, 0);
font-family: Georgia, 'Times New Roman', Times, serif;
margin-top: 80px;
margin-left: 15px;
}

.modern {
font-family: Georgia, 'Times New Roman', Times, serif;
width: 400px;
color: rgb(0, 0, 0);
gap: 5em;
font-size: 14px;
margin-bottom: 300px;
margin-top: 15px;
margin-left: 15px;
}

.more {
display: flex;
align-items: right;
background-color: white;
border-color: black;
color: black;
height: 40px;
font-weight: bold;
width: 100px;
padding-left: 20px;
padding-top: 9px;
margin-top: 30px;
}

.family-container {
display: flex;
height: 200px;
padding-bottom: 100px;
}

.father-container {
height: 400px;
display: flex;
justify-content: center;
align-items: flex-end;
}

.venture {
width: 630px;
height: 440px;
margin-top: 0;
margin-bottom: 300px;
margin-right: 150px;
} < /code>

[img]https://ychef.files.bbci.co.uk/1280x720/p0jx74zr.jpg[/img]

The US city reclaiming its Native roots
After superheading the modern fights of Native American rights,
Minneapolis and nearby Saint Paul are experiencing an indigenous cultural renaissance.

See more



What may lurk in alien oceans
As space agencies  venture onto the moon of jupiter and
Saturn to look deep below their frozen surface, we might find new forms of life there?

[img]https://ychef.files.bbci.co.uk/1280x720/p07p8jpp.jpg[/img]






Вот что я пробовал до сих пор:
Использование отображения Gird или Flexbox, но изображения не выровняются должным образом.
Я хочу, чтобы изображения оставались фиксированными по бокам их соответствующих контейнеров. < /p>
PLS, что лучше всего позиционировать эти изображения на разных сторонах в моем макете?

Подробнее здесь: https://stackoverflow.com/questions/793 ... -using-css
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «CSS»