css - 向左浮动的 Div 是重叠的。我不希望它们重叠

标签 css html tags

我希望能够使 div 一个、两个和 fin float ,同时让它们不相互重叠。现在设置完毕,当我在较小的屏幕上查看它时,fin 落在 2 之上,2 落在 fin 之上。

在此方向上的任何形式的帮助将不胜感激。

这是html代码:

<div class="iwrapper">
  <div class="one">
    <center>
    <div id="i1">
    </div>
    <div>
      <span class="img-tag">The BALD DESIGNER Look</span>
   </div>
   </center>
 </div>
 <div class="two">
 <center>
   <div id="i2">
   </div>
   <div>
     <span class="img-tag">Meet TECHNODEN- My Home Design Space</span>
   </div>
 </center>
 </div>

<div class="fin">
   <a href="http://www.vrohit.com/wp-content/uploads/2014/01/Resume_RohitVairamohan.pdf" target="_blank">Grab my Resume</a>
   <div class="descpt">Facts about Me</div><div style="font-size: 90%; font-weight: 400; line-height: 1.7em;" > 
   > I love to go hiking and on adventure trails. This helps me often think of adventurous and innovative solutions to critical problems.
   > Being a trained classical singer, I introduce new rhythm into my designs. 
   > I am good at finding an organization among my disorganized belongings and this helps me be clinical and find patterns during my research.
   > And Yes, you may have guessed it by now; my favorite color is Green.
   </div>
</div>
<div class="clear12fin"></div>
</div>

这是与之关联的 CSS:

.clear12fin{
clear: both;
}

.iwrapper {
width:99%;
}

#i1{background-image:url("http://www.vrohit.com/wp-content/uploads/2014/01/my-picg.png");
width:300px; /*image width*/
height:300px; /*image height*/
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
transition: all 1s ease;
}

#i1:hover{background-image:url("http://www.vrohit.com/wp-content/uploads/2014/01/my-pic.png");}

#i2{background-image:url("http://www.vrohit.com/wp-content/uploads/2014/01/designspaceg.png");
width:300px; /*image width*/
height:300px; /*image height*/
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
transition: all 1s ease;
}

#i2:hover{background-image:url("http://www.vrohit.com/wp-content/uploads/2014/01/designspace.png");}



.one{float:left; width:32%; margin-right:1%;}
.two{float:left; width:32%; margin-right:1%;}
.fin{display:inline-block; width:33%;
}

最佳答案

.iwrapper 上设置最小宽度

CSS

.iwrapper {
    width:99%;
    min-width: 930px; /* image width plus 30px for a 10px margin between divs*/   
}

有一个 fiddle - Fiddle Link!

关于css - 向左浮动的 Div 是重叠的。我不希望它们重叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22137779/

相关文章:

javascript - 购物 list 应用程序不添加、清除和删除元素

html - Chrome 和 FF 之间的像素差异

php - 如何在一个提交按钮上禁用 JS 的情况下为访问者执行两个 POST 请求?

Azure 通知 : meaning of 3K unless broadcasted to less than 5 devices

jquery - 在通过索引找到的元素中引用一个元素

css - 如何在 CSS 中对齐此文本?

javascript - 如何在具有多个具有相同 id 的元素的文档中获取元素的 XPATH?

javascript - 使用 jQuery 访问 HTML 5 视频进度事件

PHP 重写 AJAX post 请求

javascript - 如何在不显示超链接的情况下制作可点击的图像?