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
Front End Scripts Articles
Page 37 of 47
HTML5 & JavaScript: resolution or size of
HTML5 provides two approaches for capturing photos from mobile devices with different levels of control over image resolution and size. HTML Media Capture The simplest approach uses HTML's capture attribute with accept="image/*" on input elements to access the device camera. HTML Media Capture Capture Photo with HTML document.getElementById('camera').addEventListener('change', function(e) { ...
Read MoreHow to use FastClick with jQuery Mobile the right way in HTML?
FastClick is a library that eliminates the 300ms delay on mobile browsers for touch events. However, jQuery Mobile provides a built-in solution with the vclick event that handles this automatically. The Problem with Mobile Touch Delays Mobile browsers introduce a 300ms delay between a touch event and the click event to detect double-taps. This creates a sluggish user experience on mobile web applications. jQuery Mobile's Built-in Solution jQuery Mobile includes virtual events like vclick that provide immediate response without the 300ms delay. This eliminates the need for external libraries like FastClick. Using vclick Event ...
Read MoreComparison of CSS versions
Cascading Style Sheets (CSS) has evolved significantly since its inception. Understanding the differences between CSS versions helps developers choose the right features for their projects and maintain browser compatibility. CSS1 (1996) CSS1 became a W3C recommendation in December 1996. This initial version introduced the fundamental CSS language and a basic visual formatting model for HTML elements. It provided essential styling capabilities like fonts, colors, margins, and borders. CSS2 (1998) CSS2 became a W3C recommendation in May 1998, building upon CSS1 with significant enhancements: Media-specific style sheets for printers and aural devices Downloadable fonts support ...
Read MoreType Selectors in CSS
Type selectors in CSS target HTML elements directly by their tag names. They are the most basic form of CSS selectors and apply styles to all instances of a specific HTML element throughout the document. Syntax element { property: value; } Where element is any valid HTML tag name like h1, p, div, span, etc. Example: Styling Headings h1 { ...
Read MoreDescendent Selectors in CSS
CSS descendant selectors allow you to apply styles to elements that are nested inside other elements. This targeting method helps create specific styling rules without affecting similar elements elsewhere on the page. Syntax ancestor descendant { property: value; } The descendant selector uses a space between two selectors to target elements that are children, grandchildren, or any level deep within the ancestor element. Example: Styling Emphasized Text in Lists Apply yellow color to elements only when they appear inside tags: ul ...
Read MoreHow to define multiple style rules for a single element in CSS?
You may need to define multiple style rules for a single element. You can define these rules to combine multiple properties and corresponding values into a single block as defined in the following example: h1 { color: #36C; font-weight: normal; letter-spacing: .4em; ...
Read MoreWorking with Inline CSS
Inline CSS allows you to apply styles directly to HTML elements using the style attribute. This method applies styles to individual elements only, making it useful for quick styling or element-specific customizations. Syntax You can use the style attribute on any HTML element to define inline style rules: Style Attribute Attribute Value ...
Read MoreWhat are the ways to include style sheet rules in an HTML document
There are three main ways to include CSS styles in an HTML document: inline styles using the style attribute, internal stylesheets using the element, and external stylesheets using the element. Method 1: Inline Styles Inline styles are applied directly to HTML elements using the style attribute: Inline Styles Example Inline Styled Heading This paragraph has inline styles. Method 2: Internal Stylesheets Internal stylesheets are defined within the element in the document's ...
Read MoreWhat is pica? How to set the font size in CSS using pica?
A pica is a CSS unit of measurement primarily used in print design. One pica equals 12 points, and there are 6 picas per inch (1pc = 12pt = 1/6 inch). The pica unit is specified using "pc" in CSS. Understanding Pica Units Picas are absolute units like pixels, but they're based on traditional typography measurements: 1 pica = 12 points 6 picas = 1 inch 1pc ≈ 16 pixels (at 96 DPI) Syntax font-size: value pc; /* Examples */ font-size: 1pc; /* 12 points */ font-size: 2.5pc; ...
Read MoreWhich property is used in CSS to control the repetition of an image in the background?
To control the repetition of an image in the background, use the background-repeat property. You can use no-repeat value for the background-repeat property if you do not want to repeat an image, in this case, the image will display only once. Syntax background-repeat: repeat | repeat-x | repeat-y | no-repeat | space | round; Common Values Value Description repeat Repeats both horizontally and vertically (default) repeat-x Repeats horizontally only repeat-y Repeats vertically only no-repeat Displays image only once Example: Basic Background ...
Read More