HTML Articles

Page 112 of 151

How to set cell width and height in HTML?

Lokesh Badavath
Lokesh Badavath
Updated on 16-Mar-2026 42K+ Views

In HTML tables, cell width and height can be controlled using CSS styling. The most common approach is to use inline CSS with the style attribute on (table data) or (table header) elements. You can specify dimensions in pixels, percentages, or other CSS units. Syntax Following is the syntax for setting cell width and height using inline CSS − Content You can also apply dimensions to header cells − Header Here, value can be specified in pixels (px), percentages (%), em units, or other CSS measurement units. ...

Read More

How to automatically redirect a Web Page to another URL?

Arushi
Arushi
Updated on 16-Mar-2026 46K+ Views

Page redirection is a technique where visitors clicking on a URL are automatically directed to a different page than originally intended. This happens seamlessly in the background and is commonly used for moving content, temporary maintenance pages, or directing users to updated URLs. To redirect from an HTML page, use the meta tag with the http-equiv attribute. This attribute provides an HTTP header for the value of the content attribute, which specifies the number of seconds to wait before redirecting and the destination URL. Syntax Following is the syntax for HTML page redirection using the meta tag ...

Read More

How to use datetime input type in HTML?

Arjun Thakur
Arjun Thakur
Updated on 16-Mar-2026 29K+ Views

The datetime-local input type in HTML allows users to select both date and time using a built-in date and time picker. This input type creates a form control that displays a calendar and time selector when clicked, making it easy for users to enter accurate date-time values. Syntax Following is the syntax for the datetime-local input type − The value format follows the ISO 8601 standard: YYYY-MM-DDTHH:MM where the T separates the date and time components. Basic Example Following example demonstrates how to use the datetime-local input type in a form ...

Read More

How to clear all the input in HTML forms?

Lokesh Badavath
Lokesh Badavath
Updated on 16-Mar-2026 29K+ Views

Using HTML forms, you can easily take user input. The tag is used to get user input by adding form elements. Different types of form elements include text input, radio button input, submit button, etc. To clear all the input in an HTML form, you have several methods available. The most common approaches include using the reset input type, JavaScript's getElementById() method, or direct onclick events. Each method serves different scenarios depending on whether you want to clear individual fields or all form data at once. Method 1 − Using JavaScript getElementById() The getElementById() method allows ...

Read More

Should I write my script in the body or the head of the HTML?

Bhanu Priya
Bhanu Priya
Updated on 16-Mar-2026 1K+ Views

In HTML, the script tag can be placed either in the section or in the section. The location affects when the script executes and how it interacts with page elements. Understanding the differences helps you choose the optimal placement for your JavaScript code. Syntax Following is the basic syntax for embedding JavaScript in HTML − //JavaScript code here You can place multiple script tags in an HTML document, and they can appear in the , , or both sections. Script in Head Section When scripts ...

Read More

How to create conditional comments in HTML?

Bhanu Priya
Bhanu Priya
Updated on 16-Mar-2026 2K+ Views

Conditional comments are HTML comments that contain special syntax to target specific versions of Internet Explorer. They allow developers to include or exclude HTML content based on the browser and version being used, helping solve cross-browser compatibility issues that were common with older IE versions. HTML Comments Overview Before understanding conditional comments, let's review regular HTML comments and their characteristics − HTML comments are non-executable statements used to describe or annotate code. Comments use the syntax with opening and closing tags. Comments can be placed anywhere in HTML but are commonly placed after the DOCTYPE ...

Read More

How do we add a definition term in HTML?

Bhanu Priya
Bhanu Priya
Updated on 16-Mar-2026 599 Views

The definition term is represented by the tag in HTML, which describes the name or term in a description list. The element works in conjunction with and tags to create structured definition lists. tag defines a description list container tag defines the term being described tag provides the description or definition for each term The tag supports both global and event attributes and is supported by all modern browsers. Syntax Following is the syntax for creating definition terms − Term ...

Read More

How to add a container for an external (non-HTML) application in HTML5

Bhanu Priya
Bhanu Priya
Updated on 16-Mar-2026 434 Views

To add a container for an external application in HTML5, we use the tag. It defines a container for an external resource like web pages, media players, pictures, or plug-in applications. The embed element is a self-closing tag that provides a generic way to include external content when more specific HTML5 elements are not suitable. Syntax Following is the basic syntax for the embed tag in HTML − The tag is self-closing and does not require a closing tag. It supports global and event attributes in HTML5. Attributes The ...

Read More

Add a horizontal rule in HTML

Bhanu Priya
Bhanu Priya
Updated on 16-Mar-2026 861 Views

The tag in HTML creates a horizontal rule that defines a thematic break in an HTML page. It is commonly used to visually separate content sections or indicate a change in topic within a document. The tag is a self-closing element that requires no closing tag. Syntax Following is the basic syntax for the tag − In modern HTML5, the tag is styled using CSS rather than HTML attributes. However, for compatibility, some legacy attributes are still recognized − Legacy Attributes The following ...

Read More

Add a label for a form control in HTML?

Bhanu Priya
Bhanu Priya
Updated on 16-Mar-2026 632 Views

In HTML, the tag is used to define labels for form controls, creating a clickable association between the label text and the form element. When a user clicks on a properly associated label, the browser automatically focuses or activates the corresponding form control. The tag can be associated with the following form elements − (all types) Syntax Following is the basic syntax of the tag − Label text The tag supports two key attributes − for − Specifies ...

Read More
Showing 1111–1120 of 1,509 articles
« Prev 1 110 111 112 113 114 151 Next »
Advertisements