css-position


CSS float image align


I need to add this image at the end of a line, in this way
Style:
h4 { border-bottom: 1px solid black; font-size: 1.6em;}
Code that I did:
<h4>Socializziamo <img src="flourish-decoration.png"
style="position:relative; display:inline-block; float:right;bottom:-7px;" />
</h4>
Is there a better way, because my solution sometimes does not works...
Riccardo
Here's an alternative to ggbhat's answer. The approach here is to apply relative positioning on the heading and absolute positioning on the nested image.
HTML
<h4>
Socializziamo <img src="http://i.stack.imgur.com/68LQd.png" />
</h4>
CSS
h4 {
border-bottom: 1px solid black;
font-size: 1.6em;
position: relative;
}
img {
position: absolute;
right: 0;
bottom: -1px;
}
Demo
http://jsfiddle.net/LqvTx/1/
Use :after psuedo element for adding background image .
h4
{
border-bottom:1px solid #000;
width:100px;
}
h4:after {
content:"";
background:url(http://i.stack.imgur.com/68LQd.png)no-repeat;
width: 30px;
height: 30px;
background-position:68% 25%;
position: absolute;
display: inline-block;
}
Demo:[http://jsfiddle.net/LqvTx/ ]

Related Links

I'm trying to put a fixed divsion at the top of the page but when I scroll with FF, lines are lost
fixed position z-index not working
how to create adjustable gap between elements (div)
How to properly apply a css hack for IE11 transition misbehaviour
How do you make leaflet popup window full screen on small screens?
Fix a div to the bottom while scrolling with skrollr
Sticky Footer at bottom of PAGE, not just bottom of WINDOW
How to set div absolute position from the parent div
Polymer paper-fab with position:fixed behaves strangely when used with core-list that has a scrollTarget
What is the use of “static” positioning in CSS?
CSS: fixed position
Style sheet positioning won't keep everything in place
Div on top 100%
CSS float image align
google sites html box tool css postion absolute
Manual Positioning of Shareaholic ShareBar Plugin

Categories

HOME
porting
scikit-learn
cobalt
deep-learning
awk
c++11
android-studio-2.2
case
swt
themes
pascal
solaris
devise
can
spring-data-mongodb
cublas
babeljs
bookmarks
vsm
trac
boto3
title
pkcs#11
augeas
mel
watson-conversation
supervisor
favicon
azure-powershell
imessage
production
bourbon
ag
pagespeed
qliksense
beautifier
interbase
android-sharedpreferences
motion-detection
pylons
jasmine-node
progress-bar
fractions
8051
wcag
custom-controls
left-join
erb
autolisp
dsx-desktop
openwhisk
hibernate-search
imagenet
timing
flatmap
apache-stanbol
magento-1.9.3
getchar
clarifai
tinymce-3
oracleclient
filehandle
check-mk
lsyncd
template-toolkit
restore
smartfoxserver
pure-css
qtplugin
xdoclet
simevents
appscale
nullable
user-management
highland.js
roadkill-wiki
rate-limiting
doctype
jdk1.7
botan
uvc
j-security-check
exceldatareader
psr-4
cbind
insight.database
template-deduction
reflector
matrix-inverse
gnumeric
windows-embedded-standard
ora-06550
gd-graph
modular
android-loadermanager
panda3d
sentestingkit
wcf-configuration
rmiregistry
boost-signals
objectquery
wiimote
hibernateexception
relative
listactivity
cuteeditor
objective-j
non-clustered-index
binomial-heap
folding
pos-for-.net
dojo-dnd
entitykey
idatareader

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App