Google Icon เป็นส่วนหนึ่งของบริการ Google Chart API การออกแบบและพัฒนาไอคอนในรูปแบบต่าง ๆ เพื่อการนำไปใช้งานบนเว็บไซต์ รวมถึงการแทรกไอคอนลงใน
Google Maps ได้อย่างรวดเร็ว โดยทาง Google จะเน้นไปในเรื่องของความชัดเจน ใช้งานง่าย และมีความสวยงาม ในการแสดงผลบน
แพลตฟอร์ม
การเรียกใช้งาน API แบ่งออกได้เป็น 2 วิธี
- วิธีที่ 1 เรียกใช้งานบน Html :
โค้ด: เลือกทั้งหมด
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
- วิธีที่ 2 เรียกใช้งานบน hosting ของตนเอง :
โค้ด: เลือกทั้งหมด
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(https://example.com/MaterialIcons-Regular.eot); /* For IE6-8 */
src: local('Material Icons'),
local('MaterialIcons-Regular'),
url(https://example.com/MaterialIcons-Regular.woff2) format('woff2'),
url(https://example.com/MaterialIcons-Regular.woff) format('woff'),
url(https://example.com/MaterialIcons-Regular.ttf) format('truetype');
}
โค้ด: เลือกทั้งหมด
.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px; /* Preferred icon size */
display: inline-block;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;
/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;
/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;
/* Support for IE. */
font-feature-settings: 'liga';
}
การใช้งาน Icon บน Html :
ตัวอย่างการใช้งานจริง :
โค้ด: เลือกทั้งหมด
<html>
<head>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
</head>
<body>
<center>
<br/><br/>
<i class="material-icons">android</i>
<i class="material-icons">account_balance</i>
<i class="material-icons">alarm_add</i>
<i class="material-icons">bookmark_border</i>
<br/><br/>
<i class="material-icons md-48">face</i>
<i class="material-icons">remove_shopping_cart</i>
<i class="material-icons">aspect_ratio</i>
<i class="material-icons">build</i>
</center>
</body>
</html>
Browser ที่รองรับการใช้งาน
- Google Chrome 11
- Mozilla Firefox 3.5
- Apple Safari 5
- Microsoft IE 10
- Opera 15
- Apple MobileSafari iOS 4.2
- Android Browser 3.0
สามารถเลือกใช้งานไอคอนได้ที่ :
https://material.io/icons/
[b]Google Icon[/b] เป็นส่วนหนึ่งของบริการ Google Chart API การออกแบบและพัฒนาไอคอนในรูปแบบต่าง ๆ เพื่อการนำไปใช้งานบนเว็บไซต์ รวมถึงการแทรกไอคอนลงใน [url=https://www.mindphp.com/%E0%B8%9A%E0%B8%97%E0%B8%84%E0%B8%A7%E0%B8%B2%E0%B8%A1/google-for-work/3780-google-map-%E0%B8%81%E0%B8%B9%E0%B9%80%E0%B8%81%E0%B8%B4%E0%B8%A5.html]Google Maps[/url] ได้อย่างรวดเร็ว โดยทาง Google จะเน้นไปในเรื่องของความชัดเจน ใช้งานง่าย และมีความสวยงาม ในการแสดงผลบน[url=https://www.mindphp.com/%E0%B8%84%E0%B8%B9%E0%B9%88%E0%B8%A1%E0%B8%B7%E0%B8%AD/73-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3/2188-platform-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3-.html]แพลตฟอร์ม[/url]
[img]http://snap.mindphp.com/index.php?view=2017Jun30_5955dd077c6a9[/img]
[b]การเรียกใช้งาน [url=https://www.mindphp.com/%E0%B8%84%E0%B8%B9%E0%B9%88%E0%B8%A1%E0%B8%B7%E0%B8%AD/73-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3/2038-api-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3.html]API[/url] แบ่งออกได้เป็น 2 วิธี[/b]
[list][b]วิธีที่ 1[/b] เรียกใช้งานบน Html :[/list]
[code]<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">[/code]
[list][b]วิธีที่ 2[/b] เรียกใช้งานบน hosting ของตนเอง :[/list]
[code]@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(https://example.com/MaterialIcons-Regular.eot); /* For IE6-8 */
src: local('Material Icons'),
local('MaterialIcons-Regular'),
url(https://example.com/MaterialIcons-Regular.woff2) format('woff2'),
url(https://example.com/MaterialIcons-Regular.woff) format('woff'),
url(https://example.com/MaterialIcons-Regular.ttf) format('truetype');
}[/code]
[code].material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px; /* Preferred icon size */
display: inline-block;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;
/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;
/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;
/* Support for IE. */
font-feature-settings: 'liga';
}[/code]
[b]การใช้งาน Icon บน Html :[/b]
[code]<i class="material-icons">face</i>[/code]
[b]ตัวอย่างการใช้งานจริง : [/b]
[code]<html>
<head>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
</head>
<body>
<center>
<br/><br/>
<i class="material-icons">android</i>
<i class="material-icons">account_balance</i>
<i class="material-icons">alarm_add</i>
<i class="material-icons">bookmark_border</i>
<br/><br/>
<i class="material-icons md-48">face</i>
<i class="material-icons">remove_shopping_cart</i>
<i class="material-icons">aspect_ratio</i>
<i class="material-icons">build</i>
</center>
</body>
</html>[/code]
[b]Browser ที่รองรับการใช้งาน[/b]
- Google Chrome 11
- Mozilla Firefox 3.5
- Apple Safari 5
- Microsoft IE 10
- Opera 15
- Apple MobileSafari iOS 4.2
- Android Browser 3.0
สามารถเลือกใช้งานไอคอนได้ที่ : [url]https://material.io/icons/[/url]