images in html
to add images in html we use <img/>
it has two attributes :-
1. src-In this src attribute we write the url of image between the double quotation marks.
2. alt-it is used to show alternative text for the image when unloaded.
3. width-it is used to define the width of the image. It can be set in percent or px
4. height-it is used to define the height of the image. It can be set in percent or px
let's see this code's result :- <img src="earth.jpg" alt="image" width="500px" height="150px"/>
attributes adds information to the elements in html
hyperlinks in html
to add hyperlinks in html we use <a></a>
it has two attributes:-
1. href- This attribute gives the link to add the hyperlink
2. target- this attributes has four values which are;-
(1)_self: (Default) Opens the linked document in the same frame or window as the current document was clicked. This is the default behavior if no target is specified.
(2)_blank: Opens the linked document in a new window or tab. This is commonly used for external links to keep the user on your original site.
(3)_parent: Opens the linked document in the parent frameset of the current frame.
(4)_top: Opens the linked document in the full body of the window, breaking out of any nested framesets.
let's see the result of this code :-<a href="www.wikipedia.com" alt="_self">wikipedia</a>
wikipedia
text formatting in html
for identation in html we use these :-
<b>Defines bold text.Let's see it's result: n
<em>Defines emphasized text.Let's see it's result: n
<i>Defines a part of text in an alternate voice or mood.Let's see it's result: n
<small>Defines smaller text.Let's see it's result: n
<strong>Defines important text.Let's see it's result: n
<sub>Defines subscripted text.Let's see it's result: n
<sup>Defines superscripted text.Let's see it's result: n
<ins>Defines inserted text.Let's see it's result: n
<del>Defines deleted text.Let's see it's result: n
<mark>Defines marked/highlighted text.Let's see it's result: n
comments in html
we can add comments in html by doing this :-<!--comment-->
we use it for :--comment:-
1.Documentation: Explaining what specific parts of the code do.
2.Organization: Labeling sections of the page.
3.Debugging: Temporarily hiding or disabling code without deleting it.
4.Collaboration: Leaving notes, reminders, or instructions for other developers.
5.Temporary Content Hiding: Preventing content (text, images, scripts) from appearing on the live webpage.
our youtube channel