Country flags are often used in language-specific selections or for content related to a specific country. J1 Theme supports using country flags to make language selections or country indicators more visual to support your visitors by making a more meaningful presentation.
J1 Theme integrates the CSS definitions of the project Flag Icons managed by Panayiotis Lipiridis. Flag Icons is a collection of country flags in SVG vector format. All icons can be automatically resized with no loss in display quality.
HTML Markup
There is no official HTML markup for CSS font icons, but 2 markups are widely used. Both markups can be used in block elements like the anchor tag <a>
or use span elements <span>
. That way, it’s on you what to use for font based icons.
HTML code examples to use CSS font icons
<span class="flag-icon flag-icon-gr rectangle size-md" role="img" aria-label="flag-gr"></span> (1)
<i class="flag-icon flag-icon-gr rectangle size-md"></i> (1) (2)
1 | Both forms are consistent with the HTML5 specification |
2 | It’s short and the i tag <i> may associated for an icon (semantic meaning) |
| The i tag <i> provides more meaning to machines because of the HTML spec, it provides more meaning to humans because the tag <i> can easily associated with icon . And it’s only one letter long — that win! And if you make sure to include equivalent text either inside the i tag <i> or right next to it, then screen readers understand where to click to reply, the link is usable if CSS doesn’t load, and human readers with good eyesight and a decent browser see a pretty icon. |
Asciidoc Markup
For pages using Asciidoc for the source, a easier solution is available by using markups from Asciidoc.
Code examples using Asciidoc Markup
pass:[<i class="flag-icon flag-icon-<name> <style> <size> <modifier>"></i>] (1)
flag:country[style, size, modifier] (2)
1 | Markup using a pass block |
2 | Markup using the Asciidoc (inline) extension flag |
Styles
Two styles are available for country flag icons: rectangle rectangle
and squared squared
. The default style is rectangle 4:3
of the icon. For more compact placement, all icons can be used in a squared format 1:1
.
Code example using Asciidoc Markup
flag:de[rectangle, md] Germany, rectangle style +
flag:de[squared, md] Germany, squared style
Rendered flags
-
Germany, rectangle style
-
Germany, squared style
Sizes
For more specific placement, or to place emphasis on, all icons can be specified in different sizes by the optional size parameter size
.
| The size of a flag is typically specified relative to the base font size. Today, the base font size is set to 16 pixel 16px , equivalent to a size od 1rem. That means for flag icons, that the width of an icon is set to double size 32px if a relative size of 2x 2x is given. |
See with the following what sizes are available.
Relative Sizes
For a better Bootstrap integration and for responsiveness, the icon size can be given like the view-port shortcuts from xs to xl xs
, sm
, md
, lg
, xl
.
Table 1. Flag sizes, responsive Size | Style | Markup | Render |
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
Proportional Sizes
All icons can be specifier relativ to their base size from 1x 1x
to 10x 10x
. See the examples with the table below.
Table 2. Flag sizes, proportional Size | Style | Markup | Render |
| | |
|
| | |
|
| | |
|
Modifiers
For better placement, additional CSS styles called modifiers can be specified like so:
Example using modifiers for Asciidoc Markup
flag:de[rectangle, md, ml-3 mr-3 mb-2] Germany, rectangle style +
flag:de[squared, md, ml-3 mr-3 mb-2] Germany, square style
Rendered flags
Germany, rectangle style
Germany, square style
Flags Overview
Find all flags available in alphabetical order.
A - C
AF Afghanistan
Kabul
AX Aland Islands
Mariehamn
AL Albania
Tirana
DZ Algeria
Algiers
AS American Samoa
Pago Pago
AD Andorra
Andorra la Vella
AO Angola
Luanda
AI Anguilla
The Valley
AG Antigua and Barbuda
St. John's
AR Argentina
Buenos Aires
AM Armenia
Yerevan
AW Aruba
Oranjestad
AU Australia
Canberra
AT Austria
Vienna
AZ Azerbaijan
Baku
BS Bahamas
Nassau
BH Bahrain
Manama
BD Bangladesh
Dhaka
BB Barbados
Bridgetown
BY Belarus
Minsk
BE Belgium
Brussels
BZ Belize
Belmopan
BJ Benin
Porto-Novo
BM Bermuda
Hamilton
BT Bhutan
Thimphu
BO Bolivia (Plurinational State of)
Sucre
BQ Bonaire, Sint Eustatius and Saba
Kralendijk
BA Bosnia and Herzegovina
Sarajevo
BW Botswana
Gaborone
BR Brazil
Brasília
IO British Indian Ocean Territory
Diego Garcia
BN Brunei Darussalam
Bandar Seri Begawan
BG Bulgaria
Sofia
BF Burkina Faso
Ouagadougou
BI Burundi
Bujumbura
CV Cabo Verde
Praia
KH Cambodia
Phnom Penh
CM Cameroon
Yaoundé
CA Canada
Ottawa
KY Cayman Islands
George Town
CF Central African Republic
Bangui
TD Chad
N'Djamena
CL Chile
Santiago
CN China
Beijing
CX Christmas Island
Flying Fish Cove
CC Cocos (Keeling) Islands
West Island
CO Colombia
Bogotá
KM Comoros
Moroni
CK Cook Islands
Avarua
CR Costa Rica
San José
HR Croatia
Zagreb
CU Cuba
Havana
CW Curaçao
Willemstad
CY Cyprus
Nicosia
CZ Czech Republic
Prague
CI Côte d'Ivoire
Yamoussoukro
CD Democratic Republic of the Congo
Kinshasa
DK Denmark
Copenhagen
DJ Djibouti
Djibouti
D - G
DM Dominica
Roseau
DO Dominican Republic
Santo Domingo
EC Ecuador
Quito
EG Egypt
Cairo
SV El Salvador
San Salvador
GB-ENG England
London
GQ Equatorial Guinea
Malabo
ER Eritrea
Asmara
EE Estonia
Tallinn
ET Ethiopia
Addis Ababa
FK Falkland Islands
Stanley
FO Faroe Islands
Tórshavn
FM Federated States of Micronesia
Palikir
FJ Fiji
Suva
FI Finland
Helsinki
FR France
Paris
GF French Guiana
Cayenne
PF French Polynesia
Papeete
TF French Southern Territories
Saint-Pierre, Réunion
GA Gabon
Libreville
GM Gambia
Banjul
GE Georgia
Tbilisi
DE Germany
Berlin
GH Ghana
Accra
GI Gibraltar
Gibraltar
GR Greece
Athens
GL Greenland
Nuuk
GD Grenada
St. George's
GP Guadeloupe
Basse-Terre
GU Guam
Hagåtña
GT Guatemala
Guatemala City
GG Guernsey
Saint Peter Port
GN Guinea
Conakry
GW Guinea-Bissau
Bissau
GY Guyana
Georgetown
H - M
HT Haiti
Port-au-Prince
VA Holy See
Vatican City
HN Honduras
Tegucigalpa
HK Hong Kong
Hong Kong
HU Hungary
Budapest
IS Iceland
Reykjavik
IN India
New Delhi
ID Indonesia
Jakarta
IR Iran (Islamic Republic of)
Tehran
IQ Iraq
Baghdad
IE Ireland
Dublin
IM Isle of Man
Douglas
IL Israel
Jerusalem
IT Italy
Rome
JM Jamaica
Kingston
JP Japan
Tokyo
JE Jersey
Saint Helier
JO Jordan
Amman
KZ Kazakhstan
Astana
KE Kenya
Nairobi
KI Kiribati
South Tarawa
XK Kosovo
Pristina
KW Kuwait
Kuwait City
KG Kyrgyzstan
Bishkek
LA Laos
Vientiane
LV Latvia
Riga
LB Lebanon
Beirut
LS Lesotho
Maseru
LR Liberia
Monrovia
LY Libya
Tripoli
LI Liechtenstein
Vaduz
LT Lithuania
Vilnius
LU Luxembourg
Luxembourg City
MO Macau
Macau
MG Madagascar
Antananarivo
MW Malawi
Lilongwe
MY Malaysia
Kuala Lumpur
MV Maldives
Malé
ML Mali
Bamako
MT Malta
Valletta
MH Marshall Islands
Majuro
MQ Martinique
Fort-de-France
MR Mauritania
Nouakchott
MU Mauritius
Port Louis
YT Mayotte
Mamoudzou
MX Mexico
Mexico City
MD Moldova
Chișinău
MC Monaco
Monaco
MN Mongolia
Ulaanbaatar
ME Montenegro
Podgorica
MS Montserrat
Little Bay, Brades, Plymouth
MA Morocco
Rabat
MZ Mozambique
Maputo
MM Myanmar
Naypyidaw
N - S
NA Namibia
Windhoek
NR Nauru
Yaren District
NP Nepal
Kathmandu
NL Netherlands
Amsterdam
NC New Caledonia
Nouméa
NZ New Zealand
Wellington
NI Nicaragua
Managua
NE Niger
Niamey
NG Nigeria
Abuja
NU Niue
Alofi
NF Norfolk Island
Kingston
KP North Korea
Pyongyang
MK North Macedonia
Skopje
GB-NIR Northern Ireland
Belfast
MP Northern Mariana Islands
Saipan
NO Norway
Oslo
OM Oman
Muscat
PK Pakistan
Islamabad
PW Palau
Ngerulmud
PA Panama
Panama City
PG Papua New Guinea
Port Moresby
PY Paraguay
Asunción
PE Peru
Lima
PH Philippines
Manila
PN Pitcairn
Adamstown
PL Poland
Warsaw
PT Portugal
Lisbon
PR Puerto Rico
San Juan
QA Qatar
Doha
CG Republic of the Congo
Brazzaville
RO Romania
Bucharest
RU Russia
Moscow
RW Rwanda
Kigali
RE Réunion
Saint-Denis
BL Saint Barthélemy
Gustavia
SH Saint Helena, Ascension and Tristan da Cunha
Jamestown
KN Saint Kitts and Nevis
Basseterre
LC Saint Lucia
Castries
MF Saint Martin
Marigot
PM Saint Pierre and Miquelon
Saint-Pierre
VC Saint Vincent and the Grenadines
Kingstown
WS Samoa
Apia
SM San Marino
San Marino
ST Sao Tome and Principe
São Tomé
SA Saudi Arabia
Riyadh
GB-SCT Scotland
Edinburgh
SN Senegal
Dakar
RS Serbia
Belgrade
SC Seychelles
Victoria
SL Sierra Leone
Freetown
SG Singapore
Singapore
SX Sint Maarten
Philipsburg
SK Slovakia
Bratislava
SI Slovenia
Ljubljana
SB Solomon Islands
Honiara
SO Somalia
Mogadishu
ZA South Africa
Pretoria
GS South Georgia and the South Sandwich Islands
King Edward Point
KR South Korea
Seoul
SS South Sudan
Juba
ES Spain
Madrid
LK Sri Lanka
Sri Jayawardenepura Kotte, Colombo
PS State of Palestine
Ramallah
SD Sudan
Khartoum
SR Suriname
Paramaribo
SJ Svalbard and Jan Mayen
Longyearbyen
SZ Swaziland
Lobamba, Mbabane
SE Sweden
Stockholm
CH Switzerland
Bern
SY Syrian Arab Republic
Damascus
T - Z
TW Taiwan
Taipei
TJ Tajikistan
Dushanbe
TZ Tanzania
Dodoma
TH Thailand
Bangkok
TL Timor-Leste
Dili
TG Togo
Lomé
TK Tokelau
Nukunonu, Atafu,Tokelau
TO Tonga
Nukuʻalofa
TT Trinidad and Tobago
Port of Spain
TN Tunisia
Tunis
TR Turkey
Ankara
TM Turkmenistan
Ashgabat
TC Turks and Caicos Islands
Cockburn Town
TV Tuvalu
Funafuti
UG Uganda
Kampala
UA Ukraine
Kiev
AE United Arab Emirates
Abu Dhabi
GB United Kingdom
London
UM United States Minor Outlying Islands
Washington, D.C.
US United States of America
Washington, D.C.
UY Uruguay
Montevideo
UZ Uzbekistan
Tashkent
VU Vanuatu
Port Vila
VE Venezuela (Bolivarian Republic of)
Caracas
VN Vietnam
Hanoi
VG Virgin Islands (British)
Road Town
VI Virgin Islands (U.S.)
Charlotte Amalie
GB-WLS Wales
Cardiff
WF Wallis and Futuna
Mata-Utu
EH Western Sahara
Laayoune
YE Yemen
Sana'a
ZM Zambia
Lusaka
ZW Zimbabwe
Harare