이미지 축소판의 가로 세로 비율을 유지하여 부숴 보이지 않게하는 방법은 무엇입니까?이미지 축소판 그림의 가로 세로 비율을 유지하는 방법
protected function DisplayPhoto($Sender) {
$body = $Sender->EventArguments['Discussion']->Body;
preg_match('#\<img(.+?)src=(.+?)\>#s', $body, $matches);
if(isset($matches[2])){
$image = "src=" . $matches[2];
echo '<img class="ProfilePhotoSmall"' . $image . '>';
}else{
//do what you want
}
}
여기에 CSS가 있습니다.
ul.Discussions li img {
height: 60px;
width: 110px;
padding: 0 6px 0 4px;
float: right;
position: relative;
}
.Discussion.ItemContent {
padding-right: 0px;
padding-bottom: 10px;
display: inline;
}
'.ProfilePhotoSmall'의 CSS 모양은 무엇입니까? CSS 내부 이외에는 이미지의 크기를 변경 한 방법을 찾을 수 없습니까? – BenM
css가 제공됩니다. 감사. – user3040048