I want to align a div to the right, but keep the margins as they were imposed, except that it ignores them and stays out of the div box. I think with this photo you can see it better
.answer{margin:20px!important;float:right;}
Isawthatmanycodesweremissingtoassistyou:
TheCSSofthediv"box":
.post{background: #fff; border: 1px solid #f0f0f0; padding: 10px; margin: auto auto 30px auto; width: 500px;}
The CSS of this "questions and answers":
.ask{margin: 0; padding: 0;}
.question{margin: 10px; position: relative; top: -10px;}
.asking{color: #012551; font-weight: bold; text-transform: lowercase;}
.answer {margin: 20px !important; float: right;}
.asking-avatar{border-radius: 100%; margin-left: 10px;}
.answer-avatar{border-radius: 100%; float: right;}
The "Questions and Answers" HTML
{block:Answer}
<div class="ask">
<img src="{AskerPortraitURL-30}" class="asking-avatar"/>
<span class="question"><span class="asking">{Asker}</span>: {Question}</span>
<div class="answer">
<img src="{PortraitURL-30}" class="answer-avatar"/>
{Answer}
</div>
</div>
{/block:Answer}