html - alligning an image and label in a div -



html - alligning an image and label in a div -

i have label , image in div acts navbar in mobile app. need text centred , image on right. can't manage right combination. code here:

<div data-role="header"> <div class="centered"> <img src="../images/culogo50x40.png" alt="logo" height="25px" class="c1"> <h3>login</h3> </div> </div>

in class centred, have:

.centered { width: 100%; height: auto; position: fixed; top: 20%; background-color: red; text-align:center; -webkit-backface-visibility: hidden; }

and in class c1, have:

img.c1 { float: right; display: inline; }

any help appreciated. i'm pretty new this

you can position img absolute , create right:0; float right. create vertical middle create next changes style

img.c1 { position: absolute; right: 0; top: 0; bottom: 0; margin: auto; }

demo

note: margin:auto works either fixed width or height element.

html css cordova alignment

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -