HTML Tags and Elements
Attributes and Hyperlinks
Headings and Lists
Class and id attributes
Inline and Block-Level Elements
Div and Span
Give a short note on HTML Attributes.
1.HTML attributes are special words which provide additional information about the elements or attributes are the modifier of the HTML element.
2. Each element or tag can have attributes, which defines the behaviour of that element.
3. Attributes should always be applied with start tag.
4. The Attribute should always be applied with its name and value pair.
5. The Attributes name and values are case sensitive, and it is recommended by W3C that it should be written in Lowercase only.
6. You can add multiple attributes in one HTML element, but need to give space between two attributes.
Why do we need Attributes in HTML?
An attribute is a specification that defines a property of an object, element, or file. It may also refer to or set the specific value for a given instance of such. For clarity,attributes should more correctly be considered metadata.
Can attributes be modified dynamically?
document.getElementByTagName("tag name").setAttribute("attribute name", "value");
Give a short note on the title and lang attributes in HTML
The title attribute is used as text tooltip in most of the browsers. It display its text when user move the cursor over a link or any text. You can use it with any text or link to show the description about that link or text. In our example, we are taking this with paragraph tag and heading tag.
With <h1> tag:
<h1 title="This is heading tag">Example of title attribute</h1>
A hyperlink is an element in an HTML document that links to either another portion of the document or to another document altogether. On webpages, hyperlinks are usually colored purple or blue and are sometimes underlined.
The href attribute is the main attribute of <a> anchor tag. This attribute gives the link address which is specified in that link. The href attribute provides the hyperlink, and if it is blank, then it will remain in same page.
With link address:
<a href="https://www.javatpoint.com/html-anchor">This is a link</a>