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
Articles on Trending Technologies
Technical articles with clear explanations and examples
Not showing a placeholder for input type="date" field with HTML5. How to solve it?
HTML5 date inputs do not natively display placeholder text because the browser's date picker interface takes precedence. However, there are several techniques to provide placeholder-like guidance for users before they interact with the date field. Why Date Inputs Don't Show Placeholders The placeholder attribute is ignored on input type="date" because browsers render a specialized date picker widget that replaces the normal text input behavior. This creates a consistent date selection experience but removes the ability to show custom placeholder text. Method 1: Dynamic Type Switching This approach starts with a text input showing the placeholder, then ...
Read MoreHow to draw a hollow circle in SVG?
To draw a hollow circle in SVG, use the element with fill="none" and define the outline using stroke properties. This creates a circle with only a border and transparent interior. SVG stands for Scalable Vector Graphics and is a language for describing 2D-graphics and graphical applications in XML. The XML is then rendered by an SVG viewer, and most web browsers can display SVG just like they display PNG, GIF, and JPG images. Syntax Following is the syntax for drawing a hollow circle in SVG − Parameters The element ...
Read MoreGet pixel color from canvas with HTML
To get the pixel color from a canvas element in HTML, you need to access the canvas pixel data using the getImageData() method. This method returns an ImageData object containing the RGBA values for each pixel, which you can then use to extract specific pixel colors. Syntax Following is the syntax to get pixel color from canvas − var imageData = context.getImageData(x, y, width, height); var data = imageData.data; var index = (Math.floor(y) * canvasWidth + Math.floor(x)) * 4; The getImageData() method returns an ImageData object with a data property containing pixel information in ...
Read MoreHTML disabled Attribute
The disabled attribute in HTML is used to disable form elements, making them unclickable and unselectable. When applied, the element becomes inactive and cannot be interacted with by users. This attribute is commonly used with form controls like buttons, input fields, select options, and option groups. Syntax Following is the syntax for the disabled attribute − Or with a value − Elements Supporting Disabled Attribute The disabled attribute can be applied to the following HTML elements − − Disables button elements − Disables ...
Read MoreHow to set cell width and height in HTML?
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 MoreHow can I display an image inside SVG circle in HTML5?
To display an image inside an SVG circle in HTML5, you use the element combined with a clipping path. The element defines the circular boundary, while the element displays the actual image content that gets clipped to the circle shape. Syntax Following is the basic syntax for creating a clipped circular image in SVG − ...
Read MoreHow to display deleted text in HTML?
The tag in HTML is used to display deleted text by marking it with a strikethrough. This semantic element indicates that the content has been removed from the document but is kept visible to show revision history or changes made to the content. Syntax Following is the syntax for the tag − Deleted text Attributes The tag supports the following specific attributes − Attribute Value Description cite URL Specifies a URL to a document that explains why the text was deleted. ...
Read MoreHow to draw circle in HTML page?
To draw a circle in HTML page, use SVG, HTML5 Canvas, or CSS. The most common approach is using CSS with the border-radius property set to 50% on a square element. SVG provides more control for complex graphics, while Canvas allows dynamic drawing with JavaScript. Using CSS Border-Radius The simplest method to create a circle is using CSS. Set equal width and height on an element, then apply border-radius: 50% to make it perfectly circular. Example − Basic CSS Circle CSS Circle ...
Read MoreHTML 5 versus XHTML 1.0 Transitional
HTML5 and XHTML 1.0 Transitional are two different markup standards with distinct syntactic rules and capabilities. HTML5 is the latest evolution of HTML, offering modern elements and relaxed syntax rules, while XHTML 1.0 Transitional is an XML-based reformulation of HTML 4.01 with stricter syntax requirements. Key Differences HTML5 is based on SGML principles but uses a more flexible parsing model, while XHTML 1.0 Transitional strictly follows XML syntax rules. XHTML requires well-formed markup with proper element nesting, quoted attributes, and self-closing tags for empty elements. HTML5 vs XHTML 1.0 Transitional ...
Read MorePrevent iPhone from zooming in web-app with HTML
When developing web applications for iPhones, users often experience unwanted zooming behavior that can disrupt the user experience. This zooming typically occurs when users tap on form inputs or when the viewport settings are not properly configured. There are several effective methods to prevent this behavior while maintaining accessibility. Understanding iPhone Zoom Behavior iPhones automatically zoom into form elements when the font size is smaller than 16px. This is a built-in accessibility feature designed to help users read small text, but it can be problematic for web applications that need consistent viewport behavior. Method 1: Using Viewport ...
Read More