何らかの理由で、クリアタグを使用しない限り、テキスト1が画像の下ではなく次の列に移動します。クリアタグを使用する際の問題は、テキスト1がクリアタグの前にあった場所の周りにtext2を追加できないことです。なぜなら、段落の前に大きなスペースがあるからです。画像の下にテキストを追加することはできません。クリアタグなしでテキストを配置することはできません。
また、テキスト・アラインメントは、ページ上にテキストを中央に配置しません。その内容の周囲にテキストを配置します。どのように私はこれを修正するのですか?
Jsfiddle - https://jsfiddle.net/p6eocccj/
HTML
<div id="div1">
<p id="text0"><span id="sp1pg4">About me</span></p>
<img id="img1" src ="images/hack.jpg"/>
<br>
<p id="text1"><strong>Image Courtesy Homer Simpson</strong><br></br>
<a href="www.google.com">www.homersimpsoniscooltoo.com</a></p>
<p id="text2">
Hi there!
<br></br>
I'm bob, a coool designer and developer<br>
from Far far coolioland, Australia. I<br>
specialise in cooking, shipping, shopping,<br>
camping and turning coffee into popcorn. My<br>
approach to buytying is this, make it clean and<br>
simple but also focus on the buying for men. This<br>
is what differentiates poor people from great chimps.<br>
Whether you want to build a house for as long as<br>
business, a personal toy or just ask you some<br>
</p>
</div>
CSS
#div1 {
width: max-width;
height: 1650px;
background-color: #ECECEC;
}
#text0 {
text-align: left;
padding-top: 25px;
padding-left:150px;
}
#img1 {
float:left;
margin-top: 25px;
margin-left:150px;
width: 220px;
height: 220px;
border-radius: 50%;
}
#text1 {
clear:left;
float:left;
padding-left:160px;
font-size:13px;
line-height:80%;
}
#text2 {
padding-top: 100px;
line-height: 140%;
text-align: center;
font-family: sans-serif;
font-size: 15px;
}
ラップコンテナ要素に画像とテキスト、その代わりに浮きます。 HTML5要素のfigureとfigcaptionを見てみましょう。これを使うと、マークアップの現在のややこしい意味を改善することができます。 – CBroe