gpt4 book ai didi

html - 如何将此段落移动到图像的右侧

转载 作者:行者123 更新时间:2023-11-28 03:14:54 25 4
gpt4 key购买 nike

here is the picture of it

我正在尝试做一个大胆的作业,我想把段落移到图片的右边,请帮忙。我实际上尝试为每个 block 放置 div 标签,即标题、图像和段落

<!DOCTYPE html>
<html>
<head>
<title>Hello</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div>
<div class="heading">
<h1>MY FAVOURITE APP</h1>
</div>
<div class="data">
<div class="data">
<img src="C:\Users\sreem\Desktop\pix.jpeg" alt="">
<div>
<p class="para">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. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</p>
</div>
</div>

</div>
</div>
</div>
</body>
</html>

**style.css**

html文件的css代码

img {
height: 250px;
width: 250px;
margin-top: 20px;
margin-left: 100px;
}

.heading {
height: 70px;
width: 80%;
margin-top: 50px;
color:white;
background-color:#5AB9BA;
padding-top: 70px;
letter-spacing: 5px;
margin-left: 100px;
}
.para{
height: 250px;
width: 250px;
margin-left: 400px;

}

最佳答案

Float左边的图像。

img {
height: 250px;
width: 250px;
margin-top: 20px;
margin-left: 100px;
float: left; /** float the image to the left **/
}

.heading {
height: 70px;
width: 80%;
margin-top: 50px;
color: white;
background-color: #5AB9BA;
padding-top: 70px;
letter-spacing: 5px;
margin-left: 100px;
}

.para {
height: 250px;
width: 250px;
margin-left: 400px;
}
<div>
<div class="heading">
<h1>MY FAVOURITE APP</h1>
</div>
<div class="data">
<img src="http://lorempixel.com/250/250/" alt="">
<p class="para">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.
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with
desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</p>
</div>
</div>

关于html - 如何将此段落移动到图像的右侧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45522531/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com