html - Icon in footer not positioning correctly -


i have footer want position icon @ right side inside it. icon 36 pixel in width , height. it's inside div container padding of 7 pixel.

from calculations icon should vertically centered, it's not.

i want icon have same padding on top, bottom , right side.
doing wrong?

jsfiddle

html:

<div data-role="header" class="pageheader"></div> <div data-role="footer" class="pagefooter">     <div class="info-icon">         <a class="info-anchor" href="#" style="text-decoration: none; text-shadow: none; color: #ffffff;">             <img class="info-img" src="https://storage.googleapis.com/material-icons/external-assets/v1/icons/svg/ic_info_outline_black_36px.svg">         </a>     </div> </div> 

css:

.info-icon {     z-index: 200;     position: absolute;     padding: 7px;     margin: 0;     display: inline-block;     right: 0;     bottom: 0;     background-color: #00ff00; } .info-anchor {     background-color: #0000ff;     padding: 0; } .info-img {     background-color: #ffffff;     margin: 0; } [data-role="header"], [data-role="footer"] {     height: 50px !important;     background-color: #ff0000 !important;     width: 100% !important;     border: 0 !important;     text-align: center !important;     text-shadow: none !important;     color: #ffffff !important; } [data-role="footer"] {     bottom: 0;     position: absolute; } 

just add display:block .info-img otherwise gets bottom spacing (images inline elements default). may want add .info-anchor covers full image

updated fiddle


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -