减小大小时,内容超出div

时间:2018-07-04 11:49:12

标签: html css bootstrap-4

我创建了一个div并在其中添加了一些标注。

我在这里上传了我的代码  https://codepen.io/muhammad-usman-the-animator/pen/mKgoNj

.name {
  color: black;
  font-weight: bold;
  margin-left: 20px;
  font-size: 20px;
}

.details {
  color: black;
  margin-left: 20px;
  font-size: 15px;
}

h2 {
  margin-top: 100px;
  margin-left: 100px;
  margin-bottom: -100px;
}

.vl {
  border-left: 6px solid #3B4F48;
  height: 120px;
  margin-bottom: none;
  margin-top: -15px;
  margin-left: 120px;
}

.circle {
  border: 4px solid black;
  border-radius: 100%;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";
  filter: alpha(opacity=60);
  opacity: 0.6;
  -webkit-box-shadow: 0 0 1px 0px rgb( 255, 255, 255);
  box-shadow: 0 0 1px 0px rgb( 255, 255, 255);
  width: 17px;
  height: 17px;
  z-index: 86;
  margin-left: 114.2px;
  margin-bottom: 0px;
  background-color: #84a499;
}

.hr {
  margin-left: 130px;
  margin-top: -13px;
  width: 249px;
  border-top: 8.2px solid #3B4F48;
}

body {
  font-family: Helvetica;
  font-size: 13px;
}

div.callout {
  height: 60px;
  width: 200px;
  float: left;
}

div.callout {
  background-color: #84a499;
  background-image: -moz-linear-gradient(top, #444, #444);
  position: relative;
  color: #ccc;
  margin: 25px;
  min-height: 100px;
  border: 1px solid #333;
  text-shadow: 0 0 1px #000;
  width: 700px;
  margin-top: -58px;
  margin-left: 397px;
  border-radius: 15px;
  /*box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset;*/
}

.callout::before {
  content: "";
  width: 0px;
  height: 0px;
  border: 0.8em solid transparent;
  position: absolute;
}

.callout.right::before {
  left: -20px;
  top: 40%;
  margin-left: -5px;
  border-right: 15px solid #84a499;
}

h2 {
  width: 80%;
  float: center;
  text-align: center;
  border-bottom: 6px solid #3B4F48;
  line-height: 0.1em;
  margin: 10px 0 20px;
}

h2 span {
  background: #292c2f;
  padding: 0 40px;
  padding-bottom: 20px;
  border-bottom: 6px solid #3B4F48;
}

.para {
  color: white;
  margin-top: 180px;
  margin-bottom: -200px;
  margin-left: 120px;
  font-size: 17px;
}
<div id="Events" name="Events"> </div>
<div class="wrapper offcanvas-container" id="offcanvas-container">
  <!-- inner-wrapper -->

  <!-- Services Wrapper Section -->
  <section class="service-wrapper" style="background-color: #292c2f;">



    <div class="container-fluid">

      <h2><span style="color: white;">Work</span></h2>
      <p class="para"> My career has taken a natural progression from client websites, to UI templates, to simple php websites, to Laravel framework. </p>
      <div class="vl" style="margin-top:250px; height: 80px;"></div>
      <div class="circle"> </div>
      <div class="callout right" style>

        <div style="margin-top: 10px;"> <a class="name"> Wizkon International</a> <br>

          <p class="details"> this has been love and lakjfofiejalifjlsdjaie jaleijlsidjleai jlaifjlsdf jalie jlaidjf ewf lakjfofiejalifjlsdjaie j lakjfofiejalifjlsdjaie jlaidjf lakjfofiejalifjlsdjaie j
          </p>

        </div>

      </div>

      <hr class="hr" />





      <div class="vl" style="height: 80px; margin-bottom: 50px;"></div>
    </div>
  </section>
</div>

问题是,它工作正常,但是当我减小窗口大小时,标注云超出了div大小。请看看并指导我。我尝试了很多没有用的东西。所以,我不知道该怎么办。

1 个答案:

答案 0 :(得分:0)

您已为callout应用了700px的像素宽度,而不是对div应用了40%宽度。我尝试过。一旦您看过它。

.name{

  color: black; 
  font-weight: bold;
  margin-left: 20px;
   font-size: 20px; 
}

    
.details{

  color: black; 
  margin-left: 20px;
   font-size: 15px; 
}

h2  {
	margin-top:100px; margin-left: 100px; margin-bottom:-100px;
}



.vl {
  border-left: 6px solid #3B4F48;
  height: 120px;
  margin-bottom: none;
  margin-top: -15px;
  margin-left: 120px;
}

.circle {
  border: 4px solid black;
  border-radius: 100%;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";
  filter: alpha(opacity=60);
  opacity: 0.6;
  -webkit-box-shadow: 0 0 1px 0px rgb( 255, 255, 255);
  box-shadow: 0 0 1px 0px rgb( 255, 255, 255);
  width: 17px;
  height: 17px;
  z-index: 86;
  margin-left: 114.2px;
  margin-bottom:0px;
  background-color: #84a499;

}

.hr{
margin-left:130px;
margin-top:-13px; 
width:249px;
border-top: 8.2px solid #3B4F48;


}


body {
  font-family: Helvetica;
  font-size: 13px;
}

div.callout {
  height: 60px;
  width: 200px;
  float: left;
}

div.callout {
  background-color: #84a499;
  background-image: -moz-linear-gradient(top, #444, #444);
  position: relative;
  color: #ccc;
  
  margin: 25px;
  min-height: 100px;
  border: 1px solid #333;
  text-shadow: 0 0 1px #000;
  width: 40%;
  margin-top: -58px;
  margin-left:397px;

  border-radius:  15px;
  
  /*box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset;*/
}

.callout::before {
  content: "";
  width: 0px;
  height: 0px;
  border: 0.8em solid transparent;
  position: absolute;

}



.callout.right::before {
  left: -20px;
  top: 40%;
  margin-left: -5px;
  border-right: 15px solid #84a499;


}

h2 {
  width: 80%;
  
  float: center;

  text-align: center;

  border-bottom: 6px solid #3B4F48;
 
  line-height: 0.1em;
  margin: 10px 0 20px;
}

h2 span {
  background: #292c2f;
  padding: 0 40px;
  padding-bottom: 20px;
  border-bottom: 6px solid #3B4F48;
}


.para{
  color: white;
   margin-top: 180px;
    margin-bottom: -200px;
     margin-left: 120px;
     font-size: 17px;
}
  
  <div id="Events" name="Events"> </div>
<div class="wrapper offcanvas-container" id="offcanvas-container">
    <!-- inner-wrapper -->

      <!-- Services Wrapper Section -->
      <section class="service-wrapper" style="background-color: #292c2f;"  >



<div class="container-fluid">

  <h2 ><span style="color: white;">Work</span></h2>
  <p class="para" > My career has taken a natural progression from client websites, to UI templates, to simple php websites, to Laravel framework. </p>
<div class="vl" style="margin-top:250px; height: 80px;"></div>
<div class="circle"> </div>
<div class="callout right" style> 

 <div style="margin-top: 10px;" > <a class="name" > Wizkon International</a> <br>

  <p class="details" > this has been love and lakjfofiejalifjlsdjaie jaleijlsidjleai jlaifjlsdf jalie jlaidjf ewf  lakjfofiejalifjlsdjaie j lakjfofiejalifjlsdjaie jlaidjf  lakjfofiejalifjlsdjaie j
  </p>

 </div>

 </div>
  
<hr class="hr"/>

<div class="vl" ></div>
<div class="circle"> </div>
<div class="callout right">   <div style="margin-top: 10px;" > <a class="name" > Wizkon International</a> <br>

  <p class="details" > this has been love and lakjfofiejalifjlsdjaie jaleijlsidjleai jlaifjlsdf jalie jlaidjf ewf  lakjfofiejalifjlsdjaie j lakjfofiejalifjlsdjaie jlaidjf  lakjfofiejalifjlsdjaie j
  </p>

 </div> </div>
<hr class="hr"/>




<div class="vl" ></div>
<div class="circle"> </div>
<div class="callout right">   <div style="margin-top: 10px;" > <a class="name" > Wizkon International</a> <br>

  <p class="details" > this has been love and lakjfofiejalifjlsdjaie jaleijlsidjleai jlaifjlsdf jalie jlaidjf ewf  lakjfofiejalifjlsdjaie j lakjfofiejalifjlsdjaie jlaidjf  lakjfofiejalifjlsdjaie j
  </p>

 </div></div>
<hr class="hr"/>


<div class="vl" ></div>
<div class="circle"> </div>
<div class="callout right">   <div style="margin-top: 10px;" > <a class="name" > Wizkon International</a> <br>

  <p class="details" > this has been love and lakjfofiejalifjlsdjaie jaleijlsidjleai jlaifjlsdf jalie jlaidjf ewf  lakjfofiejalifjlsdjaie j lakjfofiejalifjlsdjaie jlaidjf  lakjfofiejalifjlsdjaie j
  </p>

 </div> </div>
<hr class="hr"/>



<div class="vl" ></div>
<div class="circle"> </div>
<div class="callout right">  <div style="margin-top: 10px;" > <a class="name" > Wizkon International</a> <br>

  <p class="details" > this has been love and lakjfofiejalifjlsdjaie jaleijlsidjleai jlaifjlsdf jalie jlaidjf ewf  lakjfofiejalifjlsdjaie j lakjfofiejalifjlsdjaie jlaidjf  lakjfofiejalifjlsdjaie j
  </p>

 </div> </div>
<hr class="hr"/>



<div class="vl" ></div>
<div class="circle"> </div>
<div class="callout right">   <div style="margin-top: 10px;" > <a class="name" > Wizkon International</a> <br>

  <p class="details" > this has been love and lakjfofiejalifjlsdjaie jaleijlsidjleai jlaifjlsdf jalie jlaidjf ewf  lakjfofiejalifjlsdjaie j lakjfofiejalifjlsdjaie jlaidjf  lakjfofiejalifjlsdjaie j
  </p>

 </div> </div>
<hr class="hr"/>




<div class="vl" style="height: 80px; margin-bottom: 50px;" ></div>
</div>
</section>
</div>