HTML and XHTML provide structure and formatting for web pages. Key elements include headings, paragraphs, lists, links, and images. HTML uses tags placed around content to designate its meaning and display. Well-formed HTML follows rules like properly nested tags and lowercase element names and attributes. HTML5 introduces new semantic elements and multimedia capabilities while maintaining compatibility.