Panduan Kode Sumber HTML Dasar
Panduan Kode Sumber HTML Dasar
Ordered lists are created using the <OL> tag and display items in a numbered format, whereas unordered lists use the <UL> tag and display items with bullet points. Each item in both list types is marked with the <LI> tag .
HTML links are created using the <A HREF> tag, where 'HREF' specifies the destination URL. Text or images used within this tag become clickable links. Images can replace text as the clickable item by including the <IMG SRC> tag within the <A HREF> tags, making the image serve as the link .
HTML allows for nested lists by placing <UL> or <OL> tags within another <LI> item. This feature enables the creation of sublists and hierarchical structures within a list, which is important for representing complex data structures and improving content organization .
The <BLOCKQUOTE> tag is used to define a section that is quoted from another source. In terms of formatting, it typically indents the content, making the paragraphs within it appear as indented sections compared to the surrounding text .
A table in HTML is created with the <TABLE> tag, containing <TR> tags for rows and <TD> tags for cells within those rows. Attributes like BORDER, CELLSPACING, and CELLPADDING can adjust table borders and the space within and between cells. This structure organizes data into a grid layout, facilitating clear data presentation .
The align attribute within HTML tags like <P> affects text alignment, such as left, center, right, or justify, aligning text within its containing element. This is significant for controlling the presentation and readability of text, ensuring it matches the design requirements and enhances the user experience .
The <SUB> tag displays text as subscript, showing it slightly smaller and below the regular text line, while the <SUP> tag displays text as superscript, making it appear smaller and above the regular text line. Both are used to adjust the vertical alignment of specific text segments .
<BLOCKQUOTE> is specifically used for quoted text and typically applies indentation to signal this usage, whereas <DIV> is a general-purpose container for grouping elements. <DIV> does not apply any formatting by default, offering more flexibility for ID, class styling, and layout purposes .
Indentation and spacing enhance the readability and maintainability of source code by visually organizing code into blocks, making it easier to discern the structure and identify code sections. This leads to better collaboration among developers and reduces the likelihood of errors within complex code bases [general programming knowledge].
Excessive nesting of lists in HTML can lead to complex, unwieldy structures, reducing readability and maintainability. This can be mitigated by simplifying list hierarchies and using CSS for styling and visibility control, allowing for a cleaner and more understandable codebase [common web development knowledge].