Atribut hreflang
Havola orqali ko'rsatilayotgan dokument tilini belgilaydi.
Sintaksis
<a hreflang="til">...</a>
Qiymatlari
Default qiymati
Yo'q.
Misol
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>А, atribut hreflang</title>
</head>
<body>
<p><a hreflang="en" href="https://google.com" target="_blank">Google qidiruv tizimi</a></p>
</body>
</html>
Natija
Eslatma
Ushbu atributni havolalarning tashqi ko'rinishini o'zgartirishda ishlatish mumkin. Albatta, bunda CSS dan foydalaniladi. Quyidagi misolda hreflang="en" holati uchun Buyuk Britaniya bayrog'i ko'rsatiladi.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>А, atribut hreflang</title>
<style>
a[hreflang="en"] {
background: url(https://cdn1.iconfinder.com/data/icons/famfamfam_flag_icons/gb.png)
no-repeat 100% 50%;
padding-right: 24px;
}
a[hreflang="uz"] {
background: url(https://cdn1.iconfinder.com/data/icons/famfamfam_flag_icons/uz.png)
no-repeat 100% 50%;
padding-right: 24px;
}
</style>
</head>
<body>
<p><a href="https://www.google.co.uk" hreflang="en" target="_blank">Google in English</a></p>
<p><a href="https://www.google.co.uz" hreflang="uz" target="_blank">Google in Uzbek</a></p>
</body>
</html>
Natija
Brauzerlar
Internet Explorer | Edge | Chrome | Opera | Safari | Firefox |
---|---|---|---|---|---|
Android | Firefox | Opera | Safari |
---|---|---|---|