HTML Articles

Page 31 of 151

How to create mixin for placeholder in SASS

Aman Gupta
Aman Gupta
Updated on 16-Mar-2026 283 Views

A mixin in SASS is a reusable block of CSS declarations that can be included throughout your stylesheet. Creating a mixin for placeholder styling helps avoid repetitive code when styling form input placeholders across different browsers. Placeholder styling requires vendor-specific pseudo-selectors to ensure cross-browser compatibility. Using a SASS mixin centralizes this logic and makes it easily reusable with customizable parameters. Syntax Following is the syntax to create a mixin in SASS − @mixin mixin-name($parameter1, $parameter2) { // CSS properties here property: $parameter1; } To use the mixin, ...

Read More

How to set caption for an image using HTML?

Shabaz Alam
Shabaz Alam
Updated on 16-Mar-2026 15K+ Views

HTML provides a semantic way to add captions to images using the and elements. Image captions enhance accessibility, provide context, and improve the overall user experience by offering descriptive text that explains or complements the visual content. Syntax Following is the basic syntax for creating image captions in HTML − Caption text here The element groups the image and caption together semantically, while contains the actual caption text. Basic Image Caption The element represents self-contained content, typically with ...

Read More

How to set date and time when the text was deleted using HTML?

Shabaz Alam
Shabaz Alam
Updated on 16-Mar-2026 231 Views

When creating web content, it's common to update text by removing outdated or incorrect information. HTML provides semantic elements to mark these changes while preserving a record of when modifications occurred. The del element and time element are the primary methods for tracking text deletions with timestamps. Syntax Following is the syntax for marking deleted text with a timestamp − deleted content The datetime attribute follows the ISO 8601 format, which includes date, time, and optionally timezone information. Following is the syntax for using the time element to display deletion timestamps − ...

Read More

HTML DOM Input Text type Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 278 Views

The HTML DOM Input Text type property is used to get or set the type attribute of an input text element. This property allows you to dynamically change the input type using JavaScript, which can be useful for creating adaptive forms or validating user input. Syntax Following is the syntax for returning the type value − inputTextObject.type Following is the syntax for setting the type value − inputTextObject.type = stringValue Parameters The stringValue parameter can be any valid HTML input type. Here are the common string values − ...

Read More

HTML DOM Input Time autofocus Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 143 Views

The HTML DOM Input Time autofocus property sets or returns whether a time input field should automatically get focus when the page loads. When set to true, the time input will be focused immediately upon page load, allowing users to start typing without clicking on the field first. Syntax Following is the syntax for getting the autofocus property value − inputTimeObject.autofocus Following is the syntax for setting the autofocus property − inputTimeObject.autofocus = booleanValue Return Value The autofocus property returns a boolean value indicating whether the time input has ...

Read More

HTML DOM Input Time defaultValue Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 412 Views

The HTML DOM Input Time defaultValue property sets or returns the default value of a time input field. This property represents the initial value specified in the HTML value attribute, which remains constant even when the user changes the input value. The key difference between value and defaultValue is that value changes as the user interacts with the input, while defaultValue always holds the original default value from the HTML markup. Syntax Following is the syntax for getting the default value − inputTimeObject.defaultValue Following is the syntax for setting the default value − ...

Read More

HTML DOM Input Time disabled Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 171 Views

The HTML DOM Input Time disabled property sets or returns whether a time input field is enabled or disabled. When an input time element is disabled, it becomes non-editable and appears grayed out, preventing user interaction. Syntax Following is the syntax for returning the disabled property − inputTimeObject.disabled Following is the syntax for setting the disabled property − inputTimeObject.disabled = booleanValue Parameters Here, booleanValue can be one of the following − Value Description true Disables the input time element (non-editable, grayed ...

Read More

How to set different background properties in one declaration?

Shabaz Alam
Shabaz Alam
Updated on 16-Mar-2026 393 Views

CSS (Cascading Style Sheets) provides a powerful background shorthand property that allows you to set multiple background properties in a single declaration. This approach is efficient for web developers as it saves time, reduces code length, and improves readability while maintaining full control over background styling. Understanding Background Properties Before using the background shorthand, it's important to understand the individual background properties available in CSS − background-color − Sets the background color of an element using color names, hex values, RGB, or HSL values. background-image − Sets a background image using URLs, linear gradients, or radial ...

Read More

How to set height of an iframe element using HTML?

Shabaz Alam
Shabaz Alam
Updated on 16-Mar-2026 2K+ Views

The iframe element is a powerful tool in HTML that allows web developers to embed external content into a web page. It creates a container that displays other HTML documents within a page. The default height of an iframe element does not always fit with the webpage's layout, so we need to ensure that it's sized correctly to fit seamlessly into the page layout. Understanding the Iframe Element Iframe stands for inline frame. It allows developers to embed content such as videos, maps, or social media feeds from another website or web page into the current page. The ...

Read More

How to create links to sections within the same page in HTML?

Aayush Mohan Sinha
Aayush Mohan Sinha
Updated on 16-Mar-2026 11K+ Views

Creating internal links within a web page in HTML improves user experience by allowing visitors to jump to specific sections without scrolling through the entire page. By using the id attribute and the tag, you can establish anchor links that provide quick navigation to different parts of your content. Syntax Following is the syntax for creating an element with an ID attribute − Content Following is the syntax for creating a link to that section − Link text ID Attribute The id attribute in HTML is used to ...

Read More
Showing 301–310 of 1,509 articles
« Prev 1 29 30 31 32 33 151 Next »
Advertisements