html css documentation computer science, Study notes of Computer Applications

learning html and css is good for all computer science students in all categories.

Typology: Study notes

2018/2019

Uploaded on 09/18/2023

fred-mwendwa
fred-mwendwa 🇰🇪

1 document

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
HTML Links
HTML Links - Hyperlinks
You can click on a link and jump to another document.When you move the
mouse over a link, the mouse arrow will turn into a little hand. A link does not
have to be text. A link can be an image or any other HTML element!
HTML Links - Syntax
The HTML <a> tag defines a hyperlink. It has the following syntax:<a
href="url">link text</a>
The most important attribute of the <a> element is the href attribute, which
indicates the link's destination.
The link text is the part that will be visible to the reader.
Clicking on the link text, will send the reader to the specified URL address.
Example
This example shows how to create a link to W3Schools.com:
<ahref="https://www.w3schools.com/">Visit W3Schools.com!</a>
By default, links will appear as follows in all browsers:[a]An unvisited link is
underlined and blue.
[b]A visited link is underlined and purple.
[c]An active link is underlined and red.
The target Attribute
The target attribute specifies where to open the linked document.
The target attribute can have one of the following values:[1]_self - Default.
Opens the document in the same window/tab as it was clicked.
[2]_blank - Opens the document in a new window or tab.
[3]_parent - Opens the document in the parent frame.
[4]_top - Opens the document in the full body of the window.
pf3
pf4

Partial preview of the text

Download html css documentation computer science and more Study notes Computer Applications in PDF only on Docsity!

HTML Links

HTML Links - Hyperlinks

You can click on a link and jump to another document.When you move the mouse over a link, the mouse arrow will turn into a little hand. A link does not have to be text. A link can be an image or any other HTML element!

HTML Links - Syntax

The HTML tag defines a hyperlink. It has the following syntax: link text

The most important attribute of the element is the href attribute, which

indicates the link's destination. The link text is the part that will be visible to the reader. Clicking on the link text, will send the reader to the specified URL address.

Example

This example shows how to create a link to W3Schools.com: Visit W3Schools.com! By default, links will appear as follows in all browsers:[a]An unvisited link is underlined and blue. [b]A visited link is underlined and purple. [c]An active link is underlined and red.

The target Attribute

The target attribute specifies where to open the linked document.

The target attribute can have one of the following values:[1]_self - Default.

Opens the document in the same window/tab as it was clicked.

[2]_blank - Opens the document in a new window or tab.

[3]_parent - Opens the document in the parent frame.

[4]_top - Opens the document in the full body of the window.

Example: Visit W3Schools! [target="_blank" to open the linked document in a new browser window or tab:] Absolute URLs vs. Relative URLs [Absolute URLs]- A full web address in the href attribute. EXAMPLE;Absolute URLs

W3C

Google

[Relative URLs]
  • A local link (a link to a page within the same website) is specified with a relative URL (without the "https://www" part) EXAMPLE;Relative URLs

    HTML Images

    CSS Tutorial

    Use an Image as a Link

-To use an image as a link, just put the tag inside the tag.

Example;

Link to an Email Address

-Use mailto: inside the href attribute to create a link that opens the user's

email program (to let them send a new email) EXAMPLE;Send email

HTML Links-Create Bookmarks

-To create a bookmark - first create the bookmark, then add a link to it.When the link is clicked, the page will scroll down or up to the location with the bookmark. STEPS TO CREATE A BOOKMARK.

[a]First, use the id attribute to create a bookmark:Chapter

4 [b]Then, add a link to the bookmark ("Jump to Chapter 4"), from within the same page:Jump to Chapter 4 [c]You can also add a link to a bookmark on another page:Jump to Chapter 4

Chapter Summary

● Use the id attribute (id=" value ") to define bookmarks in a page

● Use the href attribute (href="# value ") to link to the bookmark.