如何居中网格.js
How to center gridster.js?
我一直在玩Gridster.js,但是对于我的生活,我似乎无法使网格居中,它总是保持合理,我已经尝试了又尝试,但也许我错过了一些东西。
我已经制作了一个具有我网格基础的jsfiddle,我希望有人可以解决它并帮助我将其居中,请:)
.gridster {
background: #004756;
margin: 0 auto;
opacity: .8;
-webkit-transition: opacity .6s;
-moz-transition: opacity .6s;
-o-transition: opacity .6s;
-ms-transition: opacity .6s;
transition: opacity .6s;
text-align: center;
}
.gridster > * {
margin: 0 auto;
-webkit-transition: height .4s;
-moz-transition: height .4s;
-o-transition: height .4s;
-ms-transition: height .4s;
transition: height .4s;
}
.gridster .gs_w{
z-index: 2;
position: absolute;
background: #FFF;
cursor: pointer;
-webkit-box-shadow: 0 0 5px rgba(0,0,0,0.3);
box-shadow: 0 0 5px rgba(0,0,0,0.3);
}
.ready .gs_w:not(.preview-holder) {
-webkit-transition: opacity .3s, left .3s, top .3s;
-moz-transition: opacity .3s, left .3s, top .3s;
-o-transition: opacity .3s, left .3s, top .3s;
transition: opacity .3s, left .3s, top .3s;
}
.ready .gs_w:not(.preview-holder) {
-webkit-transition: opacity .3s, left .3s, top .3s, width .3s, height .3s;
-moz-transition: opacity .3s, left .3s, top .3s, width .3s, height .3s;
-o-transition: opacity .3s, left .3s, top .3s, width .3s, height .3s;
transition: opacity .3s, left .3s, top .3s, width .3s, height .3s;
}
.gridster .preview-holder {
z-index: 1;
position: absolute;
background-color: #fff;
border-color: #fff;
opacity: 0.3;
}
.gridster .player-revert {
z-index: 10!important;
-webkit-transition: left .3s, top .3s!important;
-moz-transition: left .3s, top .3s!important;
-o-transition: left .3s, top .3s!important;
transition: left .3s, top .3s!important;
}
.gridster .dragging {
z-index: 10!important;
-webkit-transition: all 0s !important;
-moz-transition: all 0s !important;
-o-transition: all 0s !important;
transition: all 0s !important;
}
.gridWrapper {
width: 100%;
overflow-x: scroll;
overflow-y: hidden;
}
.gridAlignerWrapper {
display: table;
width: 100%;
height: 100%;
}
.gridAligner {
width: 100%;
display: table-cell;
}
body {
background-color: #EEEEEE;
font-family: 'Helvetica Neue', Arial, sans-serif;
-webkit-font-smoothing: antialiased;
font-size: x-small;
color: #666666;
text-align: center;
vertical-align: middle;
}
ul, ol {
list-style: none;
margin:0 auto;
text-align: center;
vertical-align: middle;
}
h1 {
margin-bottom: 12px;
text-align: center;
font-size: 30px;
font-weight: 400;
}
h3 {
font-size: 25px;
font-weight: 600;
color: white;
}
/* Uncomment this if you set helper : "clone" in draggable options */
/*.gridster .player {
opacity:0;
}*/
https://jsfiddle.net/036qutd9/4/
谢谢
谢谢Paulie_D,我设法解决了它并让它居中:)
.gridster {
width: 730px;
background: #004756;
margin-left:auto;
margin-right:auto;
opacity: .8;
-webkit-transition: opacity .6s;
-moz-transition: opacity .6s;
-o-transition: opacity .6s;
-ms-transition: opacity .6s;
transition: opacity .6s;
text-align: center;
}
.gridster > * {
margin: 0 auto;
-webkit-transition: height .4s;
-moz-transition: height .4s;
-o-transition: height .4s;
-ms-transition: height .4s;
transition: height .4s;
}
相关文章:
- 如何使用.log数据文件显示EXT-js网格
- ext-js网格面板滚动条不适用于jquery
- 分页 在 Ext JS 网格中
- 中止ext-js网格存储ajax调用
- 为什么当我更改Three.js网格的比例时,我的旋转会出错
- Three.js网格位置在集上未更改
- Knockout js网格视图未显示
- 巴比伦.js网格拾取和忽略一些网格
- 挖空 JS 网格,禁止绑定语句中的字符
- 使用自定义网格,而不是生成的三分之一.js网格
- 如何在 Ext JS 网格列中打开共享路径文件位置
- Ext.js 网格中的自定义编辑器
- 在材质中使用 alphaMap 隐藏三个.js网格的部分
- 在选择ext-js网格中的行时,复选框被选中
- 使用本机add_widget向Gridster.js网格添加项导致未知错误
- 如何在ext-js网格中将记录数据显示为链接
- 将数组中的值循环到JS网格中
- Three.js-网格don't接收3个以上的光
- Three.js-网格、三角形和Lambert材质
- 如何在Ext JS 3.4网格中获得文本字段值