width 없애는 방법좀요...
본문
width 없애는 방법좀요...
사진을 다른 사이트에서 드래그해서 퍼오면...
pc에서는 잘보이는데...
모바일에서는 width 크기 때문에 잘려서 나오더라고요...
그래서 width를 없애버릴려고 하는데...
없애는 방법 좀 알려주시면 감사하겠습니다...
예전에 다른분이 아래와 같이 알려주셨는데...안되서요..
ㅠㅠ
<script>
$( document ).ready( function() {
$("#content img").attr({"width":"", "height":""}).css({"max-width": "100%"});
$("#content img").css({"width":"", "height":"", "max-width": "100%"});
} );
</script>
방법과
<?php
preg_replace('/width/i','a',$wr_content);
?>
두방법이 안되는데...다른방법이 있으면 알려주세요...
답변 1
아래와 같이 해보세요.
<script>
$( document ).ready( function() {
$("#content img").removeAttr("width").removeAttr("height").css({"width":"auto", "height":"auto", "max-width": "100%"});
} );
</script>
답변을 작성하시기 전에 로그인 해주세요.