Unit 3: Multimedia and Interactivity Flashcards
create a hyperlink:
<a>Click here to visit Example.com</a>
the a tag is used to create a hyperlink to the website “https://www.example.com”. The href attribute specifies the URL of the website, while the text between the opening and closing a tags is the visible text that the user clicks on.
<a>Jump to Section 1</a>
…
<h2>Section 1</h2>
<p>Content for section 1 goes here</p>
the a tag is used to create a link to a section of the same page with the id attribute of “section1”. When the user clicks on the “Jump to Section 1” link, the browser will automatically scroll down to the section with the corresponding id.
The ………… attribute is used to specify where the linked document will be displayed when a user clicks on a hyperlink.
target
By default, the linked document opens in the same window or tab as the current document. However, you can use the…………….. to change this behavior.
target attribute
_blank
Target attribute
<a>Click here to visit Example.com</a>
When you use the _blank value for the target attribute, the linked document will open in a new window or tab. Here’s an example:
In this example, the a tag creates a hyperlink to the website “https://www.example.com”. The href attribute specifies the URL of the website, while the text between the opening and closing a tags is the visible text that the user clicks on.
<a>Click here to visit Example.com</a>
Relative pathnames?
A relative pathname is a URL that is relative to the current webpage’s location. This means that you only need to specify the path from the current page to the linked page, without including the full URL of the website. For example:
<a>
About Us</a>
Absolute pathnames:
An absolute pathname is a URL that includes the full path to the linked page, starting from the root directory of the website. For example:
<a>About Us</a>
LIST 3 Advantages of relative pathnames:
Can simplify your code by using shorter URLs
Can make your code more flexible, as you can move your files around without breaking links
Can make your code more portable, as you can use the same code on different servers without changing the URLs
LIST 2 Disadvantages of relative pathnames:
May become complicated if you have a deep folder structure or if you’re linking to a file in a different folder
May not work if the file structure is changed and the relative path is no longer valid
LIST 2 Advantages of absolute pathnames:
Can be more specific about the location of the linked page
Can be useful when linking to pages on other website
LIST 2 Disadvantages of absolute pathnames:
Can make your code less flexible, as the link will break if the domain or file structure is changed
Can make your code less portable, as you will need to change the URLs if you move your code to a different server.
The ……… link is used to create a hyperlink that will automatically open the user’s email client with a new email message, pre-populated with information such as the recipient’s email address, subject line, and body text.
mailto
<a>Send Email</a>
to: Specifies the email address of the recipient. You can include multiple email addresses by separating them with commas.
Example: mailto:recipient1@example.com,recipient2@example.com
cc: Specifies the email address(es) of the recipients to be included in the carbon copy (CC) field.
Example: mailto:recipient@example.com? cc=copy1@example.com,copy2@example.com
bcc: Specifies the email address(es) of the recipients to be included in the blind carbon copy (BCC) field.
Example: mailto:recipient@example.com?bcc=blindcopy1@example.com,blindcopy2@example.com
subject: Specifies the subject line of the email.
Example: mailto:recipient@example.com?subject=Subject%20Line
body: Specifies the body text of the email.
Example: mailto:recipient@example.com?body=Body%20Text
attachment: Specifies the file attachment(s) to be included in the email.
Example: mailto:recipient@example.com?attachment=http://www.example.com/files/document.pdf
<img></img>
The src attribute specifies the location of the image file, while the alt attribute provides a description of the image for screen readers or if the image fails to load.
<img></img>
The src attribute specifies the location of the image file, while the alt attribute provides a description of the image for screen readers or if the image fails to load.
i. Image Types?
i. Image Types:
There are three main types of image formats used on the web: GIF, JPEG, and PNG. GIF and PNG are best suited for simple images with few colors, while JPEG is best for photographs or images with many colors.