html - text-align and margin CSS properties are not responsive -
.scss
div.playlist { position: relative; display: inline-block; } div.playlist { span { position: absolute; text-align: center; height: 100%; width: 100%; color: white; font-size: 20px; } .span-icon { padding-bottom: 50px !important; } } div.playlist span:before { display: inline-block; vertical-align: middle; height: 100%; content: ''; } .html
<div class="playlist"> <span class="span-icon"><ion-icon [name]="data.icon"></ion-icon></span> <span>{{data.text}}</span> <img [src]="data.imageurl" [alt]="data.text" /> </div> out put
now need shown below.please don't consider different icon type , text.i need this.i need responsive top right , bottom right appearance of icon , text.i have tried text-align: right , margin properties.but know approach not responsive on different view ports.so can me solve issue?
position both icons , span text absolute , if needed use css calc() function align them @ top-right , bottom-right above image.
.playlist { position: relative; display: inline-block; width: 240px; height: 200px; overflow: hidden; } .playlist img { width: 100%; height: 100%; } .playlist .span-icon { position: absolute; top: 5px; right: calc(100% - 98%); color: #fff; } .playlist .tm { position: absolute; bottom: 5px; right: calc(100% - 98%); color: #fff; } <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> <div class="playlist"> <span class="span-icon"><i class="fa fa-film"></i></span> <span class="tm">2:10</span> <img src="http://lorempixel.com/output/city-q-c-640-480-6.jpg"> </div> 

Comments
Post a Comment