나는 CSS와 같은 이미지를 조작 할 방법이 없다는 것을 알고있다.
나는 당신이 그들이하는 일은 항상 위쪽 이미지와 아래쪽 이미지가 있고, 나머지는 중간 이미지로 채우는 것이라고 생각한다. . 각 측면에도 적용 할 수 있습니다. CSS3 코드를 추가하고 CSS2 코드를 쉽게 결정할 수 있습니다.
이 (CSS3)과 같습니다
.button_horizontal {
background: url(topimage) top left no-repeat,
url(bottomimage) bottom left no-repeat,
url(middleimage) top left repeat-y;
}
.button_vertical {
background: url(left.png) top left no-repeat,
url(right.png) top right no-repeat,
url(middle.png) top left repeat-x;
}
이 (CSS2)과 같을 것이다 : 당신이 sliding doors 기술로 알려져 있습니다 무슨 말을하는지
.top {
background: url(top.png) top left no-repeat;
width:100%;
height:10px;
}
.middle {
background: url(bottom.png) bottom left no-repeat;
width:100%;
height:180px;
}
.button{
background: url(middle.png) top left repeat-y;
width:500px;
height:200px;
}
<div class="button">
<div class="top"> </div>
<div class="middle"><p>stuff goes in here :D</p></div>
</div>
그러나 어떻게하면 ''요소가 배경 이미지를 왼쪽으로가 아닌 오른쪽으로 확장시킬 수 있습니까? 왜냐하면 기본적으로 이미지의 오른쪽 가장자리는 가운데 부분보다 먼저 표시되어야하기 때문입니다. 확실히 단순한'float : right;'는하지 않을 것인가? – Avicinnian
'background-position : right'라고 말하면 항상 오른쪽 가장자리에 "붙어 있습니다". – CyberDude
+1 CSS와의 호환성이 문제인 경우 완벽한 답변 – Serdalis