HTML အခြေခံ
对 HTML 进行分类(设置类),使我们能够为元素的类定义 CSS 样式。
为相同的类设置相同的样式,或者为不同的类设置不同的样式。
အကျိုးသက်ရှိသည်
<!DOCTYPE html> <html> <head> <style> .cities { background-color:black; color:white; margin:20px; padding:20px; } </style> </head> <body> <div class="cities"> <h2>لنںدن</h2> <p> لنںدن یانگنای یانگی نای پائی. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants. </p> </div> </body> </html>
分类块级元素
HTML <div> 元素是块级元素。它能够用作其他 HTML 元素的容器。
设置 <div> 元素的类,使我们能够为相同的 <div> 元素设置相同的类:
အကျိုးသက်ရှိသည်
<!DOCTYPE html> <html> <head> <style> .cities { background-color:black; color:white; margin:20px; padding:20px; } </style> </head> <body> <div class="cities"> <h2>لنںدن</h2> <p>لنںدن یانگنای یانگی نای پائی. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants. </div> <div class="cities">Paris
<p>ပီရိုက် သည် ပြင်သစ် အချို့ အချို့ အကြီးဆုံး မြို့တော် ဖြစ်ပြီး ပြင်သစ် အချို့ အကြီးဆုံး မြို့တော် ဖြစ်သည်။</p> </div> <div class="cities"> <h2>တိုကျိုး</h2> <p>တိုကျိုး သည် ရုရှား အချို့ အကြီးဆုံး မြို့တော် ဖြစ်ပြီး ဂျပန် အကြီးဆုံး မြို့တော် ဖြစ်သည်။</p> နှင့် ကမ္ဘာ့ အလူးအလူး အကြီးဆုံး မြို့တော်</p> </div> </body> </html>
အကြွင်းကျွမ်း အစိတ်အပိုင်း အမျိုးအစား
HTML span အစိတ်အပိုင်း သည် အကြွင်းကျွမ်း အစိတ်အပိုင်း ဖြစ်ပြီး အချက်အရာ အစိတ်အပိုင်း အတွက် အသုံးပြုနိုင်ပါသည်。
span အစိတ်အပိုင်း အမျိုးအစား ကို အသင်းဖြင့် အသုံးပြုခြင်း အတွက် အသင်းဖြင့် အသုံးပြုခြင်း အတွက် အသုံးပြုခြင်း အတွက် အသုံးပြုခြင်း
အကျိုးသက်ရှိသည်
<!DOCTYPE html> <html> <head> <style> span.red {color:red;} </style> </head> <body> <h1>My <span class="red">Important</span> Heading</h1> </body> </html>