Ada yang bisa jelasin maksudnya " Block level elements start from a new line. " di HTML gak? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Ada yang bisa jelasin maksudnya " Block level elements start from a new line. " di HTML gak?

6th Jan 2018, 1:24 PM
Agus CahyoNo
4 Answers
0
ENGLISH Based on styling HTML elements can be classified as block elements and inline elements. The main difference between the two is that block level elements always starts on a new line and takes up the full width of a page, from left to right whereas inline elements take only that much width of the web page which they require. Go through the code given below: <!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <div>WELCOME</div><div>THIS IS AN EXAMPLE OF BLOCK ELEMENT</div><span>THIS IS AN EXAMPLE OF INLINE ELEMENT</span><span> AR</span> </body> </html> Run this code. You will see that the text enclosed within div tag takes complete width of the web page, though it does not requires it. But the text written within span tag takes only required amount of width. Also notice that "AR" written within span tag prints on the web page just after the text within first span tag. Inline Elements - b, big, i, small, tt, abbr, a
6th Sep 2018, 6:29 PM
Aaryan
Aaryan - avatar
0
Block Elements- p, h, ol, ul, pre, div, etc.
6th Sep 2018, 6:36 PM
Aaryan
Aaryan - avatar
0
INDONESIAN Berdasarkan elemen HTML styling dapat diklasifikasikan sebagai elemen blok dan elemen inline. Perbedaan utama antara keduanya adalah bahwa elemen level blok selalu dimulai pada baris baru dan mengambil lebar penuh halaman, dari kiri ke kanan sedangkan elemen inline hanya membutuhkan lebar halaman web yang mereka butuhkan. Periksa kode yang diberikan di bawah ini: <! DOCTYPE html> <html>     <head>         <title> Judul Halaman </ title>     </ kepala>     <body>         <div> WELCOME </ div> <div> INI ADALAH CONTOH ELEMEN BLOK </ div> <span> INI ADALAH CONTOH ELEMEN INLINE </ span> <span> AR </ span>              </ body> </ html> Jalankan kode ini. Anda akan melihat bahwa teks yang disertakan dalam tag div selesai lebar halaman web, meskipun tidak membutuhkannya. Tetapi teks yang ditulis dalam rentang tag hanya membutuhkan jumlah lebar yang diinginkan. Juga perhatikan bahwa "AR" ditulis dalam tag span cetakan pada halaman web tepat setelah teks dalam tag span pertama.
6th Sep 2018, 6:39 PM
Aaryan
Aaryan - avatar
0
If you liked, please upvote
6th Sep 2018, 6:40 PM
Aaryan
Aaryan - avatar