Pergunta

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,

Foi útil?

Solução

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

<DIV class=content_mid style="padding:0px!important">
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top