gpt4 book ai didi

html - 在 div/图像右侧 float 文本

转载 作者:行者123 更新时间:2023-11-28 07:20:58 25 4
gpt4 key购买 nike

我正在尝试将 lorem ipsum 示例文本 float 到图像和 div 容器的右侧。我已将 float 设置到右侧,但没有成功,因为它仍然位于图像下方。

What it needs to look like

提前致谢。

#outer {
float: left;
background-color: white;
border-style: outset;
border-width: 5px;
border-color: rgb(127, 127, 255);
padding: 5px;
}
#inner {
float: left;
position: relative;
color: white;
border-style: outset;
border-width: 5px;
border-color: rgb(191, 233, 191);
padding: 5px;
margin: 5px;
}
#image {
clear: both;
}
#paragraph {
float: right;
margin: 25px;
}
<html>

<head>
<title>Div Test</title>
<link rel="stylesheet" type "text/css" href="chandra.css" />
</head>

<body>
<div id="outer">



<h1> The Chandra space-based X-Ray Observatory</h1>

<div id="inner">
<a href="http://science.nasa.gov/astrophysics/focus-areas/black-holes/">Nearby black hole</a>
<br>
<a href="http://www.nasa.gov/mission_pages/chandra/news/07-139.html" />'Death Star' Galaxy Black Hole</a>
<br>
<a href="http://www.nasa.gov/content/black-holes-have-simple-feeding-habits/">Black Holes feeding</a>
<br>
<a href="https://www.nasa.gov/jpl/nustar/tale-of-two-black-holes/">Two Black Holes</a>
</br>
</div>

<div id="image">
<img src="binary.jpg" alt="Binary" style="width:226px;height:170px;">
</div>


<div id="paragraph">
<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. 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.
</br>
</br>
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.
</br>
</br>
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>
</body>

</html>

最佳答案

这是我做的:

#outer {
float: left;
background-color: white;
border-style: outset;
border-width: 5px;
border-color: rgb(127, 127, 255);
padding: 5px;
}
#inner {
position: relative;
color: white;
border-style: outset;
border-width: 5px;
border-color: rgb(191, 233, 191);
padding: 5px;
margin: 5px;
clear: both;
width: 200px;
}
#image {
//clear: both;
float:left;
}
#paragraph {
//float: right;
margin: 25px;
text-align: justify;
}

Here is the JSFiddle demo

关于html - 在 div/图像右侧 float 文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32089823/

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