Senarai Tidak Tertib HTML
Sep 04, 2024 pm 04:43 PMLists in HTML are a concept of gathering a number of data or elements arranged in a specific order organized for the purpose of being used in the program execution. HTML uses three types of lists, namely Ordered List, Unordered List and Definition List, where Unordered List is a type of list where the data or elements can be arranged in the list in no specific order. The syntax for the HTML Unordered List is
- ………..
- is the tag that indicates the unordered list type.
- Ordered List
- Unordered list
- Definition List
The three types of lists we could use to bring order to the web pages. Below are the different types:
In this article, we shall go through the unordered list specification with an example. The unordered list is a list that doesn’t require any order of numbering in their list; instead, we use bullets for the list levels.
Syntax of?HTML Unordered List
The syntax for the unordered list is similar to the ordered list we created in the previous article. Unordered list is created using an element named
- element and ends with
- element.
<ul> <li></li> ……….. </ul>
Example #1
This shows how this short item list is implemented in a browser.
<html> <head> <title> Demo on Unordered list</title><br>?? </head> <body bgcolor="orange" text="green" order=""> <h1><u>Demo on Unordered list</u></h1> <h2>Ingredients for making of cake</h2> <h3> <ul type="square"> <li>Baking Powder</li> <li >Flour</li> <li> Sugar</li> <li>Coco poder</li> </ul> <h3> </body> </html>
Output:
This will give you the result like
Example #2
Unordered List with colors and for the positions.
<!DOCTYPE html> <html> <head> <title>unordered list Demo2</title> </head> <body> <h1>Unordered Disc</h1> <ul> <li>Lion</li> <li>Tiger</li> <li>Giraffe</li> <li>Camel</li> </ul> <h1>Top Rhymes </h1> <ul type="square"> <li>Johny Johny Yes papa</li> <li>Wheels on the Bus</li> <li> Baa Baa Black Sheep</li> </ul> <h1>Fruits Name List</h1> <ul type="circle" > <li > Avacado</li> <li> Orange</li> <li>Pears</li> <li> Banana</li> </ul> </body> </html>
Output:
Types of Attributes for HTML Unordered List
To figure the unordered list, there are three primary types of attributes for this unordered element. The unordered list is used where it is not required to represent the lists in any specific orders. The following sections explain the related attributes and examples of them.
This attribute gives the type of bullets to be used in the list.
- type =’disc’ – Gives default bullet structure
- type =’square’ – Looks like solid box bullets
- type =’circle’ – Gives Hollow box structure
1. Attribute type=’disc.’
This is the default type, and all the items are marked as bullets. Here we use type attribute, and all these attributes support in HTML 3, To define under HTML5, we are supposed to implement list-style CSS. Here is an example demo.
Example:
<html> <head> <title> Demo on Unordered list Types</title><br>?? </head> <body bgcolor="pink" text="blue" order=""> <h1><u>Demo on Unordered list Types</u></h1> <UL> <LI>This is Program Agenda. <UL> <LI>First a Welcome Note <LI>Second We Start with the talks </UL> <LI type="square">Opening Speech <LI>Mrs.Claria Winston from Ireland and Eyjolfur From Bank of America. <LI type="circle"> Tea Break <LI type="disk">Last part from the topic Data Lake By Surendran Thomas. </UL> </body> </html>
Output:
2. Attribute type=’square.’
Here the items are marked with Square bullets.
Example:
Demonstrating the HTML code with the square bullet embedded with style color and the position.
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.5"> <style> ul { list-style: square; } ul li::before { content: "\1022"; color: pink; font-weight: bold; display: inline-block; width: 0.8em; margin-left: -1em; } </style> </head> <body> <h2>List of top hollywood movies-Square</h2> <ul> <li>World Of the wars</li> <li>Mission Impossible</li> <li>Independence Day special</li> <li> Behind enemy lines</li> </ul> </body> </html>
Output:
3. Attribute type=’circle.’
This attribute gives hollow bullet values. Below are the example rendering circle and square attribute together with the nested lists.
Example:
<HTML> <HEAD> <TITLE> EDUCBA List Example </TITLE> ;style> h3{ color:orange; } ul{ list-style: none; } ul li::before { content: "\25AA"; color: brown; display: inline-block; width: 1em; margin-left: -0.8em; font-weight: bold; font-size:1rem; } </style> </HEAD> <BODY> <H1> List of Mobiles</h1> <UL> <LI> Redmi Xiami <LI> Iphone <LI> Samsung <LI> Nokia </UL> <H1>Mobile Operating System Supports</h1> <UL TYPE = "circle"> <LI> Android <LI> Windows phone <LI TYPE = "circle"> Samsung <LI TYPE = "square"> Nokia </UL> </BODY> </HTML>
Output:
Replacing HTML list Items with Customizable Images
This would ultimately enhance the overall theme and makes the website visually good. The default bullets are replaced by native style or even can customizable using images with CSS help. Actually speaking, there are three styling lists to be used in HTML. Here we go with a list-style-type and list-style-image.
Using image bullet is to make the lists more unique and differentiate the information by type, Giving the presentation a look on the web page.
In the below example, the examples are demonstrated by style properties between the list elements.
Example #1 – Style properties between the list elements
<!DOCTYPE html> <html lang="en"> <head> <title>HTML unordered list with Styles</title> </head> <body> <style> ul li { background: red; } ul.in.li { list-style: circle inside none; color: red; left: -20px; position: inside; text-align: left; width: 27px; }</style> <ul> <li><span> Finland is a Scandinavian Country</span></li> <li><span>Oslo is the capital city</span></li> <li><span>Iceland is known for its beauty , hiking, fishing</span></li> <li><span>Ranked among the chillness country in europe</span></li> </ul><br/> </body></html>
Output:
This will give out the output like
Example #2 – With image style
<!DOCTYPE html> <html> <head> <style> ul { list-style-image: url('sqpurple.gif'); } </style> </head> <body> <h2>The list-style- Demo</h2> <p>Harry Potter Characters:</p> <ul id="circle"> <li> Harry</li> <li>Hermione</li> <li>Ron Weasely</li> </ul> </body> </html>
Output:
Conclusion
Maintenant que nous voyons comment créer des listes non ordonnées en HTML. Nous avons vu comment l'élément bloc non ordonné joue un r?le dans la création de pages Web avec différents exemples et avons exploré certaines fonctionnalités de liste. Même cela peut être utilisé dans les menus de navigation pour afficher verticalement. La création d'une liste non ordonnée est très simple ; il est essentiel de déterminer où corriger cette approche pour obtenir le meilleur emplacement. Autrement dit, le document parfait préfère utiliser un format de liste HTML.
Atas ialah kandungan terperinci Senarai Tidak Tertib HTML. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!

Alat AI Hot

Undress AI Tool
Gambar buka pakaian secara percuma

Undresser.AI Undress
Apl berkuasa AI untuk mencipta foto bogel yang realistik

AI Clothes Remover
Alat AI dalam talian untuk mengeluarkan pakaian daripada foto.

Clothoff.io
Penyingkiran pakaian AI

Video Face Swap
Tukar muka dalam mana-mana video dengan mudah menggunakan alat tukar muka AI percuma kami!

Artikel Panas

Alat panas

Notepad++7.3.1
Editor kod yang mudah digunakan dan percuma

SublimeText3 versi Cina
Versi Cina, sangat mudah digunakan

Hantar Studio 13.0.1
Persekitaran pembangunan bersepadu PHP yang berkuasa

Dreamweaver CS6
Alat pembangunan web visual

SublimeText3 versi Mac
Perisian penyuntingan kod peringkat Tuhan (SublimeText3)

Topik panas

Struktur laman web perlu disokong oleh elemen HTML teras. 1. Struktur keseluruhan halaman terdiri daripada, yang merupakan unsur akar, yang menyimpan maklumat meta dan memaparkan kandungan; 2. Organisasi kandungan bergantung pada tajuk (-), perenggan () dan tag blok (seperti,) untuk meningkatkan struktur organisasi dan SEO; 3. Navigasi dilaksanakan melalui dan dilaksanakan, organisasi yang biasa digunakan dihubungkan dan ditambah dengan atribut aria-semasa untuk meningkatkan kebolehcapaian; 4. Borang Interaksi melibatkan, dan, untuk memastikan fungsi input dan penyerahan pengguna lengkap. Penggunaan unsur -unsur ini dapat meningkatkan kejelasan halaman, penyelenggaraan dan pengoptimuman enjin carian.

Apabila menggunakan HTML5SSE, kaedah untuk menangani penyambungan semula dan kesilapan termasuk: 1. Memahami mekanisme penyambungan semula lalai. Eventsource Retrys 3 saat selepas sambungan terganggu secara lalai. Anda boleh menyesuaikan selang melalui medan semula; 2. Dengar peristiwa ralat untuk menangani kegagalan sambungan atau kesilapan parsing, membezakan jenis ralat dan melaksanakan logik yang sepadan, seperti masalah rangkaian yang bergantung pada penyambungan semula automatik, kesilapan pelayan secara manual melambatkan penyambungan semula, dan kegagalan pengesahan menyegarkan token; 3. Secara aktif mengawal logik penyambungan semula, seperti penutupan secara manual dan membina semula sambungan, menetapkan bilangan maksimum masa semula, menggabungkan navigator.online untuk menilai status rangkaian untuk mengoptimumkan strategi semula. Langkah -langkah ini dapat meningkatkan kestabilan aplikasi dan pengalaman pengguna.

Doctype adalah pernyataan yang memberitahu penyemak imbas yang standard HTML digunakan untuk menghuraikan halaman. Halaman web moden hanya perlu ditulis pada permulaan fail HTML. Fungsinya adalah untuk memastikan bahawa penyemak imbas menjadikan halaman dalam mod standard dan bukannya mod pelik, dan mesti terletak pada baris pertama, tanpa ruang atau komen di hadapannya; Hanya ada satu cara yang betul untuk menulisnya, dan tidak disyorkan untuk menggunakan versi lama atau varian lain; Lain -lain seperti charset, viewport, dan lain -lain harus diletakkan sebahagiannya.

Klien-sideformvalidationcanbedonewithoutjavascriptbyusinghtmlattributes.1) userequiredtoenforcemandatory.2) valateateMailsandurlSwithtypeattributeseMailorurl, orusepatternwithregexforcustmin.3)

Gunakan tag dalam HTML untuk pilihan kumpulan dalam menu drop-down. Kaedah khusus adalah untuk membungkus sekumpulan elemen dan menentukan nama kumpulan melalui atribut label, seperti: 1 mengandungi pilihan seperti epal, pisang, oren, dan lain -lain; 2. Mengandungi pilihan seperti wortel, brokoli, dan sebagainya; 3. Nota termasuk: ① Tiada sarang disokong; ② Seluruh kumpulan boleh dilumpuhkan melalui atribut yang kurang upaya; ③ Gaya ini terhad dan perlu dihidupkan dalam kombinasi dengan CSS atau perpustakaan pihak ketiga; Plug-in seperti SELECT2 boleh digunakan untuk meningkatkan fungsi.

HTML5, CSS dan JavaScript harus digabungkan dengan tag semantik, pesanan pemuatan yang munasabah dan reka bentuk decoupling. 1. Gunakan tag semantik HTML5, seperti meningkatkan kejelasan struktur dan penyelenggaraan, yang kondusif untuk SEO dan akses bebas penghalang; 2. CSS harus diletakkan, gunakan fail luaran dan berpecah oleh modul untuk mengelakkan gaya sebaris dan masalah pemuatan yang tertunda; 3. JavaScript disyorkan untuk diperkenalkan di hadapan, dan gunakan penangguhan atau async untuk memuat secara asynchronously untuk mengelakkan menyekat rendering; 4. Mengurangkan pergantungan yang kuat antara ketiga-tiga, tingkah laku memandu melalui atribut data dan status kawalan nama kelas, dan meningkatkan kecekapan kerjasama melalui spesifikasi penamaan bersatu. Kaedah ini dapat mengoptimumkan prestasi halaman dengan berkesan dan bekerjasama dengan pasukan.

Untuk menggunakan elemen butang HTML untuk mencapai butang yang boleh diklik, anda mesti menguasai penggunaan asas dan langkah berjaga -jaga yang sama. 1. Buat butang dengan tag dan tentukan tingkah laku melalui atribut jenis (seperti butang, hantar, tetapkan semula), yang dikemukakan secara lalai; 2. Tambahkan fungsi interaktif melalui JavaScript, yang boleh ditulis dalam talian atau mengikat pendengar acara melalui ID untuk meningkatkan penyelenggaraan; 3. Gunakan CSS untuk menyesuaikan gaya, termasuk warna latar belakang, sempadan, sudut bulat dan kesan status hover/aktif untuk meningkatkan pengalaman pengguna; 4. Perhatikan masalah biasa: Pastikan atribut kurang upaya tidak didayakan, peristiwa JS terikat dengan betul, oklusi susun atur, dan gunakan bantuan alat pemaju untuk menyelesaikan masalah. Menguasai ini

Lebih mudah untuk menghantar data borang menggunakan API FormData HTML5. 1. Ia secara automatik boleh mengumpul medan borang dengan atribut nama atau menambah data secara manual; 2. Ia menyokong penyerahan dalam format multipart/form-data melalui FETCH atau XMLHTTPREQUEST, yang sesuai untuk muat naik fail; 3. Apabila memproses fail, anda hanya perlu memasukkan fail ke FormData dan menghantar permintaan; 4. Perhatikan bahawa medan nama yang sama akan ditimpa, dan penukaran JSON dan tiada struktur bersarang perlu dikendalikan.
