关于@font-face制作ICON的技巧不在是技巧了,最主要的关键是如何得到这些icon的svg等字体文件,今天藤藤为大家整理了另外一个字体库“iconic”,这个字体库包含了172个常用的ICONl图标,希望大家喜欢。至于怎么制作,就不用我说了,因为站上这方面的案例和实现方法已经介绍很多篇了,如果你是第一次接触,你可以在搜索框中搜索“icon”,这样在w3cplus会给你呈现出你需要的icon制作方法教程与相关案例。那么到今天为止,藤藤在w3cplus上为大家共提供了五份有关于字体制作 icon图标的案例,有兴趣的围观吧。
HTML CODE
<a href="#" class="icon icon-phone"> <span> <em>icon-phone</em> </span> </a>
这里仅显示了一个Icon的结构,其他的ICON结构使用相同,特别注意,此处结构添加了一个tip效果,方便大家查询对应的ICON类名,实际使用时,可以将tip中的代码去除。
CSS Code
body { background-color: #c5c5c5; } .demo { width: 900px; text-align: left; margin: 40px auto 0; } .control_buttons li { display: inline-block; margin-right: 6px; } .icon { position: relative; display: inline-block; color: #787878; width: 50px; height: 50px; line-height: 50px; text-align: center; margin-bottom: 20px; border-radius: 3px; background-color: #e5e5e5; } .icon:hover { color: #3d3d3d; box-shadow:0 1px 0 #fff inset, 0 0 2px 1px #afafaf; text-decoration:none; background-image: -webkit-linear-gradient(top,#f2f2f2,#e5e5e5); background-image: -moz-linear-gradient(top,#f2f2f2,#e5e5e5); background-image: -o-linear-gradient(top,#f2f2f2,#e5e5e5); background-image: linear-gradient(top,#f2f2f2,#e5e5e5); } .icon:hover span { max-height: 40px; } .icon span { position: absolute; left: -32px; top: 50px; display: block; overflow: hidden; max-height: 0; text-align: center; -webkit-transition: max-height .3s linear; -moz-transition: max-height .3s linear; -o-transition: max-height .3s linear; transition: max-height .3s linear; z-index: 2; } .icon span em { position: relative; display: block; width: 130px; line-height: 26px; font-style: normal; color: #fff; text-shadow:0 0 0 #fff; margin-top: 10px; border: 2px solid rgba(255,255,255,.9); background-color:#222; z-index: 3; } .icon span em:before, .icon span em:after { position: absolute; left: 50%; content: ''; width: 1px; height: 1px; } .icon span em:before { top: -15px; border: 7px solid transparent; border-bottom-color: rgba(255,255,255,.9); margin-left: -16px; } .icon span em:after { top: -11px; border: 5px solid transparent; border-bottom-color: #222; margin-left: -14px; } .icon:before { font-family: 'iconic'; font-style: normal; speak: none; font-weight: normal; -webkit-font-smoothing: antialiased; -moz-font-smoothing: antialiased; font-smoothing: antialiased; font-size: 24px; } .icon-chat:before { content: "\21"; } .icon-calendar:before { content: "\22"; } .icon-move-alt1:before { content: "\23"; } .icon-loop:before { content: "\24"; } .icon-arrow-up-alt2:before { content: "\25"; } .icon-fullscreen-alt:before { content: "\26"; } .icon-article:before { content: "\27"; } .icon-umbrella:before { content: "\28"; } .icon-chart:before { content: "\29"; } .icon-chart-alt:before { content: "\2a"; } .icon-read-more:before { content: "\2b"; } .icon-iphone:before { content: "\2c"; } .icon-star:before { content: "\2d"; } .icon-map-pin-stroke:before { content: "\2e"; } .icon-bars:before { content: "\2f"; } .icon-list:before { content: "\30"; } .icon-battery-empty:before { content: "\31"; } .icon-battery-half:before { content: "\32"; } .icon-battery-full:before { content: "\33"; } .icon-list-nested:before { content: "\34"; } .icon-bars-alt:before { content: "\35"; } .icon-eye:before { content: "\36"; } .icon-book:before { content: "\37"; } .icon-map-pin-alt:before { content: "\38"; } .icon-map-pin-fill:before { content: "\39"; } .icon-user:before { content: "\3a"; } .icon-battery-charging:before { content: "\3b"; } .icon-book-alt:before { content: "\3c"; } .icon-target:before { content: "\3d"; } .icon-steering-wheel:before { content: "\3e"; } .icon-cd:before { content: "\3f"; } .icon-arrow-down-alt2:before { content: "\40"; } .icon-arrow-down-alt1:before { content: "\41"; } .icon-arrow-down:before { content: "\42"; } .icon-loop-alt1:before { content: "\43"; } .icon-loop-alt2:before { content: "\44"; } .icon-loop-alt3:before { content: "\45"; } .icon-loop-alt4:before { content: "\46"; } .icon-magnifying-glass:before { content: "\47"; } .icon-award-fill:before { content: "\48"; } .icon-move-alt2:before { content: "\49"; } .icon-equalizer:before { content: "\4a"; } .icon-calendar-alt-stroke:before { content: "\4b"; } .icon-calendar-alt-fill:before { content: "\4c"; } .icon-share:before { content: "\4d"; } .icon-mail:before { content: "\4e"; } .icon-heart-stroke:before { content: "\4f"; } .icon-award-stroke:before { content: "\50"; } .icon-comment-stroke:before { content: "\51"; } .icon-comment-alt1-fill:before { content: "\52"; } .icon-comment-alt1-stroke:before { content: "\53"; } .icon-chat-alt-stroke:before { content: "\54"; } .icon-chat-alt-fill:before { content: "\55"; } .icon-comment-fill:before { content: "\56"; } .icon-comment-alt2-fill:before { content: "\57"; } .icon-comment-alt2-stroke:before { content: "\58"; } .icon-checkmark:before { content: "\59"; } .icon-check-alt:before { content: "\5a"; } .icon-x:before { content: "\5b"; } .icon-document-fill:before { content: "\5c"; } .icon-document-stroke:before { content: "\5d"; } .icon-document-alt-fill:before { content: "\5e"; } .icon-document-alt-stroke:before { content: "\5f"; } .icon-heart-fill:before { content: "\60"; } .icon-movie:before { content: "\61"; } .icon-trash-stroke:before { content: "\62"; } .icon-trash-fill:before { content: "\63"; } .icon-beaker-alt:before { content: "\64"; } .icon-beaker:before { content: "\65"; } .icon-transfer:before { content: "\66"; } .icon-move-vertical:before { content: "\67"; } .icon-move-vertical-alt1:before { content: "\68"; } .icon-move-vertical-alt2:before { content: "\69"; } .icon-move-horizontal:before { content: "\6a"; } .icon-move-horizontal-alt1:before { content: "\6b"; } .icon-move-horizontal-alt2:before { content: "\6c"; } .icon-key-fill:before { content: "\6d"; } .icon-key-stroke:before { content: "\6e"; } .icon-microphone:before { content: "\6f"; } .icon-compass:before { content: "\70"; } .icon-book-alt2:before { content: "\71"; } .icon-download:before { content: "\72"; } .icon-home:before { content: "\73"; } .icon-upload:before { content: "\74"; } .icon-clock:before { content: "\75"; } .icon-pen:before { content: "\76"; } .icon-box:before { content: "\77"; } .icon-headphones:before { content: "\78"; } .icon-volume:before { content: "\79"; } .icon-folder-stroke:before { content: "\7a"; } .icon-pen-alt-stroke:before { content: "\7b"; } .icon-cloud-download:before { content: "\7c"; } .icon-lock-stroke:before { content: "\7d"; } .icon-cloud-upload:before { content: "\7e"; } .icon-lock-fill:before { content: "\e000"; } .icon-pen-alt-fill:before { content: "\e001"; } .icon-folder-fill:before { content: "\e002"; } .icon-volume-mute:before { content: "\e003"; } .icon-play:before { content: "\e004"; } .icon-pause:before { content: "\e005"; } .icon-ampersand:before { content: "\e006"; } .icon-at:before { content: "\e007"; } .icon-pen-alt2:before { content: "\e008"; } .icon-brush:before { content: "\e009"; } .icon-unlock-fill:before { content: "\e00a"; } .icon-unlock-stroke:before { content: "\e00b"; } .icon-fork:before { content: "\e00c"; } .icon-paperclip:before { content: "\e00d"; } .icon-tag-stroke:before { content: "\e00e"; } .icon-tag-fill:before { content: "\e00f"; } .icon-sun-stroke:before { content: "\e010"; } .icon-sun-fill:before { content: "\e011"; } .icon-moon-stroke:before { content: "\e012"; } .icon-moon-fill:before { content: "\e013"; } .icon-cloud:before { content: "\e014"; } .icon-rain:before { content: "\e015"; } .icon-aperture-alt:before { content: "\e016"; } .icon-aperture:before { content: "\e017"; } .icon-camera:before { content: "\e018"; } .icon-image:before { content: "\e019"; } .icon-layers:before { content: "\e01a"; } .icon-layers-alt:before { content: "\e01b"; } .icon-eyedropper:before { content: "\e01c"; } .icon-brush-alt:before { content: "\e01d"; } .icon-info:before { content: "\e01e"; } .icon-question-mark:before { content: "\e01f"; } .icon-pilcrow:before { content: "\e020"; } .icon-hash:before { content: "\e021"; } .icon-left-quote:before { content: "\e022"; } .icon-right-quote:before { content: "\e023"; } .icon-left-quote-alt:before { content: "\e024"; } .icon-right-quote-alt:before { content: "\e025"; } .icon-fullscreen:before { content: "\e026"; } .icon-fullscreen-exit-alt:before { content: "\e027"; } .icon-fullscreen-exit:before { content: "\e028"; } .icon-play-alt:before { content: "\e029"; } .icon-last:before { content: "\e02a"; } .icon-first:before { content: "\e02b"; } .icon-eject:before { content: "\e02c"; } .icon-stop:before { content: "\e02d"; } .icon-arrow-left:before { content: "\e02e"; } .icon-new-window:before { content: "\e02f"; } .icon-plus:before { content: "\e030"; } .icon-x-altx-alt:before { content: "\e031"; } .icon-denied:before { content: "\e032"; } .icon-plus-alt:before { content: "\e033"; } .icon-lightbulb:before { content: "\e034"; } .icon-arrow-left-alt1:before { content: "\e035"; } .icon-arrow-left-alt2:before { content: "\e036"; } .icon-spin-alt:before { content: "\e037"; } .icon-minus:before { content: "\e038"; } .icon-cursor:before { content: "\e039"; } .icon-rss:before { content: "\e03a"; } .icon-minus-alt:before { content: "\e03b"; } .icon-spin:before { content: "\e03c"; } .icon-arrow-right:before { content: "\e03d"; } .icon-arrow-right-alt1:before { content: "\e03e"; } .icon-curved-arrow:before { content: "\e03f"; } .icon-pin:before { content: "\e040"; } .icon-rss-alt:before { content: "\e041"; } .icon-wrench:before { content: "\e042"; } .icon-dial:before { content: "\e043"; } .icon-cog:before { content: "\e044"; } .icon-move:before { content: "\e045"; } .icon-bolt:before { content: "\e046"; } .icon-link:before { content: "\e047"; } .icon-undo:before { content: "\e048"; } .icon-reload:before { content: "\e049"; } .icon-reload-alt:before { content: "\e04a"; } .icon-arrow-up-alt1:before { content: "\e04b"; } .icon-arrow-up:before { content: "\e04c"; } .icon-arrow-right-alt2:before { content: "\e04d"; } @font-face { font-family: 'iconic'; src:url('fonts/iconic.eot'); src:url('fonts/iconic.eot?#iefix') format('embedded-opentype'), url('fonts/iconic.svg#iconic') format('svg'), url('fonts/iconic.woff') format('woff'), url('fonts/iconic.ttf') format('truetype'); font-weight: normal; font-style: normal; }
特别声明,此案例的是由别的SVG字体库,通过IcoMoon.io在线转换生成。
如需转载,烦请注明出处:http://www.w3cplus.com/demo/172-iconic-icon-ui.html