문제

I would like to know how to align an img to the right edge within a <DIV></DIV> element.

I've been using the following code:

<DIV class=content_mid><img alt="" style="float:right; margin:0px; padding:0px; border:0px; right:0px;" align="right" src=".../img_name.png"></DIV>

But there is still a bit of space between the image and the right edge of the DIV.

Another note: I'm using a CMS for this, so I don't have access to the CSS. It needs to be done through HTML.

I've also used position:relative;, which hasn't worked for me either.

Any help would be greatly appreciated.

Thanks,

도움이 되었습니까?

해결책

I assume parent div element has style "padding". Try code below,

<DIV class=content_mid style="padding:0px!important">
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top