【问题标题】:Flexbox - How to do space-around in vertical?Flexbox - 如何在垂直方向上进行空间环绕?
【发布时间】:2015-04-15 15:39:29
【问题描述】:

可能这是一个菜鸟问题,但我想知道如何在垂直方向上做类似的“空间环绕”。

这个: 半垫 元素 软垫 元素 软垫 元素 半垫

这:
半垫
元素

元素

元素
半垫

我也想念如何做半垫。

做方向:垂直错过初始和结束空间。

.stabled {
  position: fixed;
  right:0px;
  top:0;
  width:15px;
  height:100%;
  z-index:95;
  opacity: 0.6;
  filter: alpha(opacity=60); /* For IE8 and earlier */
   
  -webkit-transition: all 1s ease;
	-moz-transition: all 1s ease;
	-o-transition: all 1s ease;
	-ms-transition: all 1s ease;
	transition: all 1s ease;
}

.stabled ul {
	position:relative;
	display: -webkit-box;
  	display: -moz-box;
  	display: -ms-flexbox;
  	display: -webkit-flex;
  	display: flex;
	
	-webkit-flex-direction:column;
	flex-direction:column;
	
	height:100%;
	width:170px;
}


nav.stabled ul li {
	position:relative;
	float:left;
	margin: 0 auto;
	}
	
	
.stabled li.firl {
	padding-left:0;
	padding-top:35px;
	}


.stabled:hover {
  position: fixed;
  width:170px;
  box-shadow: 0 0 10px #222;
  -webkit-box-shadow: 0 0 40px #222;
  -moz-box-shadow: 0 0 40px #222;
  opacity: 1;
  filter: alpha(opacity=100); /* For IE8 and earlier */
}

【问题讨论】:

标签: css vertical-alignment flexbox


【解决方案1】:

已解决。这是一个不同的错误,因为图像大小。解决方案很简单:codepen.io/devtips/pen/OPQYav(由 youtube.com/user/DevTipsForDesigners 制作)

.parent {
  border: 3px solid orange;
  height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
}

.child {
  width: 100px;
  height: 100px;
  background: blueviolet
}
<div class="parent">
  <div class="child"></div>
  <div class="child"></div>
  <div class="child"></div>
</div>

【讨论】:

    猜你喜欢
    • 2015-05-16
    • 2020-04-01
    • 2017-02-22
    • 1970-01-01
    • 1970-01-01
    • 2018-10-13
    • 1970-01-01
    • 2014-05-30
    • 2012-02-25
    相关资源
    最近更新 更多