100% found this document useful (1 vote)
90 views3 pages

HTML Short Notes for Beginners

HTML can be structured using tags like <table> for tables, <img> for images, <audio> and <video> for multimedia, and lists can be ordered or unordered. Hyperlinks can be created with <a> tags and opened in new tabs. CSS can style pages by attaching an external .css file or using internal <style> tags, and properties set text, colors, positioning, and more.

Uploaded by

Shubham Jain
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
90 views3 pages

HTML Short Notes for Beginners

HTML can be structured using tags like <table> for tables, <img> for images, <audio> and <video> for multimedia, and lists can be ordered or unordered. Hyperlinks can be created with <a> tags and opened in new tabs. CSS can style pages by attaching an external .css file or using internal <style> tags, and properties set text, colors, positioning, and more.

Uploaded by

Shubham Jain
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

HTML Short Notes:

General:
-> start with <!DOCTYPE html>

Tables:
-> <tr> is a table row. Number of these tags define the number of rows
-> inside <tr>, add <td>. <tr><td></td></tr>. Number of <td> defines the number
of columns.
-> you can use the properties colspan and rowspan in <td>. They merge two cells.
-> to center a table, set left and right margin to auto (margin-left: auto)

Images/Audio/Video:
-> <audio controls><source src=“xyz.mp3” type=“audio/mpeg”></audio> same for
video, just replace <audio> with <video>
-> <img src=“[Link]” alt=“Description of image” width=“128” height=“128”>
Lists:

-> for nested lists, just open another ordered or unordered tag in the <li>

Hyperlinks:
-> to open a link in a new tab, use <a target="_blank">
-> mail to a specific address with a subject
<a href=“[Link]
us</a>

CSS:
-> to attach css file in the webpage <link rel=“stylesheet” type=“text/css”
href=“[Link]”>, comes before <head>
-> two ways of writing css, internal and external. Internal is writing inside the html
file and external is creating a new file with the extension .css. The formats for
both are:
=> internal: <table border=”1” style= “width:200px”>
=> external: h1 { color:#000000;} and .exampleClass { color: #000000; }
-> Other tags
=> h1 { text-decoration: bold, underline ,italics;}
=> body { background-image: url (“[Link]”);}
=> body { background-repeat: no-repeat;}
=> body {background-position: top/left/right/bottom;}
=> h1 {text-align: left/right/top/bottom;}

Common questions

Powered by AI

External CSS files enhance web development by allowing styles to be maintained and applied consistently across multiple HTML documents. This improves efficiency and manageability, as changes in the CSS file automatically update styles across all linked pages. In contrast, internal CSS, written directly within the HTML, is limited to individual pages and can become cumbersome to update across large websites. External files also help in reducing HTML file size and promote a clear separation between content and presentation .

Internal CSS can increase page loading times because the styles are embedded directly in each HTML file, leading to larger-sized files. In contrast, external CSS allows the browser to cache the stylesheet, reducing repeated downloads and speeding up page load times. Consequently, using external CSS is generally better for performance optimization, especially for large websites with consistent styling .

CSS can be used to prevent a background image from repeating by setting 'background-repeat' to 'no-repeat', and positioning it at the top of a webpage using 'background-position: top;'. These properties ensure the background image is displayed as intended, enhancing visual design control and improving aesthetics without distorting the image across different screen sizes .

Using 'target="_blank"' in hyperlinks opens links in new tabs, which can improve user experience by allowing users to navigate without losing their place on the original page. However, this can also confuse users who are used to links opening in the same tab, and it can be jarring if not expected. Additionally, opening excessive links in new tabs could clutter the user's browser and deteriorate usability .

Lists can be nested in HTML by placing a new <ul> or <ol> inside an <li> element of an existing list. This forms a hierarchical structure, useful for creating complex menus, structuring content such as FAQs, or organizing information in a detailed list format. Nested lists can aid in organizing complex data and enhancing readability on websites .

Images and audio are incorporated into HTML using the <img> and <audio> tags, respectively. The 'alt' attribute in <img> provides alternative text if the image cannot be displayed, benefiting accessibility and SEO. The 'controls' attribute in <audio> provides user controls for play, pause, and volume, enhancing usability. These attributes are crucial for improving user experience and making content more accessible and interactive .

The CSS property 'text-align' is used to set the horizontal alignment of text within an element. It can be applied to block-level elements such as <div> and headings (<h1> to <h6>). This property helps in creating visually pleasing and balanced layouts by aligning text to left, right, center, or justify. It is particularly useful in designing navigation bars, form layouts, and improving the aesthetics of textual content in web pages .

HTML tables can have merged cells using the colspan and rowspan attributes within the <td> tag. The colspan attribute allows a single table cell to span across multiple columns, while rowspan allows it to span multiple rows. These attributes are useful in cases where you have header cells that need to apply across multiple columns or rows, such as in a timetable or a calendar grid .

Best practices for using 'mailto' hyperlinks include clearly indicating that the link will open an email client, prioritizing explicit consent due to potential privacy concerns, and ensuring that subject lines or body text are correctly URL-encoded. It's important to consider accessibility and the diversity of user email setups, as not all users might have a default email client configured, which can lead to unexpected user experience issues .

Attaching a CSS file before the <head> section in an HTML document is recommended to ensure that the styles are loaded before the content is displayed. This prevents unstyled content from appearing briefly, leading to a flash of unstyled content (FOUC). This practice improves the loading coherence and visual consistency of web pages, providing a smoother user experience by ensuring that users see styled content immediately upon page load .

You might also like