Web Technologies


HTML is the standard markup language for Web pages.

All HTML documents must start with a document type declaration: <!DOCTYPE html>.

The HTML document itself begins with <html> and ends with </html>.

The visible part of the HTML document is between <body> and </body>.

The <!DOCTYPE> declaration represents the document type, and helps browsers to display web pages correctly.

It must only appear once, at the top of the page (before any HTML tags).

HTML headings are defined with the <h1> to <h6> tags.

<h1> defines the most important heading. <h6> defines the least important heading

HTML paragraphs are defined with the <p> tag:

HTML links are defined with the <a> tag:

<a href="https://www.wschools.com">This is a link</a>

HTML images are defined with the <img> tag.

<img src="w3schools.jpg" alt="wSchools.com" width="104" height="142">

View HTML Source Code:

Right-click in an HTML page and select "View Page Source" (in Chrome) or "View Source" (in Edge), or similar in other browsers. This will open a window containing the HTML source code of the page.


Inspect an HTML Element:

Right-click on an element (or a blank area), and choose "Inspect" or "Inspect Element" to see what elements are made up of (you will see both the HTML and the CSS). 

You can also edit the HTML or CSS on-the-fly in the Elements or Styles panel that opens.



HTML Attributes

  • All HTML elements can have attributes
  • Attributes provide additional information about elements
  • Attributes are always specified in the start tag
  • Attributes usually come in name/value pairs like: name="value"


1. Absolute URL - Links to an external image that is hosted on another website.

2. Relative URL - Links to an image that is hosted within the website. Here, the URL does not include the domain name. If the URL begins without a slash, 

it will be relative to the current page. Example: src="img_girl.jpg". If the URL begins with a slash, it will be relative to the domain. Example: src="/images/img_girl.jpg".


The required alt attribute for the <img> tag specifies an alternate text for an image, if the image for some reason cannot be displayed. This can be due to slow connection, or an error in the src attribute, or if the user uses a screen reader.

<img src="img_girl.jpg" alt="Girl with a jacket">


The style attribute is used to add styles to an element, such as color, font, size, and more.<p style="color:red;">This is a red paragraph.</p>


You should always include the lang attribute inside the <html> tag, to declare the language of the Web page. This is meant to assist search engines and browsers.

Country codes can also be added to the language code in the lang attribute. So, the first two characters define the language of the HTML page, and the last two characters define the country.<html lang="en-US">


The title attribute defines some extra information about an element.The value of the title attribute will be displayed as a tooltip when you mouse over the element:


Double quotes around attribute values are the most common in HTML, but single quotes can also be used.In some situations, when the attribute value itself contains double quotes, it is necessary to use single quotes


HTML Attribute Reference


Comments

Popular posts from this blog

AI

Oracle Fusion

CryptoCurrency