孩子的保证金问题

乔纳

这个问题有点复杂。我正在尝试按照您在此小提琴中的顺序放置一些图像,但我必须为图像添加一个父 div,以便它们可以与显示图像所代表人物姓名的动画框一起正常工作。问题在于 div 没有按照图像的方式排列,就像单独的 img 标签一样。对此的任何帮助将不胜感激。

body {
	background: #7d7d7d;
}

h2 {
  font-family: Pacifico;
  font-size: 10px;
  font-style: normal;
  font-variant: normal;
  font-weight: 200;
  color: white;
  line-height: 0px;
}

#friends {
  position: absolute;
  width: 200px;
  height: 20px;
  top: 50px;
  right: 200px;
  padding-top: 4px;
  border: 1px solid white;
	z-index: -10;
	background-color: #000;
  font-family: arial;
  text-align: center;
  overflow: hidden;
  -webkit-transition: all 0.5s ease-out;
  -moz-transition: all 0.5s ease-out;
  -o-transition: all 0.5s ease-out;
  transition: all 0.5s ease-out;
}

#friends:hover {
  height: 240px;
  border-radius: 10px;
}

.peeps {
  position: relative;
	margin-top: 5px;
  margin-right: 5px;
  width: 50px;
  height: 50px;
}

.sam, .ys, .kani, .ash, .adam, .lit, .tsun, .lara, .bath {
  width: 50px;
  height: 50px;
  border: 1px solid black;
  border-radius: 100%;
  -webkit-transition: all 0.8s ease-out;
  -moz-transition: all 0.8s ease-out;
  transition: all 0.8s ease-out;
}

.sam:hover {
  border-radius: 0;
  box-shadow: 0px 0 15px #a2dfe0;
}

#name {
  position: absolute;
  margin-top: -20px;
  height: 20px;
  width: 0px;
  opacity: 0;
	vertical-align: middle;
	line-height: 15px;
  background-color: #000;
  border: 1px solid white;
  overflow: hidden;
  z-index: -1;
  left: 50%;
  transform: translate(-50%, 0);
  -webkit-transition: all 1s ease;
  -moz-transition: all 1s ease;
  transition: all 1s ease;
}

.peeps:hover #name {
  margin-top: -85px;
  height: 20px;
  width: 50px;
  opacity: 1;
  background-color: #000;
  color: #000;
  -webkit-transition: all 1s ease;
  -moz-transition: all 1s ease;
  transition: all 1s ease;
}
<html>
  <div id="friends">
    <br><br><!-- jsfiddle doesn't like my text -->
    <div class="peeps">
      <img class="sam" src="http://usd.chatango.com/profileimg/s/a/samantha/thumb.jpg" />
      <p id="name" style="text-align: center;">
        <font color="white" size="1">Ugh</font>
      </p>
    </div>
    <div class="peeps">
      <img class="ys" src="http://usd.chatango.com/profileimg/y/s/ys/thumb.jpg">
      <p id="name" style="text-align: center;">
        <font color="white" size="1">Ugh</font>
      </p>
    </div>
    <div class="peeps">
      <img class="kani" src="http://usd.chatango.com/profileimg/k/a/kaninkiller/thumb.jpg">
      <p id="name" style="text-align: center;">
        <font color="white" size="1">Ugh</font>
      </p>
    </div>
  </div>
</html>

史蒂夫·K

如果我正确理解您的问题,只需将.peeps设置display:inline-block;. 这是一个片段。

body {
	background: #7d7d7d;
}

h2 {
  font-family: Pacifico;
  font-size: 10px;
  font-style: normal;
  font-variant: normal;
  font-weight: 200;
  color: white;
  line-height: 0px;
}

#friends {
  position: absolute;
  width: 200px;
  height: 20px;
  top: 50px;
  right: 200px;
  padding-top: 4px;
  border: 1px solid white;
	z-index: -10;
	background-color: #000;
  font-family: arial;
  text-align: center;
  overflow: hidden;
  -webkit-transition: all 0.5s ease-out;
  -moz-transition: all 0.5s ease-out;
  -o-transition: all 0.5s ease-out;
  transition: all 0.5s ease-out;
}

#friends:hover {
  height: 240px;
  border-radius: 10px;
}

.peeps {
  position: relative;
	margin-top: 5px;
  margin-right: 5px;
  width: 50px;
  height: 50px;
  display:inline-block;
}

.sam, .ys, .kani, .ash, .adam, .lit, .tsun, .lara, .bath {
  width: 50px;
  height: 50px;
  border: 1px solid black;
  border-radius: 100%;
  -webkit-transition: all 0.8s ease-out;
  -moz-transition: all 0.8s ease-out;
  transition: all 0.8s ease-out;
}

.sam:hover {
  border-radius: 0;
  box-shadow: 0px 0 15px #a2dfe0;
}

#name {
  position: absolute;
  margin-top: -20px;
  height: 20px;
  width: 0px;
  opacity: 0;
	vertical-align: middle;
	line-height: 15px;
  background-color: #000;
  border: 1px solid white;
  overflow: hidden;
  z-index: -1;
  left: 50%;
  transform: translate(-50%, 0);
  -webkit-transition: all 1s ease;
  -moz-transition: all 1s ease;
  transition: all 1s ease;
}

.peeps:hover #name {
  margin-top: -85px;
  height: 20px;
  width: 50px;
  opacity: 1;
  background-color: #000;
  color: #000;
  -webkit-transition: all 1s ease;
  -moz-transition: all 1s ease;
  transition: all 1s ease;
}
    <div id="friends">
      <br><br> <!-- jsfiddle doesn't like my text -->

      <img class="sam" src="http://usd.chatango.com/profileimg/s/a/samantha/thumb.jpg">

      <img class="ys" src="http://usd.chatango.com/profileimg/y/s/ys/thumb.jpg">

      <img class="kani" src="http://usd.chatango.com/profileimg/k/a/kaninkiller/thumb.jpg">

      <img class="ash" src="http://usd.chatango.com/profileimg/m/u/multiplelovearrows/thumb.jpg">

      <img class="adam" src="http://usd.chatango.com/profileimg/t/i/tiefier/thumb.jpg">

      <img class="lit" src="http://usd.chatango.com/profileimg/l/i/littered/thumb.jpg">

      <img class="tsun" src="http://usd.chatango.com/profileimg/n/i/nicholle/thumb.jpg">

      <img class="lara" src="http://usd.chatango.com/profileimg/h/o/hopefulhero/thumb.jpg">

			<img class="bath" src="http://usd.chatango.com/profileimg/m/a/maytimes/thumb.jpg">
    </div>

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章