{"id":136913,"date":"2024-10-10T15:58:52","date_gmt":"2024-10-10T10:28:52","guid":{"rendered":"https:\/\/www.vskills.in\/certification\/tutorial\/?page_id=136913"},"modified":"2024-10-15T17:00:28","modified_gmt":"2024-10-15T11:30:28","slug":"embedding-media-in-html5-writing-html-markup","status":"publish","type":"page","link":"https:\/\/www.vskills.in\/certification\/tutorial\/embedding-media-in-html5-writing-html-markup\/","title":{"rendered":"Embedding media in HTML5 | Writing HTML Markup"},"content":{"rendered":"\n<p>To embed an image in HTML5, use the &lt;img&gt; element. The src attribute specifies the image source, while the alt attribute provides alternative text for users who cannot see the image.<\/p>\n\n\n\n<p>&lt;img src=&#8221;image.jpg&#8221; alt=&#8221;A beautiful image&#8221;&gt;<\/p>\n\n\n\n<p><strong>Making Images Responsive<\/strong><\/p>\n\n\n\n<p>To ensure images scale appropriately on different screen sizes, set their max-width to 100%.<\/p>\n\n\n\n<p>&lt;img src=&#8221;image.jpg&#8221; alt=&#8221;A beautiful image&#8221; style=&#8221;max-width: 100%;&#8221;&gt;<\/p>\n\n\n\n<p><strong>Embedding Videos<\/strong><\/p>\n\n\n\n<p>You can embed videos from platforms like YouTube or Vimeo using an &lt;iframe&gt; element.<\/p>\n\n\n\n<p>&lt;iframe width=&#8221;560&#8243; height=&#8221;315&#8243; src=&#8221;https:\/\/www.youtube.com\/embed\/dQw4w9WgXcQ&#8221; title=&#8221;YouTube Video&#8221; frameborder=&#8221;0&#8243; allow=&#8221;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&#8221; allowfullscreen&gt;&lt;\/iframe&gt;&nbsp;<\/p>\n\n\n\n<p><strong>Responsive Videos<\/strong><\/p>\n\n\n\n<p>To make videos responsive, set their width and height to 100%. You can also use JavaScript libraries like lazy loading to improve performance.<\/p>\n\n\n\n<p>&lt;iframe src=&#8221;https:\/\/www.youtube.com\/embed\/dQw4w9WgXcQ&#8221; title=&#8221;YouTube Video&#8221; frameborder=&#8221;0&#8243; allow=&#8221;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&#8221; allowfullscreen style=&#8221;width: 100%; height: 100%;&#8221;&gt;&lt;\/iframe&gt;&nbsp;<\/p>\n\n\n\n<p><strong>Embedding Audio<\/strong><\/p>\n\n\n\n<p>Use the &lt;audio&gt; element to embed audio files. The src attribute specifies the audio source, and the controls attribute displays audio controls.<\/p>\n\n\n\n<p>&lt;audio controls&gt;<\/p>\n\n\n\n<p>&nbsp; &lt;source src=&#8221;audio.mp3&#8243; type=&#8221;audio\/mpeg&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp; Your browser does not support the audio element.<\/p>\n\n\n\n<p>&lt;\/audio&gt;<\/p>\n\n\n\n<p><strong>Responsive Audio<\/strong><\/p>\n\n\n\n<p>To make audio responsive, consider using JavaScript to dynamically adjust the audio player&#8217;s size based on the screen width.<\/p>\n\n\n\n<p><strong>Additional Tips<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Optimize media files:<\/strong> Compress images and videos to reduce file size and improve loading times.<\/li>\n\n\n\n<li><strong>Provide alternative content:<\/strong> If a user cannot view or play media, provide alternative content, such as a text description.<\/li>\n\n\n\n<li><strong>Consider accessibility:<\/strong> Ensure your media content is accessible to users with disabilities.<\/li>\n\n\n\n<li><strong>Test on different devices:<\/strong> Test your media embedding on various devices and screen sizes to ensure it works as expected.<\/li>\n<\/ul>\n\n\n\n<p>By following these guidelines, you can effectively embed media in your responsive web designs and enhance the user experience.<\/p>\n\n\n\n<div class=\"wp-block-buttons alignwide is-content-justification-space-between is-layout-flex wp-container-core-buttons-is-layout-3d213aab wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button is-style-fill\"><a class=\"wp-block-button__link has-content-heading-color has-text-color has-background has-link-color wp-element-button\" href=\"https:\/\/www.vskills.in\/certification\/tutorial\/wcag-accessibility-conformance-and-wai-aria-for-more-accessible-web-applications-writing-html-markup\/\" style=\"background-color:#ffffff\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>&lt;&lt;Prev<\/strong><\/a><\/div>\n\n\n\n<div class=\"wp-block-button is-style-fill\"><a class=\"wp-block-button__link has-content-heading-color has-text-color has-background has-link-color wp-element-button\" href=\"https:\/\/www.vskills.in\/certification\/tutorial\/certificate-in-responsive-web-design\/\" style=\"background-color:#ffffff\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Back To The Tutorial<\/strong><\/a><\/div>\n\n\n\n<div class=\"wp-block-button is-style-fill\"><a class=\"wp-block-button__link has-content-heading-color has-text-color has-background has-link-color wp-element-button\" href=\"https:\/\/www.vskills.in\/certification\/tutorial\/the-element-writing-html-markup\/\" style=\"background-color:#ffffff\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Next&gt;&gt;<\/strong><\/a><\/div>\n<\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To embed an image in HTML5, use the &lt;img&gt; element. The src attribute specifies the image source, while the alt attribute provides alternative text for users who cannot see the image. &lt;img src=&#8221;image.jpg&#8221; alt=&#8221;A beautiful image&#8221;&gt; Making Images Responsive To ensure images scale appropriately on different screen sizes, set their max-width to 100%. &lt;img src=&#8221;image.jpg&#8221;&#8230;<\/p>\n","protected":false},"author":15,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-136913","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Embedding media in HTML5 | Writing HTML Markup - Tutorial<\/title>\n<meta name=\"description\" content=\"Ensure your success on the Certified Responsive Web Design Exam. Get Certified Now!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vskills.in\/certification\/tutorial\/embedding-media-in-html5-writing-html-markup\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Embedding media in HTML5 | Writing HTML Markup - Tutorial\" \/>\n<meta property=\"og:description\" content=\"Ensure your success on the Certified Responsive Web Design Exam. Get Certified Now!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vskills.in\/certification\/tutorial\/embedding-media-in-html5-writing-html-markup\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorial\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/vskills.in\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-15T11:30:28+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/embedding-media-in-html5-writing-html-markup\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/embedding-media-in-html5-writing-html-markup\/\",\"name\":\"Embedding media in HTML5 | Writing HTML Markup - Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\"},\"datePublished\":\"2024-10-10T10:28:52+00:00\",\"dateModified\":\"2024-10-15T11:30:28+00:00\",\"description\":\"Ensure your success on the Certified Responsive Web Design Exam. Get Certified Now!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/embedding-media-in-html5-writing-html-markup\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.vskills.in\/certification\/tutorial\/embedding-media-in-html5-writing-html-markup\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/embedding-media-in-html5-writing-html-markup\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Embedding media in HTML5 | Writing HTML Markup\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"name\":\"Tutorial\",\"description\":\"Vskills - A initiative in elearning and certification\",\"publisher\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\",\"name\":\"Vskills\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"contentUrl\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"width\":73,\"height\":55,\"caption\":\"Vskills\"},\"image\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/vskills.in\/\",\"https:\/\/x.com\/vskills_in\",\"https:\/\/www.linkedin.com\/company-beta\/1371554\/\",\"https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Embedding media in HTML5 | Writing HTML Markup - Tutorial","description":"Ensure your success on the Certified Responsive Web Design Exam. Get Certified Now!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.vskills.in\/certification\/tutorial\/embedding-media-in-html5-writing-html-markup\/","og_locale":"en_US","og_type":"article","og_title":"Embedding media in HTML5 | Writing HTML Markup - Tutorial","og_description":"Ensure your success on the Certified Responsive Web Design Exam. Get Certified Now!","og_url":"https:\/\/www.vskills.in\/certification\/tutorial\/embedding-media-in-html5-writing-html-markup\/","og_site_name":"Tutorial","article_publisher":"https:\/\/www.facebook.com\/vskills.in\/","article_modified_time":"2024-10-15T11:30:28+00:00","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/embedding-media-in-html5-writing-html-markup\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/embedding-media-in-html5-writing-html-markup\/","name":"Embedding media in HTML5 | Writing HTML Markup - Tutorial","isPartOf":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website"},"datePublished":"2024-10-10T10:28:52+00:00","dateModified":"2024-10-15T11:30:28+00:00","description":"Ensure your success on the Certified Responsive Web Design Exam. Get Certified Now!","breadcrumb":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/embedding-media-in-html5-writing-html-markup\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vskills.in\/certification\/tutorial\/embedding-media-in-html5-writing-html-markup\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/embedding-media-in-html5-writing-html-markup\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vskills.in\/certification\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Embedding media in HTML5 | Writing HTML Markup"}]},{"@type":"WebSite","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","name":"Tutorial","description":"Vskills - A initiative in elearning and certification","publisher":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization","name":"Vskills","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","contentUrl":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","width":73,"height":55,"caption":"Vskills"},"image":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/vskills.in\/","https:\/\/x.com\/vskills_in","https:\/\/www.linkedin.com\/company-beta\/1371554\/","https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw"]}]}},"_links":{"self":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/136913","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/comments?post=136913"}],"version-history":[{"count":3,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/136913\/revisions"}],"predecessor-version":[{"id":137317,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/136913\/revisions\/137317"}],"wp:attachment":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/media?parent=136913"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/categories?post=136913"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/tags?post=136913"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}