MIME types

MIME types

MIME (Multipurpose Internet Mail Extensions) types in HTML are used to specify the type of file being served by the web server. MIME types are used by web browsers and other applications to understand how to handle the content they receive from the server.

Here are some commonly used MIME types in HTML:

text/html: This is the MIME type for HTML files, indicating that the content is a webpage.

image/jpeg: This is the MIME type for JPEG image files.

image/png: This is the MIME type for PNG image files.

application/pdf: This is the MIME type for PDF files.

text/css: This is the MIME type for CSS files, indicating that the content is a stylesheet.

application/javascript: This is the MIME type for JavaScript files.

application/json: This is the MIME type for JSON data.

text/plain: This is the MIME type for plain text files.

To specify the MIME type of a file in HTML, you can use the “type” attribute of the “link” or “script” tag, like this:

<link rel=”stylesheet” type=”text/css” href=”styles.css”>

<script type=”application/javascript” src=”script.js”></script>

In the above example, the “type” attribute is used to specify the MIME type of the linked stylesheet and script file. By providing accurate MIME types for your files, you can ensure that they are properly handled by web browsers and other applications, and that your website functions correctly for all users.

Apply for HTML Certification

https://www.vskills.in/certification/certified-html-designer

Back to Tutorials

Share this post
[social_warfare]
Site Structure
Tables

Get industry recognized certification – Contact us

keyboard_arrow_up