Prof. Varsha Tank (IT/ICT Dept. - Ljiet) : Presented by
Prof. Varsha Tank (IT/ICT Dept. - Ljiet) : Presented by
-
Presented by :
LJIET)
UNIT – 2
HTML AND CSS – cont.
Topics to be covered
HTML practicals
HTML Formatting
HTML Formatting is a process of formatting text for better look and feel.
HTML provides us ability to format text without using CSS. There are many
formatting tags in HTML. These tags are used to make text bold, italicized,
or underlined.
Physical tag: These tags are used to provide the visual appearance to the
text.
Logical tag: These tags are used to add some logical or semantic value to
the text.
NOTE: There are some physical and logical tags which may give same
visual appearance, but they will be different in semantics.
HTML Formatting – cont.
<b> This is a physical tag, which is used to bold the text written between it.
<strong> This is a logical tag, which tells the browser that the text is important.
<tt> This tag is used to appear a text in teletype. (not supported in HTML5)
<strike> This tag is used to draw a strikethrough on a section of text. (Not supported
in HTML5)
<big> This tag is used to increase the font size by one conventional unit.
<small> This tag is used to decrease the font size by one unit from base font size.
Text Abbreviation tag
This tag is used to abbreviate a text. To abbreviate
a text, write text between <abbr> and </abbr>
tag.
<p>An <abbr title = "Hypertext Markup language">HTML
</abbr>language is used to create web pages.
HTML anchor tag
The HTML anchor tag defines a hyperlink that links one
page to another page. It can create hyperlink to other
web page as well as files, location, or any URL.
The "href" attribute is the most important attribute of
the HTML a tag. and which links to destination page or
URL.
The href attribute is used to define the address of the
file to be linked. In other words, it points out the
destination page.
The syntax of HTML
<a href = "..........."> Link Text </a>
HTML anchor tag
Specify a location for Link using target attribute
If we want to open that link to another page then
we can use target attribute of <a> tag. With the
help of this link will be open in next page.
Note:
The target attribute can only use with href attribute in
anchor tag.
If we will not use target attribute then link will open in
same page.
HTML anchor tag – cont.
Appearance of HTML anchor tag
An unvisited link is displayed underlined and blue.
HTML anchor tag – cont.
Use <img> tag as a link
We can also link an image with other page or we can
use an image as a link. To do this, put <img> tag inside
the <a> tag.
Example:
<a href="https://www.javatpoint.com/what-is-
robotics"><img src="robot.jpg" height="100" width="
100"></a>
HTML anchor tag – cont
The target attribute
The target attribute inside anchor tags (<a>) tells the browser where the linked document should be loaded.
It’s optional, and defaults to _self when no value is provided. It can take a browsing context name/keyword
(e.g.: tab, window), or one of the following 4 keywords.
The concept of a browsing context was introduced with HTML5 and it refers to a window, tab or frame
inside a page.
_self: The default value. Loads the document in the same browsing context.
_blank: The most commonly used value. Loads the document in a new browsing context (window or tab).
_parent: Loads the document in the parent browsing context/frame if there’s one, or the same browsing
context if there’s no parent.
_top: Loads the document in the topmost browsing context/frame if there’s one, or the same browsing
context if there’s no parent.