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
How to get materialize CSS checkbox to work with @Html.CheckBoxFor?
When using Materialize CSS with ASP.NET MVC's Html.CheckBoxFor helper, you may encounter issues where checkboxes disappear or don't display properly. This happens because Html.CheckBoxFor generates both a visible checkbox and a hidden input field, which can interfere with Materialize CSS styling. The Problem The Html.CheckBoxFor helper in ASP.NET MVC automatically creates two input elements − A visible checkbox input A hidden input with the same name to ensure a value is always submitted This hidden input can cause Materialize CSS checkbox styling to break, making checkboxes appear misaligned or disappear entirely. Solution Using ...
Read MoreHTML5 Geolocation without SSL connection
HTML5 Geolocation allows web applications to access the user's location information through the browser's built-in geolocation API. While modern browsers typically require HTTPS for geolocation access, there are alternative approaches for non-SSL environments such as using IP-based location services or fallback methods. Browser Geolocation API The HTML5 Geolocation API provides access to the user's location through the navigator.geolocation object. This API requires user permission and works best over HTTPS connections. Syntax Following is the basic syntax for the geolocation API − navigator.geolocation.getCurrentPosition(successCallback, errorCallback, options); Example − Basic Geolocation ...
Read MoreHow to mark text superscript in HTML?
The tag in HTML is used to mark text as superscript, which appears raised above the normal line of text and is typically rendered in a smaller font size. This element is commonly used for mathematical expressions, footnote references, ordinal numbers, and chemical formulas. Syntax Following is the syntax for the superscript tag − superscript text The tag requires both opening and closing tags. The text content placed between these tags will be displayed as superscript. Basic Superscript Example Following example demonstrates basic usage of the tag for mathematical ...
Read MoreHow to store a name permanently using HTML5 Local Storage?
The Local Storage is designed for storage that spans multiple windows and lasts beyond the current session. In particular, Web applications may wish to store megabytes of user data, such as entire user-authored documents or a user's mailbox, on the client side for performance reasons. HTML5 localStorage saves string data in the browser and lasts beyond the current session. localStorage stores the data with no expiration, whereas sessionStorage is limited to the session only. When the browser is closed, the session is lost but localStorage data persists. The data won't get deleted when the browser is closed. Here, ...
Read MoreSolve unknown gap between elements in Flexbox with HTML5.
Unknown gaps between elements in flexbox containers often occur due to margin collapsing between adjacent elements, particularly when a header element's margin collapses with its sibling container. This creates unexpected whitespace that can disrupt your layout design. Understanding the Problem Margin collapsing happens when vertical margins of adjacent block elements combine into a single margin. In flexbox layouts, this commonly occurs between a header element and a container div, causing an unwanted gap that appears to come from nowhere. Margin Collapsing Issue Header with margin ...
Read MoreChoose which option is selected on pageload of razor Html.DropDownListFor() in HTML?
The Html.DropDownListFor() helper in Razor allows you to create dropdown lists bound to model properties. To control which option is selected on page load, you can use the Selected property of SelectListItem or rely on the model's property value to automatically determine the selection. Syntax Following is the basic syntax for Html.DropDownListFor() with preselected options − @Html.DropDownListFor(m => m.PropertyName, new List { new SelectListItem { Value = "value1", Text = "Text1", Selected = condition }, ...
Read MoreHow to use multiple click event on HTML5 canvas?
HTML5 canvas allows handling multiple click events by using Path2D objects to define different clickable regions. When a canvas contains multiple shapes or areas, each region can trigger different functions based on where the user clicks. The isPointInPath() method determines which specific path was clicked. Syntax Following is the syntax for creating Path2D objects − var path = new Path2D(); path.arc(x, y, radius, startAngle, endAngle); Following is the syntax for checking if a point is within a path − context.isPointInPath(path, x, y); How Multiple Click Events Work Multiple click ...
Read MoreHow to add an article in HTML5?
The article element is one of the new semantic sectioning elements introduced in HTML5. The tag represents a self-contained composition in a document, such as a blog post, news article, forum post, or any independent piece of content that makes sense on its own. The element is particularly useful for content syndication, as it identifies content that could be distributed independently from the rest of the page. Search engines and screen readers also use this semantic information to better understand page structure. Syntax Following is the syntax for the element in HTML5 − ...
Read MoreHTML5 Canvas and select / drag-and-drop features in a JS library?
HTML5 Canvas provides excellent drawing capabilities for creating shapes, text, and curves. However, by default, canvas elements don't support traditional DOM events like onClick or drag-and-drop functionality. To add interactive features like drag-and-drop to canvas-based graphics, developers often use JavaScript libraries that provide these capabilities. One popular solution is Raphael.js, a cross-browser vector graphics library that uses SVG for modern browsers and VML for older versions of Internet Explorer. This library allows you to create interactive vector graphics with built-in support for drag-and-drop events, touch events, and mouse interactions. How Raphael.js Works Raphael.js creates vector graphics that ...
Read MoreHow do we add glossary definitions in HTML?
The definition list in HTML is created using the tag to add glossary definitions and term-description pairs. A definition list consists of terms defined with (definition term) and their corresponding descriptions using (definition description) tags. Definition lists are ideal for glossaries, dictionaries, FAQs, and any content where you need to pair terms with their explanations or definitions. Syntax Following is the syntax for creating definition lists in HTML − Term 1 Description of term 1 Term 2 Description of ...
Read More