Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
HTML Articles
Page 113 of 151
How to add a layer in HTML?
The concept of layers in HTML refers to creating overlapping elements that can be positioned and stacked on top of each other. While the obsolete tag was once used for this purpose, modern HTML uses elements with CSS positioning and z-index properties to create layered content. Important Note: The tag is deprecated and not supported in modern browsers. It was a Netscape-specific element that never became part of the HTML standard. Instead, we use CSS positioning with elements to achieve layering effects. Modern Approach: Creating Layers with CSS To create layers in modern ...
Read MoreHow to add a resource reference in HTML?
In HTML, the tag is used to add a resource reference. The link defines the relationship between the external document and current document. It is an empty element that only contains attributes and must be placed within the section of an HTML document. The tag is commonly used to link external style sheets, add favicons to websites, preload resources, and establish relationships with other documents. The tag consists of various attribute values that define the type and location of the referenced resource. Syntax Following is the basic syntax for the tag − ...
Read MoreDefine a scalar measurement within a known range in HTML
To define a scalar measurement within a known range or a fractional value, we use the tag in HTML. The tag represents a gauge that displays a value within a specific range, commonly used for disk usage, quiz scores, battery levels, or relevance of query results. The tag is not used to indicate progress bars. If you want to show progress or completion, use the tag instead. For best accessibility, it's recommended to use a tag or provide fallback text between the opening and closing tags. Syntax Following is the syntax ...
Read MoreHow to allow no breaks in the enclosed text in HTML?
To prevent line breaks in enclosed text in HTML, the tag was traditionally used to force content onto a single line regardless of length. However, this tag is deprecated and not supported in HTML5. Modern HTML uses CSS properties like white-space: nowrap to achieve the same result with better standards compliance. Syntax Following is the deprecated syntax for the tag − Text content Following is the modern CSS approach − white-space: nowrap; The Deprecated Tag The HTML tag instructed browsers not to break the specified ...
Read MoreCreate a selectable list in HTML
The tag is used to create a drop-down list in HTML. A selectable list allows users to choose one or more options from a predefined set of values. By adding the multiple attribute to the element, users can select multiple options by holding the Ctrl key (Windows) or Cmd key (Mac) while clicking. Syntax Following is the basic syntax for creating a selectable list − Option Text 1 Option Text 2 To create a multiple selection list, add the multiple attribute − ...
Read MoreHow to display ruby annotation in HTML5?
Ruby annotations in HTML5 provide a way to display small text above, below, or alongside base text, primarily used for pronunciation guides in East Asian languages. The ruby element works together with rt (ruby text) and rp (ruby parentheses) elements to create readable annotations. Syntax Following is the basic syntax for ruby annotations − base text annotation text With fallback parentheses for unsupported browsers − base text (annotation text) Ruby Elements The ruby annotation system consists of three main ...
Read MoreHow to set table width in HTML?
Setting table width in HTML controls how much horizontal space the table occupies on a web page. You can set table width using the inline style attribute with the width CSS property. The width can be specified in percentage (relative to parent container) or pixels (fixed width). Syntax Following is the syntax to set table width using inline styles − The width value can be specified as − Percentage − width: 50% (relative to container width) Pixels − width: 400px (fixed width) Keywords − width: 100% ...
Read MoreHow to create an unordered list without bullets in HTML?
An unordered list in HTML displays a list of items marked with bullets (•), circles, discs, or squares by default. The tag creates an unordered list, and each list item is defined using the tag. However, sometimes you need to display a list without any bullets for cleaner presentation or custom styling. To remove bullets from an unordered list, you can use the CSS list-style-type property set to none. This property controls the appearance of list item markers and can be applied inline or through external CSS. Syntax Following is the syntax to create an ...
Read MoreWhat is the difference between novalidate and formnovalidate attributes?
The novalidate and formnovalidate attributes are HTML5 attributes used to bypass form validation. The novalidate attribute is applied to the element to disable validation for the entire form, while formnovalidate is applied to individual submit buttons to override form validation on a per-button basis. Both attributes are Boolean attributes, meaning their presence enables the functionality regardless of their value. These attributes are particularly useful when you want to allow users to save form progress or submit incomplete forms in certain scenarios. Syntax Following is the syntax for the novalidate attribute − ...
Read MoreHTML5 canvas ctx.fillText won\'t do line breaks
The fillText() method in HTML5 Canvas draws filled text but does not automatically handle line breaks. When you include newline characters () in your text string, they are ignored and the text appears as a single line. To create line breaks, you must manually split the text and call fillText() multiple times for each line. Syntax Following is the syntax for the fillText() method − context.fillText(text, x, y, maxWidth); To create line breaks, split the text and draw each line separately − var lines = text.split(''); for (var i = 0; i ...
Read More