HTML Elements
HTML elements are usually consists of a start tag and end tag. We can write the content between those tags.
syntax: <tagname>Content goes here...</tagname>
Html elements are head,paragraph,br and so on
EX:
OUTPUT:
HTML Attributes
Attributes are always specified in tags.It provides additional information about an element.these are usually comes up with name/value pairs..
- Href
- Src
- Height
- Width
- Alt
- Style
- Lang
- Title
1.href
whenever we want to display a link to user we use <a> tag and the link address is specified in the href attribute
EX:
OUTPUT
2.src ,3.height,4.width
- Html Images are defined with src attribute.
- The filename of the image source s specified in the source attribute.
- When the image is not displayed to the user then alternative text is displayed to the user. We can display alternative text by using alt attribute.
- Height and width attributes are used to set the size of the images.
EX:For SRC attribute
OUTPUT
OUTPUT
5.Alt
Alt attribute specifies an altern text when an image is not displayed to the user.
EX:For Alt Attribute:
EX:For Alt Attribute:
OUTPUT
6.Title
It is used in inside the paragraph and heading tag which acts like a tooltip when we mouse over the particular paragraph or heading element.
EX:
OUTPUT
Mouse over this paragraph, to display the title attribute as a tooltip.
7.Style
The style attribute used to to change the color,font,size of the text.
EX:
OUTPUT