【发布时间】:2020-10-19 20:29:22
【问题描述】:
我正在尝试建立自己的投资组合网站,我希望它具有响应性。对于“关于我”部分,我将我的图像放在左侧,在右侧放置一个关于我自己的简短介绍。现在,当我减小屏幕尺寸时,我希望将文本放在图像下方。知道如何做到这一点吗?任何帮助表示赞赏。
很抱歉没有早点发布代码。
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="styles1.css">
</head>
<body>
<div class="container2" id="container2">
<div class="intro">
<div class="column-img">
<!-- My image goes here -->
<img src="" alt="">
</div>
<div class="column-txt">
<h2>Hello.</h2>
<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>
</div>
</div>
</div>
</body>
</html>
.container2 {
position: relative;
padding-top: 100px;
text-align: center;
padding-bottom: 80px;
background-color: #A8D0e6;
}
.intro{
background: #f76c6c;
padding-left: 25px;
padding-right: 25px;
position: relative;
box-sizing: border-box;
border-radius: 4px;
align-items: center;
max-width: 100%;
width: 70%;
margin: auto;
color: white;
display: flex;
height: 450px;
transition: 0.5s;
}
.intro .column-img img{
float: left;
margin-right: auto;
border-radius: 50%;
display: block;
margin-left: auto;
width: 320px;
height: 456px;
padding: 30px;
}
【问题讨论】:
-
请分享您的代码的简化版本,以便我们重现您的问题并为您提供帮助。
-
方法有多种,可以使用css网格或者媒体查询
标签: html css python-3.x responsive-design web-site-project