Reputation: 678
<a id="logon_findaP" href="javascript:findA()">Find A
<img id="img_logon_finda" align="right" src="/mobile/Images/findA.png" alt="Find A">
</a>
Above is an image with anchor tag and it displays text first, image later.
Is there a way using CSS and make it display image first and text later aligned vertically?
Upvotes: 0
Views: 1430
Reputation: 545
Use float: left
on the img
.
#logon_findaP #img_logon_finda {
float: left;
}
Upvotes: 1
Reputation: 133403
You can use following CSS rules.
#logon_findaP {
text-align: right;
}
#img_logon_finda {
float : left !important;
}
<a id="logon_findaP" href="javascript:findA()">Find A
<img id="img_logon_finda" src="https://www.gravatar.com/avatar/0241f873cfe31b997225d46d066e6bce?s=48&d=identicon&r=PG" alt="Find A">
</a>
Upvotes: 3
Reputation: 15846
#img_logon_finda {
text-align: left;
float:left;
}
#img_logon_finda:after {
content:'';
display:block;
clear: both;
}
<a id="logon_findaP" href="javascript:findA()">Find A
<img id="img_logon_finda" src="https://www.gravatar.com/avatar/0241f873cfe31b997225d46d066e6bce?s=48&d=identicon&r=PG" alt="Find A">
</a>
Upvotes: 0