{"id":7255,"date":"2019-09-17T17:12:37","date_gmt":"2019-09-18T00:12:37","guid":{"rendered":"https:\/\/www.dognmonkey.com\/techs\/?p=7255"},"modified":"2019-09-17T17:12:37","modified_gmt":"2019-09-18T00:12:37","slug":"how-to-create-sprites-and-use-icons-with-css","status":"publish","type":"post","link":"https:\/\/www.dognmonkey.com\/mythemes\/how-to-create-sprites-and-use-icons-with-css.html","title":{"rendered":"How To Create Sprites and Use Icons with CSS"},"content":{"rendered":"<p>[lightgallery]<br \/>\n<em>Create a sprite with <a class=\"preview\" href=\"https:\/\/instantsprite.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Instant Sprite<\/a>: download the png sprite image and usage.<\/em><br \/>\n[lgallery]<a class=\"preview\" href=\"https:\/\/www.dognmonkey.com\/mythemes\/wp-content\/uploads\/z_sprite1.jpg\" data-sub-html=\"load icons to Instant Sprite\" title=\"load icons to Instant Sprite\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-thumbnail wp-image-7256\" src=\"https:\/\/www.dognmonkey.com\/mythemes\/wp-content\/uploads\/z_sprite1-200x112.jpg\" alt=\"load icons to Instant Sprite\" width=\"200\" height=\"112\" \/><\/a> <a class=\"preview\" href=\"https:\/\/www.dognmonkey.com\/mythemes\/wp-content\/uploads\/z_sprite2.jpg\" data-sub-html=\"Copy Usage for x-y position\" title=\"Copy Usage for x-y position\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-thumbnail wp-image-7257\" src=\"https:\/\/www.dognmonkey.com\/mythemes\/wp-content\/uploads\/z_sprite2-200x112.jpg\" alt=\"Copy Usage for x-y position\" width=\"200\" height=\"112\" \/><\/a> <a class=\"preview\" href=\"https:\/\/www.dognmonkey.com\/mythemes\/wp-content\/uploads\/z_sprite3.jpg\" data-sub-html=\"Save Sprite as PNG image\" title=\"Save Sprite as PNG image\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-thumbnail wp-image-7258\" src=\"https:\/\/www.dognmonkey.com\/mythemes\/wp-content\/uploads\/z_sprite3-200x112.jpg\" alt=\"Save Sprite as PNG image\" width=\"200\" height=\"112\" \/><\/a> <a class=\"preview\" href=\"https:\/\/www.dognmonkey.com\/mythemes\/wp-content\/uploads\/z_sprite4.jpg\" data-sub-html=\"Final Icons Display\" title=\"Final Icons Display\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-thumbnail wp-image-7259\" src=\"https:\/\/www.dognmonkey.com\/mythemes\/wp-content\/uploads\/z_sprite4-200x112.jpg\" alt=\"Final Icons Display\" width=\"200\" height=\"112\" \/><\/a>[\/lgallery]<br \/>\n<em>CSS codes:<\/em><\/p>\n<p><code>#return_top a,#youtube a, #bird a{position:fixed;bottom:1px;display:block;width:2.5rem;z-index:100001}<br \/>\n#fixed_icons{background:linear-gradient(270deg,#ddd,#777 80%) no-repeat;padding:0 2%;position:fixed;width:100%;height:2.5rem;bottom:0;margin:0 auto;z-index:10001}<br \/>\n#home_icon a{position:fixed;right:44px;bottom:1px;display:block;height:43px;width:44px;background:url(images\/mysprite.png) -100px 0; no-repeat;z-index:100001}<br \/>\n#return_top a{right:0;height:40px;background:url(images\/mysprite.png) 0 0; no-repeat}#youtube a{right:90px;height:40px;background:url(images\/mysprite.png) -50px 0; no-repeat}<br \/>\n#bird a{right:135px;height:40px;background:url(images\/mysprite.png) -156px 0; no-repeat}<\/code><\/p>\n<p><em>footer codes:<\/em><\/p>\n<p><code>&lt;div id=\"fixed_icons\"&gt;<br \/>\n&lt;div id=\"return_top\"&gt;&lt;a href=\"#masthead\" title=\"Go To Top\"&gt;&lt;\/a&gt;&lt;\/div&gt;&lt;div id=\"home_icon\"&gt;&lt;a href=\"&lt;?php echo esc_url(home_url('\/')); ?&gt;\" title=\"Go Home\"&gt;&lt;\/a&gt;&lt;\/div&gt;<br \/>\n&lt;div class=\"fb-share-button\"<br \/>\ndata-href=\"\"<br \/>\ndata-size=\"large\"<br \/>\ndata-layout=\"button_count\"&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;div class=\"fb-like\"<br \/>\ndata-href=\"\"<br \/>\ndata-size=\"large\"<br \/>\ndata-layout=\"button_count\"<br \/>\ndata-action=\"like\"<br \/>\ndata-show-faces=\"true\"&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;a href=\"https:\/\/twitter.com\/share?ref_src=twsrc%5Etfw\" title=\"tweet post\" target=\"_blank\"&gt;&lt;div id=\"bird\"&gt;&lt;\/a&gt;&lt;\/div&gt;<br \/>\n&lt;p id=\"youtube\"&gt;&lt;a href=\"https:\/\/www.youtube.com\/user\/3dogs1monkey\/videos\" title=\"Youtube Channel\" target=\"_blank\"&gt;&lt;\/a&gt;&lt;\/p&gt;<br \/>\n&lt;\/div&gt;<\/code><\/p>\n<ul class=\"lcp_catlist\" id=\"lcp_instance_0\"><\/ul>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[lightgallery] Create a sprite with Instant Sprite: download the png sprite image and usage. [lgallery] [\/lgallery] CSS codes: #return_top a,#youtube a, #bird a{position:fixed;bottom:1px;display:block;width:2.5rem;z-index:100001} #fixed_icons{background:linear-gradient(270deg,#ddd,#777 80%) no-repeat;padding:0 2%;position:fixed;width:100%;height:2.5rem;bottom:0;margin:0 auto;z-index:10001} #home_icon a{position:fixed;right:44px;bottom:1px;display:block;height:43px;width:44px;background:url(images\/mysprite.png) -100px 0; no-repeat;z-index:100001} #return_top a{right:0;height:40px;background:url(images\/mysprite.png) 0 0; no-repeat}#youtube a{right:90px;height:40px;background:url(images\/mysprite.png) -50px 0; no-repeat} #bird a{right:135px;height:40px;background:url(images\/mysprite.png) -156px 0; no-repeat} footer codes: &lt;div id=&#8221;fixed_icons&#8221;&gt; &lt;div id=&#8221;return_top&#8221;&gt;&lt;a href=&#8221;#masthead&#8221; title=&#8221;Go <a href=\"https:\/\/www.dognmonkey.com\/mythemes\/how-to-create-sprites-and-use-icons-with-css.html\" class=\"more-link\">&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62,77,79],"tags":[316,497,581,597,1078,1079,1218],"class_list":["post-7255","post","type-post","status-publish","format-standard","hentry","category-css-wordpress","category-themes","category-website-speed","tag-css","tag-gtmetric","tag-icons","tag-images","tag-sprite","tag-sprites","tag-website-speed"],"views":144,"_links":{"self":[{"href":"https:\/\/www.dognmonkey.com\/mythemes\/wp-json\/wp\/v2\/posts\/7255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dognmonkey.com\/mythemes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dognmonkey.com\/mythemes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dognmonkey.com\/mythemes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dognmonkey.com\/mythemes\/wp-json\/wp\/v2\/comments?post=7255"}],"version-history":[{"count":0,"href":"https:\/\/www.dognmonkey.com\/mythemes\/wp-json\/wp\/v2\/posts\/7255\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dognmonkey.com\/mythemes\/wp-json\/wp\/v2\/media?parent=7255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dognmonkey.com\/mythemes\/wp-json\/wp\/v2\/categories?post=7255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dognmonkey.com\/mythemes\/wp-json\/wp\/v2\/tags?post=7255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}