How to specify that the styles only apply to this element's parent element and that element's child elements in HTML?

seetha
Updated on 16-Mar-2026 21:38:53

328 Views

The scoped attribute was an HTML5 feature designed to limit CSS styles to only apply within a specific parent element and its child elements. However, this attribute was removed from the HTML specification and is no longer supported by modern browsers. Syntax The original syntax for the scoped attribute was − /* CSS rules here would only apply to parent and children */ Why Scoped Was Removed The scoped attribute was removed from HTML5 due to implementation complexity and lack of browser support. Only Firefox provided partial support, ... Read More

HTML DOM Input Number min Property

Sharon Christine
Updated on 16-Mar-2026 21:38:53

183 Views

The HTML DOM Input Number min property gets and sets the value of the min attribute of a number input field. This property defines the minimum value that can be entered in a number input element, providing client-side validation for numeric inputs. Syntax Following is the syntax for returning the min value − object.min Following is the syntax for setting the min value − object.min = "number" Parameters number − A string or numeric value representing the minimum allowed value for the input field. ... Read More

Create a shortcut key to activate an element in HTML

Yaswanth Varma
Updated on 16-Mar-2026 21:38:53

3K+ Views

The accesskey attribute in HTML allows you to create keyboard shortcuts for activating elements like links, buttons, and form controls. This global attribute enhances web accessibility and provides quick navigation options for users. The accesskey attribute accepts a single character value that, when combined with browser-specific modifier keys, activates the associated element. This feature is particularly useful for improving website usability and accessibility. Syntax Following is the syntax for the accesskey attribute − Content The character value must be a single printable character that can be typed on a keyboard, including letters, numbers, ... Read More

How do we specify whether a header cell is a header for a column, row, or group of columns or rows in HTML?

Ankitha Reddy
Updated on 16-Mar-2026 21:38:53

171 Views

The scope attribute in HTML specifies whether a header cell () is a header for a column, row, or group of columns or rows. This attribute improves table accessibility by helping screen readers understand the relationship between header cells and data cells. Syntax Following is the syntax for the scope attribute − Header Content The value can be col, row, colgroup, or rowgroup. Scope Attribute Values The scope attribute accepts the following values − col − Specifies that the header cell is a header for a column. row − Specifies ... Read More

How to specify that an option should be pre-selected when the page loads in HTML?

Jennifer Nicholas
Updated on 16-Mar-2026 21:38:53

219 Views

Use the selected attribute to specify that an option should be pre-selected when the page loads in HTML. The selected attribute is a boolean attribute that, when present on an element within a dropdown, makes that option the default choice displayed to users. Syntax Following is the syntax for the selected attribute − Option Text The selected attribute can also be written in XHTML format as selected="selected", but in HTML5, the boolean form is preferred. How It Works When the browser loads a page containing a element, it looks ... Read More

HTML data Attribute

George John
Updated on 16-Mar-2026 21:38:53

172 Views

The data attribute of the element specifies the URL of the resource to be embedded in the web page. This resource can be various file types including audio, video, PDF documents, Flash files, images, or other multimedia content. Syntax Following is the syntax for the data attribute − Here, url is the absolute or relative URL of the resource to be embedded by the object element. Parameters The data attribute accepts a single parameter − url − A string that specifies the URL of the resource. This can ... Read More

How to add an address element in HTML?

Yaswanth Varma
Updated on 16-Mar-2026 21:38:53

1K+ Views

The address element in HTML represents contact information for a person, organization, or article. It provides semantic meaning to contact details and helps search engines and assistive technologies understand the purpose of the content. When used within the element, it represents contact information for the entire document. When placed inside an element, it represents contact information specific to that article. The element accepts all global attributes and is typically displayed in italics by default in most browsers. Syntax Following is the syntax for the address element − Contact ... Read More

Set the shape of the area in HTML

mkotla
Updated on 16-Mar-2026 21:38:53

224 Views

The shape attribute in HTML defines the clickable area's geometry within an image map. It works with the element to create interactive regions on images that users can click to navigate to different links. Syntax Following is the syntax for the shape attribute − The shape attribute accepts four possible values: rect, circle, poly, and default. Each shape type requires specific coordinate formats. Shape Values and Coordinates The following table shows the valid shape values and their coordinate requirements − Shape Value Coordinates Format Description ... Read More

HTML DOM Select Object

karthikeya Boyini
Updated on 16-Mar-2026 21:38:53

349 Views

The HTML DOM select object represents the element in an HTML document. This object provides properties and methods to dynamically create, manipulate, and interact with dropdown lists using JavaScript. Syntax To create a new select element using JavaScript − document.createElement("SELECT"); To access an existing select element − document.getElementById("selectId"); document.getElementsByTagName("select")[0]; document.querySelector("select"); Properties Following are the key properties of the select object − Property Description autofocus Returns or sets whether the dropdown should automatically get focus when the page loads. ... Read More

How to set text direction in HTML?

Lokesh Badavath
Updated on 16-Mar-2026 21:38:53

3K+ Views

Text direction in HTML controls how text flows within elements. The direction property specifies whether text reads from left-to-right (LTR) or right-to-left (RTL). This is essential for multilingual websites and proper display of languages like Arabic, Hebrew, or Persian. We can set text direction using the CSS direction property through inline styles, internal stylesheets, or external CSS files. The direction property affects the text flow, alignment, and even the positioning of UI elements within the container. Syntax Following is the syntax for setting text direction using the CSS direction property − direction: ltr | rtl ... Read More

Advertisements