Forum Moderators: not2easy

Message Too Old, No Replies

Text then small image aligned right inside DIV

         

shanebryant

5:18 am on Jul 23, 2005 (gmt 0)

10+ Year Member



Maybe (and hopefully) this is simple for you guys, but I have a DIV that will contain some text and some Heading tags and stuff, and at the bottom I want the "footer" for the article containing the name and such to align to the right. I thought this would be easy, but it's not working for me.

I need it to be like this: Text, Text, Small Image
Here is the code:


<div>
<a href="www.example.com/link">By Me</a> ¦ <a title="Something" href="http://www.example.com/link">Something</a> &nbsp;&nbsp; <a title="Comments" href="http://www.example.com/link"><img src="http://www.example.com/link.gif" width="13" height="13" border="0" alt="comments" /></a>
</div>

The problem is that it is inside a DIV with the following CSS:


.blog {
font-size: 10px;
font-family:verdana, arial, sans-serif;
color:#104E8B;
line-height:150%;
margin-left:15px;
margin-right:15px;
border-right: 2px solid #104E8B;
padding:15px;
background-color: #FFFFFF;
}

.blog img{float:left}

Can anyone help me?

SuzyUK

4:36 pm on Jul 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Text, Text, Small Image

do you want that whole line to align to the right?

If so you need to set the text-align property, on the blog div to right.

Then the image, if you want it to be at the far right of the text, you need to float it right too, but it needs to go in the HTML before the text. Floated elements must appear "first in source" i.e. before the text that you want to align with them..

Suzy