I am trying to get my sprite icon in center, but its coming in left, if I am removing float:left then icon is not visible, although I tried position: absolute then icon is overlapping my text.
please suggest me how I can take my icon and text in middle of the “div” or “p”.
If you remove the float then the element reverts back to an inline element and inline elements cannot have dimensions defined so therefore there is no space to show your image.
If instead you use display:block then you can apply your width and height and also use auto margins to centre the element.
AS Simon said above it does all depend on what the desired outcome should look like.
(Note label elements should only be used as labels for form elements and not other text snippets).