이 코드에서 임의의 코드와 자식 이미지 트리를 볼 수 있습니다. 사용자 지정 클래스를 사용하더라도 자식 이미지는 항상 이미지의 부모 최대 너비 속성을 따릅니다. 어쨌든 사용되는 클래스에 대해 이것으로 얻을 수 있습니까?
참고 이이 말도 많은 CSS 재 지정을 사용하여 vBulletin에 켜져 있습니다. 새 CSS는 vbulletin 사용자 정의 CSS 파일 "additional.css"에 있습니다.
또한 호버 효과 는 120px로 제한되지만 일반 클래스는 그렇지 않습니다.
암호
<div class="content">
<p>
<div>
<div class="something">
<img src="http://shadowness.com/file/item9/314049/image.jpg" class="thumbbbimg" />
</div>
</div>
</p>
</div>
CSS
.content img {
max-width: 100%;
}
.thumbbbimg {
max-width: 120px;
}
실제 CSS
/* Thumb BBCode CSS */
.content img.thumbbbimg {
width: 120px;
max-width: 120px;
max-height: 120px;
opacity: 75;
margin: 10px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-khtml-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0 0 5px 5px rgba(0,0,0,0.4);
-moz-box-shadow: 0 0 5px 5px rgba(0,0,0,0.4);
box-shadow: 0 0 5px 5px rgba(0,0,0,0.4);
border: 1px solid #8C8C8C;
filter: url(filters.svg#grayscale);
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale");
-webkit-filter: grayscale(100%);
filter: gray; /* IE6-9 */
-webkit-filter: grayscale(1);
overflow: hidden;
}
.content img.thumbbbimg:hover {
width: 120px;
max-width: 120px;
max-height: 120px;
opacity: 100;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-khtml-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0 0 5px 5px rgba(255,255,255,0.3);
-moz-box-shadow: 0 0 5px 5px rgba(255,255,255,0.3);
box-shadow: 0 0 5px 5px rgba(255,255,255,0.3);
filter: none;
-webkit-filter: grayscale(0%);
filter: gray;
-webkit-filter: grayscale(0);
}
.content img :not(.thumbbimg) {
max-width: 100%;
}
.thumbbbimg {
max-width: 120px;
}
깡깡이:
http://jsfiddle.net/41tyamsz/2/
using :not
은 지정된 요소를 제외한 요소에 규칙을 적용합니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다