Set the width and height of the element to 48 pixels.
.element{
width: 48px;
height: 48px;
}
Set element background to image
.element{
background-image: url('image.png');
}
Move the background so that the upper left corner of the icon is set correctly.
.element{
background-position: 20px 94px;
}
- X Y (), 48px 48 . , , 96px 0px - .
, , DOM, , .
:
<div id="noControl">
<span id="justCreated">
</span>
</div>
CSS , , , :
#justCreated{
display: inline-block;
}
EDIT 2
DOM, , , div .
:
<div id="noControl">
<div id="justCreated">
ALL of the content that used to be inside #noControl
</div>
</div>
CSS
#justCreated{
width: 48px;
height: 48px;
background-image: url('image.png');
background-position: 96px 0px;
z-index: -200;
}
, .
, , . CSS, child (, #noControl > a), div .
, , DOM.