HTML Tutorial #4: Images & File Paths | Web Development | Filipino | Tagalog

SDPT Solutions
26 Sept 202128:04

Summary

TLDRIn this HTML tutorial part 4, the focus is on incorporating images and managing file paths. The instructor explains the use of the 'img' tag, its attributes like 'src' for source, 'width', and 'height' which can be set in pixels or percentages. The tutorial also covers how to add images from local directories and the web, using absolute and relative file paths. Practical examples are given, such as adjusting image dimensions and linking to external sources. The video concludes with an invitation for viewers to engage through comments or social media.

Takeaways

  • πŸ–ΌοΈ The video is part of an HTML tutorial series focusing on images and file paths.
  • πŸ“Έ The 'img' tag is used to embed images in HTML, and it requires an 'src' attribute for the file path.
  • πŸ” Image attributes include 'alt' for alternative text, 'width', and 'height' to specify the image dimensions.
  • 🎚️ The 'width' and 'height' attributes can be set in pixels or as a percentage of the container.
  • πŸ”„ The aspect ratio of an image is maintained when only one dimension (width or height) is specified.
  • πŸ“ File paths can be relative, using folder names and '../' to navigate directories.
  • 🌐 For external images, absolute URLs can be used by copying the image link from the source.
  • πŸ”— The 'alt' attribute is important for accessibility, providing a text alternative if the image cannot be displayed.
  • πŸ–₯️ The tutorial demonstrates how to add an image to an HTML file using a text editor.
  • πŸ“ The presenter encourages viewers to ask questions and engage with the content through comments or social media.

Q & A

  • What is the main topic of this HTML tutorial?

    -The main topic of this HTML tutorial is about using images and understanding file paths.

  • What is the basic HTML element used to insert an image?

    -The basic HTML element used to insert an image is the 'img' tag.

  • What are the two main attributes of the 'img' tag discussed in the tutorial?

    -The two main attributes of the 'img' tag discussed are 'src' for the source of the image and 'alt' for alternative text.

  • How can you specify the width and height of an image in HTML?

    -You can specify the width and height of an image in HTML using the 'width' and 'height' attributes, which can be set in pixels or as a percentage.

  • What does the 'alt' attribute represent in an 'img' tag?

    -The 'alt' attribute represents alternative text for an image, which is used when the image cannot be displayed.

  • How can you add a link to an image in HTML?

    -You can add a link to an image in HTML by wrapping the 'img' tag within an 'a' (anchor) tag.

  • What is the default unit for the 'width' and 'height' attributes in an 'img' tag?

    -The default unit for the 'width' and 'height' attributes in an 'img' tag is pixels.

  • How do you insert an image from a file path in the same directory as your HTML file?

    -You insert an image from a file path in the same directory by using the 'src' attribute with the file name and its extension, like 'src="filename.png"'.

  • What is the significance of using a forward slash (/) in a file path for an image?

    -Using a forward slash (/) in a file path indicates the root directory, and it helps in locating the image file regardless of the current directory.

  • How can you obtain an image link from a website to use in your HTML?

    -You can obtain an image link from a website by right-clicking the image, selecting 'Copy image link', and then pasting the link in the 'src' attribute of the 'img' tag.

  • What does the tutorial suggest doing if you are unsure about a concept like aspect ratio?

    -If you are unsure about a concept like aspect ratio, the tutorial suggests watching previous episodes for a better understanding.

Outlines

00:00

πŸ–ΌοΈ HTML Images and File Paths

This segment of the HTML tutorial series focuses on the use of images and file paths in HTML. The speaker introduces the topic and provides an overview of the tutorial's flow, which includes discussing the image element, its attributes, links, and text attribution. The tutorial explains how to use the 'img' tag with 'src' attribute to specify the image source, and demonstrates setting the image width and height using pixels or percentages. It also touches on the aspect ratio and how to maintain it when resizing images.

05:08

πŸ“ Image Tag and File Path

In this part, the tutorial delves into the specifics of using the 'img' tag and specifying the correct file path for images. The speaker instructs on how to properly use the 'src' attribute with the file path to display an image on a webpage. An example is given where the image file is named 'lipidgames.png' and is set to display at 200 pixels by 200 pixels. The tutorial also covers how to save and view the image on the right side of the screen.

10:31

πŸ”— Copying Image Links

The speaker demonstrates how to obtain an image from the internet for use in a webpage. They guide viewers through the process of finding an image on Google, right-clicking to copy the image link, and then pasting it into the 'src' attribute of the 'img' tag. This section shows how to embed an image directly from a URL into an HTML document.

17:31

πŸ“‚ File Path Variations

This section discusses different ways to specify file paths for images in HTML. The tutorial covers relative paths, such as using 'images/name.png' for an image in a folder named 'images', and absolute paths. It also explains how to reference images in different directories, including using '..' to move up a directory level. The speaker provides examples and clarifies the concept of file paths in the context of web development.

23:03

πŸ“’ Closing Remarks and Engagement

The tutorial concludes with the speaker thanking the viewers for watching and encouraging them to leave comments or messages on Facebook. They assure viewers that they will respond to queries as soon as possible. The speaker reiterates their appreciation for the viewers' engagement and looks forward to the next video in the series.

Mindmap

Keywords

πŸ’‘HTML

HTML stands for HyperText Markup Language, which is the standard markup language for creating web pages and web applications. It is the foundation of any web document, providing the structure and content. In the video, HTML is the main theme as the tutorial series is about HTML and the script discusses how to use HTML to incorporate images and manage file paths.

πŸ’‘Image Element

The image element in HTML is represented by the 'img' tag and is used to embed images into web pages. It is a void element, meaning it doesn't require a closing tag. The video script mentions using the 'img' tag to insert images, emphasizing that it is a fundamental part of HTML for adding visual content to websites.

πŸ’‘File Paths

File paths are the addresses that specify the location of a file on a computer system. In the context of web development, they are crucial for linking to resources like images. The script discusses how to specify file paths using the 'src' attribute in the 'img' tag to ensure images are correctly displayed on a webpage.

πŸ’‘Attributes

In HTML, attributes provide additional information about HTML elements. For the 'img' element, attributes like 'src', 'alt', 'width', and 'height' are used to define the source, alternative text, dimensions, and other properties of an image. The video script explains how to use these attributes to control the appearance and functionality of images.

πŸ’‘Image Links

Image links refer to using images as hyperlinks to direct users to another page or section. The script touches on this concept by showing how to use the 'img' element within an 'a' (anchor) tag to create clickable images that navigate users to different web pages.

πŸ’‘Width and Height

The 'width' and 'height' attributes in HTML are used to specify the dimensions of an image. The video script provides examples of how to set these attributes in pixels or as a percentage to control the size of the image displayed on a webpage, which is essential for responsive design and layout management.

πŸ’‘Aspect Ratio

Aspect ratio is the proportional relationship between the width and height of an image or video. Maintaining the aspect ratio is important to prevent images from appearing stretched or squished. The video script briefly mentions this concept in relation to setting the 'width' and 'height' attributes to ensure the image looks correct on different devices and screen sizes.

πŸ’‘Absolute Path

An absolute path in computing is a full path that specifies the location of a file from the root directory. The script explains how to use absolute paths to reference images, which is useful when the images are stored outside of the website's main directory or when the website is hosted on a different server.

πŸ’‘Relative Path

A relative path is a file path that is specified in relation to the current file or directory. The video script discusses using relative paths to link images, which is a common practice in web development to maintain flexibility and ease of maintenance, especially when working with multiple directories and subdirectories.

πŸ’‘Image Sources

Image sources refer to the URLs or file paths from which images are loaded into a web page. The script provides a step-by-step guide on how to use the 'src' attribute to specify the source of an image, whether it's a local file or an image hosted online, which is a fundamental aspect of embedding images in HTML.

πŸ’‘Responsive Images

Responsive images are images that automatically adjust their size and resolution to fit different screen sizes and resolutions. While not explicitly mentioned in the script, the discussion of 'width' and 'height' attributes and the use of percentages imply the importance of creating images that are responsive and look good on all devices.

Highlights

Introduction to HTML tutorial series, part 4 focusing on images and file paths.

Explanation of the img tag in HTML for embedding images.

Discussion on image attributes including src, width, and height.

Demonstration of setting image dimensions in pixels and percentages.

Tutorial on adding alt text for accessibility and SEO.

Guide on how to use the 'width' attribute to set image width.

Guide on how to use the 'height' attribute to set image height.

Explanation of aspect ratio and its importance in image display.

Instruction on adding images to HTML files using the img tag.

Example of how to use the 'src' attribute to link to an image file.

Demonstration of embedding an image from a URL using the 'src' attribute.

Explanation of relative and absolute file paths for images.

Tutorial on how to reference images in different folders using file paths.

Guide on how to use the 'alt' attribute for image descriptions.

Advice on watching previous episodes for more context on image handling.

Encouragement for viewers to ask questions and engage with the content.

Closing remarks and a prompt for viewers to look forward to the next video.

Transcripts

play00:00

hey guys welcome back starting html

play00:02

tutorial series so this is part 4 and

play00:04

for today we are going to talk about

play00:06

images and file paths right after this

play00:09

intro

play00:15

so guys for today at one tutorial flow

play00:17

nothing so um

play00:19

is your img or your image element

play00:21

nothing and then next you image

play00:23

attributes and then next your image

play00:26

links and then lastly you adding

play00:44

[Music]

play01:25

width parabola indicate nothing your

play01:26

width and then you hide parama indicate

play01:28

your height and then lastly

play01:30

which is your text

play01:35

okay and then

play01:38

attribution which

play02:05

[Music]

play02:34

so

play02:54

attribute which is like detection number

play02:57

in pixels or percentage so by default

play03:00

pixels a guys so for example img src

play03:04

name that png and then your vidnya 200

play03:07

and then you hide near 200. so by

play03:09

default pixel stop meaning 200 pixels by

play03:12

200 pixels and then pretty denominating

play03:15

10 is percentage so at the width fifty

play03:18

percent and then height fifty percent

play03:22

of pixels

play03:30

and then your aspect

play04:42

structure so if you don't know this then

play04:44

you should probably watch the previous

play04:46

episodes

play04:50

and then you're adding html files so

play04:53

again atom tutorial for nothing

play05:08

by double clicking

play05:23

image for now

play05:26

img tag img and then src

play05:30

then equals

play05:33

uh file path so

play05:36

stupid lipidgames.png

play05:38

make sure

play05:40

you

play05:40

png

play05:42

extension

play05:45

jpg so depending on

play05:48

your picture so for example png

play07:17

so 200 pixels by 200 pixels so you save

play07:20

nothing on it and then it reload not it

play07:23

on the right side and what you can see

play07:25

which is at 200 pixels by 200 pixels

play07:28

okay

play08:22

[Music]

play09:34

screen

play10:31

quotes and then you're closing nothing

play10:33

so again

play10:35

and then that is a google and then my

play10:37

search time

play10:38

picture so i slipped it in the vote shot

play10:40

so when it is slipped to devotions

play10:42

so i thought i got the picture right

play10:44

click

play10:45

and then copy image link that then so

play10:47

copy image link

play10:49

and then they paste you just src

play10:53

image

play10:54

control left clicked

play10:58

a picture nothing literally

play13:23

[Music]

play15:10

[Music]

play17:30

but

play17:31

so for example at your current folder

play17:36

new name that png nothing all right so

play17:38

gets the next variation images slash

play17:41

name dot png so to the manuf

play18:05

[Music]

play18:39

okay so your slash images

play19:09

nothing is that this folder one level up

play19:12

from the current folder

play19:15

so for example dot dot slash dot dot

play19:18

slash name that png enables a beta so

play19:20

for example at the current folder not

play19:22

edited

play19:32

[Music]

play19:50

so

play20:05

a tutorial for

play20:06

so any absolute partner picture nothing

play20:09

else

play20:15

so absolutely

play20:17

i think image snippety games

play20:32

[Music]

play23:03

[Music]

play24:59

[Music]

play25:21

[Music]

play27:20

[Music]

play27:32

and i will answer to you as soon as

play27:34

possible okay so you don't guys thank

play27:36

you for watching this video

play27:39

and

play27:41

just leave the comments out in comment

play27:43

section or message us on facebook and

play27:46

also guys better

play27:53

[Music]

play27:55

again thank you for watching and as

play27:56

always guys i will see you in the next

play28:00

video

play28:01

goodbye

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
HTML TutorialImage PathsFile PathsWeb DevelopmentImage AttributesWeb DesignPixel DimensionsTutorial SeriesWeb ImagesHTML Elements