이 글자를 중간 (또는 상단 또는 하단, 구성 할 수 있음)에 수직으로 "전체 박스"클래스와 정렬해야하는이 fiddle이 있습니다. 문제는 내가 인터넷의 모든 솔루션을 시도하고 아무도 일한 적이 없다는 것이다. 내가 가지고있는 설정과 일부 속성이 다른 것을 재정의하여 내가 원하는 결과를 얻을 수 없기 때문에 상상할 수 없다. 그래서 저는 제 특정한 경우에 묻기로했습니다.div 내부의 div를 수직으로 정렬
.daliBoxSortableContainer {
width: 100%;
height: 236px;
min-height: 35px;
text-align: center;
line-height: 100%;
box-sizing: border-box;
position: relative;
padding: 0px;
border-color: rgb(255, 255, 255);
border-width: 0px;
border-style: solid;
opacity: 1;
background-color: red
}
.wholebox {
display: inline-block;
position: relative;
width: 25%;
height: auto;
vertical-align: middle;
touch-action: none;
cursor: inherit;
}
.selectedBox {
background-color: #fff6ec;
border: 1px dashed black;
color: #555;
}
.helpersResizable {
border: 1px solid #777;
background-color: white;
z-index: 1;
position: absolute;
width: 15px;
height: 15px;
cursor: move;
}
.boxStyle {
width: 100%;
height: 100%;
position: relative;
word-wrap: break-word;
overflow: visible;
visibility: visible;
padding: 0px;
background-color: rgb(255, 255, 255);
border-width: 0px;
border-style: solid;
border-color: rgb(0, 0, 0);
border-radius: 0px;
opacity: 1;
}
.showOverlay {
width: 100%;
background: black;
top: 0;
bottom: 0;
position: absolute;
opacity: 0.4;
}
<div class="daliBoxSortableContainer">
<div style="display: table; width: 100%; height: 100%;">
<div style="width: 100%; height: 100%; display: table-cell; vertical-align: top;">
<div style="width: 100%; height: 100%; position: relative;">
<div class="wholebox selectedBox">
<div id="resizableContainer" style="visibility: visible;">
<div style="position: absolute; top: -2px; left: -2px; width: 100%; height: 100%; box-sizing: content-box;"></div>
<div>
<div class="helpersResizable" style="left: -7.5px; top: -7.5px;"></div>
<div class="helpersResizable" style="right: -7.5px; top: -7.5px;"></div>
<div class="helpersResizable" style="left: -7.5px; bottom: -7.5px;"></div>
<div class="helpersResizable" style="right: -7.5px; bottom: -7.5px;"></div>
</div>
</div>
<div class="boxStyle">
<div style="width: 100%; height: 100%;">
<div style="width: 100%; margin: 0px; height: 100%;">
<img src="http://nemanjakovacevic.net/wp-content/uploads/2013/07/placeholder.png" style="width: 100%; height: 100%;">
</div>
</div>
</div>
<div class="showOverlay" style="visibility: hidden;"></div>
</div>
</div>
</div>
</div>
</div>
또한 .wholebox
이 position:absolute
또는 상대는 구성에 따라하면 절대 주위 그래서 위에 드래그 할 수 있습니다 왼쪽 속성이 변경됩니다 가질 수 있음에 유의해야 . 높이는 구성에 따라 자동 또는 고정 될 수 있습니다.
#resizableContainer
.showOverlay
된 div는 내 생각을 무시하지만, 나는 누군가가 CSS에 대한 좋은 책을 알고 있다면 단지의 경우 그 특성 중 일부는, 내가 그런데
작업에서 원하는 결과를 방해를 포함 할 수있다 모든 속성 사이의 호환성 문제는 꽤 많이 받아 들일 것입니다.
미리 감사드립니다.
시도 – Sojtin
http://howtocenterincss.com/ – pawel
@pawel이 페이지는 훌륭합니다! –