-3
DIV 안에 이미지를 넣습니다. 나는 세 가지 사진들이 DIV 경계 내부에 싶어하지만 그냥 작동하지 않는 것 : 내 이미지가 DIV에 바인딩되어 있지 않습니다.
#container {
margin-right: 10%;
margin-left: 10%;
border-style: solid;
border-width: 5px;
border-color: orange;
background-color: yellow;
}
h1 {
text-align: center;
}
#original,
#alike1,
#alike2 {
margin: 10px;
border-style: solid;
border-width: 5px;
border-color: orange;
background-color: rgb(0, 200, 255);
}
img.pic2,
img.pic3 {
float: right;
clear: both;
overflow: hidden;
margin: 10px;
}
#pic1 {
float: right;
clear: both;
overflow: hidden;
margin-right: 20px;
margin-top: 40px;
}
<div id="container">
<h1> Trump Hair </h1>
<div id="original">
<h2> Original </h2>
<p> The Donald
<div> <img id=pic1 height="100" alt="Don" src="http://lorempixel.com/100/100/people"> </div>
</p>
<p> This is the original Trump hair. It is found often in nature.
<p>
</div>
<div id="alike1">
<h2> Look alike #1</h2>
<p>Corn Silk <img class="pic2" height="100" alt="Corn" src="http://lorempixel.com/100/100/cats"></p>
<p>There have been many cases of corn silk that appear like Trump's hair.
<p>
</div>
<div id="alike2">
<h2> Look alike #1 </h2>
<p> Llama Hair <img class="pic3" alt="llama" height="100" src="http://lorempixel.com/100/100/abstract"> </p>
<p> There are many animals that have Trump hair. This llama is looking very stylish. </p>
</div>
</div>
내가 그것을 어떻게 해결할 수 있습니까? 나는 세 가지 사진들이 DIV 경계 내부에 싶어하지만 지금은 다음과 같습니다
as you can see the images flow out of the divs을 :
어떻게 작동하지 않는 이유는 무엇입니까? 스크린 샷을 제공하고 html도 게시 할 수 있습니까? –
[ask]와 [mcve]를 만드는 방법을 읽어보십시오. – CBroe
미안 CBroe, 조금 급하게. –