Now I have a webapp running, to which I am trying to add icons, as well as text to describe these icons. I am trying to scale the icons to a place in the div, which works fine, but also scale the image to hold the text in the div. The problem I am facing is that although the image will scale to fit in the div, it will not scale to also allow text in the div.
My HTML code
<div class="ui-grid-b" id="dashGrid"> <div class="ui-block-a changerbutton" style="height:60px;border-bottom: 1px solid;border-right: 1px solid;display:table-cell; vertical-align:middle"> <center> <div> <img src="http://upload.wikimedia.org/wikipedia/commons/8/85/Smiley.svg" class="windowscale-height"> </div> <h4 class="gotobutton" goto="#formSelect" data-icon="grid">Forms</h4> </center> </div> <div class="ui-block-b" style="height:22%"></div> <div class="ui-block-c changerbutton" style="height:90px;border-bottom: 1px solid;border-left: 1px solid;display:table-cell; vertical-align:middle"> <center> <div> <img src="http://upload.wikimedia.org/wikipedia/commons/8/85/Smiley.svg" class="windowscale-height"> </div> <h4 class="gotobutton" goto="#entries" data-icon="info">Entries</h4> </center> </div> <div class="ui-block-a" style="height:22%"></div> <div class="ui-block-b" style="height:22%"></div> <div class="ui-block-c" style="height:22%"></div> <div class="ui-block-a changerbutton" style="height:22%;border-top: 1px solid;border-right: 1px solid;display:table-cell; vertical-align:middle"> <center> <h4 class="gotobutton" goto="#mapScreen" data-icon="star">Map</h4> <div> <img src="http://upload.wikimedia.org/wikipedia/commons/8/85/Smiley.svg" class="windowscale-height"> </div> </center> </div> <div class="ui-block-b" style="height:22%"></div> <div class="ui-block-c changerbutton" style="height:22%;border-top: 1px solid;border-left: 1px solid;display:table-cell; vertical-align:middle"> <center> <h4 class="gotobutton" goto="#locSettings" data-icon="gear">Settings</h4> <div> <img src="http://upload.wikimedia.org/wikipedia/commons/8/85/Smiley.svg" class="windowscale-height"> </div> </center> </div> </div>
and the corresponding CSS is
.windowscale-height { max-height: 100%; max-width: 100%; min-height: 1%; min-height: 1%; }
I have a JSFiddle that shows the problem, http://jsfiddle.net/jDDmC/ .
Ideally, the text as well as the image will fit into the selected fields.
Any help would be appreciated!
source share