AmitDiwan

AmitDiwan

8,392 Articles Published

Articles by AmitDiwan

Page 240 of 840

How to create a responsive custom scrollbar using CSS?

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 665 Views

Custom scrollbars enhance the visual appeal of web pages by replacing the browser's default scrollbar with custom-styled alternatives. Using CSS webkit-scrollbar pseudo-elements, you can create responsive scrollbars that match your website's design theme and provide better user interaction feedback. Syntax The basic syntax for creating custom scrollbars uses webkit pseudo-elements − ::-webkit-scrollbar { width: 12px; } ::-webkit-scrollbar-track { background: #f1f1f1; } ::-webkit-scrollbar-thumb { background: #888; } ::-webkit-scrollbar-thumb:hover { background: #555; } Webkit Scrollbar Pseudo-Elements The following webkit pseudo-elements ...

Read More

HTML DOM Link type Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 172 Views

The HTML DOM Link type property sets or returns the MIME type of a linked document. This property corresponds to the type attribute of HTML elements and helps browsers understand how to handle the linked resource. Syntax Following is the syntax for getting the type property − linkObject.type Following is the syntax for setting the type property − linkObject.type = value Parameters The value parameter represents a string specifying the MIME type of the linked document. Common valid values include − text/css − For CSS stylesheets ...

Read More

HTML DOM Ol type Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 187 Views

The HTML DOM Ol type property sets or returns the value of the type attribute of an ordered list () element. This property determines the type of marker (numbering style) used for list items in an ordered list. Syntax Following is the syntax for returning the type property − olObject.type Following is the syntax for setting the type property − olObject.type = "1|a|A|i|I" Property Values The type property accepts the following values − Value Description Example "1" Default decimal numbers 1, ...

Read More

How to center a "position: absolute" element?

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 1K+ Views

Centering an element with position: absolute requires specific CSS techniques since absolutely positioned elements are removed from the normal document flow. There are several methods to achieve horizontal, vertical, or both types of centering for absolute elements. Understanding Absolute Positioning When an element has position: absolute, it is positioned relative to its nearest positioned ancestor (or the viewport if no positioned ancestor exists). The element's position is determined by the top, right, bottom, and left properties. Method 1: Using Negative Margins This traditional method requires knowing the exact dimensions of the element. You position the element ...

Read More

HTML DOM fullscreenEnabled() method

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 177 Views

The HTML DOM fullscreenEnabled property is a read-only boolean property that determines whether fullscreen mode is available for the current document. It returns true if fullscreen mode is supported and allowed, otherwise it returns false. This property is useful for checking fullscreen support before attempting to enter fullscreen mode, providing a better user experience by preventing errors when fullscreen functionality is not available. Syntax Following is the syntax for the fullscreenEnabled property − document.fullscreenEnabled Return Value The fullscreenEnabled property returns − true − If fullscreen mode is available and allowed ...

Read More

HTML DOM Time dateTime Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 137 Views

The HTML DOM Time dateTime property is used to get or set the datetime attribute of a element. This attribute provides a machine-readable format for dates and times, making content more accessible to browsers, search engines, and assistive technologies. Syntax Following is the syntax for getting the dateTime property − timeObject.dateTime Following is the syntax for setting the dateTime property − timeObject.dateTime = "YYYY-MM-DDThh:mm:ssTZD" DateTime Format Components The datetime value follows the ISO 8601 standard format. Here are the components of YYYY-MM-DDThh:mm:ssTZD − Component ...

Read More

HTML DOM Local Storage clear() method

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 369 Views

The HTML DOM Local Storage clear() method removes all key-value pairs from the localStorage object for the current domain. This method provides a quick way to empty the entire local storage without removing items individually. Syntax Following is the syntax for the localStorage clear() method − localStorage.clear() For sessionStorage, the syntax is − sessionStorage.clear() Parameters The clear() method does not accept any parameters. Return Value The method returns undefined and does not provide any return value. How It Works When localStorage.clear() is called, it removes ...

Read More

HTML DOM Button name Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 341 Views

The HTML DOM Button name property is associated with the name attribute of the element. The name property allows you to set or return the value of the name attribute of a button element. The name attribute is primarily used in forms to identify elements when submitting form data to the server and for accessing elements using JavaScript. Syntax Following is the syntax for setting the name property − buttonObject.name = "name" Following is the syntax for getting the name property − var name = buttonObject.name Here, name is ...

Read More

HTML onresize Event Attribute

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 173 Views

The HTML onresize attribute is an event handler that triggers when the user resizes the browser window. This attribute is primarily used with the element to detect window resize events and execute JavaScript functions in response to size changes. Syntax Following is the syntax for the onresize attribute − Where script is the JavaScript code or function to execute when the window is resized. Parameters The onresize attribute accepts a single parameter − script − JavaScript code or function call to execute when ...

Read More

HTML DOM Time Object

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 235 Views

The HTML DOM Time Object represents the element in the Document Object Model. This object provides properties and methods to interact with HTML time elements, allowing developers to access and manipulate datetime information programmatically. The element is used to represent a specific period in time, such as dates, times, or durations. It provides semantic meaning to temporal content and can be styled with CSS or manipulated with JavaScript. Syntax To create a Time object using JavaScript − var timeObject = document.createElement("TIME"); To access an existing time element − var ...

Read More
Showing 2391–2400 of 8,392 articles
« Prev 1 238 239 240 241 242 840 Next »
Advertisements