A tag img em HTML5 - @Curso em Vídeo HTML5 e CSS3

A tag img em HTML5 - @Curso em Vídeo HTML5 e CSS3

How to Insert Images in HTML

Introduction to Image Insertion

  • The lesson begins with excitement about inserting images into a website using HTML tags, emphasizing the importance of this skill.

Importance of Understanding Image Formats

  • The instructor stresses that skipping lessons on image formats and sizes can hinder professional web development skills. Knowledge of where to source images and their optimal sizes is crucial for effective site construction.

Practical Exercise Preparation

  • A practical exercise is introduced, encouraging students to follow along on their computers. The instructor mentions the support from Hostnet, a company specializing in website hosting and WordPress tools.

Hostnet Services Overview

  • Hostnet offers services for creating websites, including tools for e-commerce and online educational platforms. They also provide marketing automation solutions.

Recap of Previous Lessons

  • A recap highlights how an image was optimized from 1.8 MB to 122 KB, demonstrating the importance of managing image sizes effectively for web use.

Creating an Exercise: Step-by-Step

Setting Up the Project

  • The instructor navigates through file directories to create a new exercise folder (exercise 3), preparing the workspace in Visual Studio Code.

Creating HTML Structure

  • An index.html file is created with basic structure elements like <h1> for titles and paragraphs. Students are reminded about previous lessons on linking resources correctly.

Sourcing Images Online

  • Instructions are given on how to find suitable images via Google Images, focusing on transparency and usage rights while searching specifically for HTML5-related graphics.

Inserting Images Using HTML Tags

Using the <img> Tag

  • The process of inserting images into HTML is explained using the <img> tag. Key attributes include src (source path of the image file) and alt (alternative text describing the image).

How to Optimize Image Sizes in HTML and CSS

Introduction to Image Handling

  • The speaker demonstrates how to make the cursor blink in a specific area of the interface, indicating an interactive element for user engagement.

Accessibility Considerations

  • Emphasizes the importance of using alternative text (alt text) for images, particularly for screen readers, enhancing accessibility for visually impaired users.

Managing Image Sizes

  • Discusses checking image sizes and file dimensions within the project folder, highlighting that large images can be problematic.
  • Reiterates previous lessons on resizing images effectively, suggesting a standard size of 250x200 pixels as optimal.

File Management Techniques

  • Describes opening multiple files simultaneously (HTML and CSS), noting differences in spacing between elements which may require adjustments.

Resizing Images with Tools

  • Introduces a cropping tool to adjust image dimensions accurately by dragging corners to fit desired specifications.

Exporting Resized Images

  • Outlines steps for exporting resized images while maintaining quality settings; emphasizes consistency across both HTML and CSS files.

Supporting Content Creation

  • Mentions ways viewers can support the channel through donations or subscriptions, which helps keep educational content free.

Practical Application of Changes

  • Encourages viewers to replace full-size logos with optimized versions in their codebase for better performance.

Performance Benefits from Optimization

  • Demonstrates how reducing file sizes significantly decreases load times; compares original vs. optimized file sizes (from 30k to 14k).

Conclusion on File Management Practices

  • Highlights the efficiency gained by managing smaller image files collectively rather than relying on larger individual files.

Organizing Project Files

How to Load Images in Web Development

Loading Images from Local Directories

  • The process begins with loading images from local directories, specifically mentioning the "MG" folder and how to correctly reference image files.
  • A demonstration of navigating through subfolders is provided, emphasizing the importance of specifying the correct path when loading images.
  • The speaker introduces external links for images, explaining that images can also be loaded from online sources without saving them locally.

Working with External Image Links

  • The discussion shifts to selecting an appropriate size for external images, highlighting the need for transparency and manageable dimensions.
  • Instructions are given on copying image URLs instead of downloading them, showcasing how to retrieve a direct link for use in code.

Understanding URL Structure

  • An explanation of URL structure is provided, detailing how complete addresses must be used when referencing images hosted on different servers.
  • The speaker notes that if the server hosting an image goes down, the image will no longer display on their site. This highlights dependency on external resources.

Key Takeaways About Image Handling

  • A summary of key concepts learned about image handling is presented: choosing formats, resizing images for projects, and optimizing quality versus file size.
  • Emphasis is placed on practical application; viewers are encouraged to practice these techniques at home rather than rush through learning.

Conclusion and Next Steps

  • The session concludes with a recap of what was covered regarding image usage in web development and hints at future topics like favicon icons in upcoming videos.
Video description

Você sabe como inserir uma imagem em um site usando a tag img? Sabe como fazer para evitar erros na hora de colocar o nome da imagem em HTML? Sabe como diminuir uma imagem para tornar seu site mais leve e eficiente? Sabe colocar imagens locais e imagens que estão em outros sites na sua página? Veja a resposta para todas essas perguntas assistindo esse vídeo até o final. Tópicos deste vídeo: 00:00 - Capítulo 06, aula 04 00:27 - Você sabe os fundamentos? 01:08 - Precisa de um site e não tem tempo para criar? 02:33 - Imagens preparadas para um site 03:01 - Criando um exemplo 05:53 - Usando a tag IMG 06:34 - Uma dica que vai simplificar tudo 07:29 - Imagem grande demais. Como diminuir? 09:51 - Apoie o projeto do CursoemVideo 10:35 - Imagens diminuídas e seu site mais leve 12:15 - E se a imagem estiver em uma pasta? 13:25 - Carregando imagens externas 16:02 - Resumo da aula O Curso de HTML5 e CSS3 vai ensinar a criar sites usando a linguagem de marcação hipertexto (HTML) e folhas de estilo em cascata (CSS), todas em suas versões mais recentes. Neste curso, o Professor Gustavo Guanabara criou um conjunto de vídeos, exercícios, desafios e um material de apoio em forma de e-book com 30 capítulos ao todo. Acesse o material de apoio em PDF: == GitHub: https://github.com/gustavoguanabara/html-css/tree/master/aulas-pdf Receba notificações de novos vídeos: == Canal no Telegram: https://t.me/cursoemvideo Acompanhe todos os vídeos do Módulo 1 do Curso de HTML5 e CSS3: == Módulo 01: https://www.youtube.com/playlist?list=PLHz_AreHm4dkZ9-atkcmcBaMZdmLHft8n Consiga certificados fazendo o curso diretamente pelo site oficial do projeto: == Site: https://www.cursoemvideo.com Torne-se apoiador do projeto: == Acesse: https://www.cursoemvideo.com/apoie Siga-nos nas redes sociais: == Gustavo Guanabara no Instagram: https://www.instagram.com/gustavoguanabara == Curso em Vídeo no Instagram: https://www.instagram.com/cursoemvideo == Hostnet no Instagram: https://www.instagram.com/hostnetbr == Recode no Instagram: https://www.instagram.com/rederecode == Estudonauta no Instagram: https://www.instagram.com/estudonauta Conheça os patrocinadores desse curso: == HOSTNET: https://www.hostnet.com/cursoemvideo == RECODE: https://www.recode.org.br/novidades == ESTUDONAUTA: https://www.estudonauta.com/cursoemvideo #cursohtml5css3 #modulo01 #C06A04