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 by Samual Sam
Page 44 of 151
Working with element for CSS
You can put your CSS rules into an HTML document using the element. This tag is placed inside ... tags. Rules defined using this syntax will be applied to all the elements available in the document. Syntax /* CSS rules go here */ selector { property: value; } Example Following is an example of embedded CSS ...
Read MoreHow to add comments in the style sheet blocks
You may need to put additional comments in your stylesheet blocks. Therefore, it is very easy to comment any part of the style sheet. You can simply put your comments inside /*...this is a comment in style sheet...*/. You can use /* ... */ to comment multi-line blocks in a similar way you do in C and C++ programming languages. Syntax /* Single-line comment */ /* Multi-line comment can span multiple lines */ Example: Adding Comments to CSS ...
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 MoreBootstrap Form select
A select dropdown is used when you want to allow users to pick from multiple options. By default, it only allows one selection, but can be configured for multiple selections. Use for list options with which users are familiar, such as states, countries, or categories. Use multiple attribute to allow users to select more than one option. Bootstrap's form-control class provides consistent styling across browsers. Basic Select Example Here's a simple Bootstrap form with a select dropdown: ...
Read MoreTypedArray.BYTES_PER_ELEMENT property in JavaScript
The BYTES_PER_ELEMENT property of TypedArrays represents the number of bytes each element occupies in memory. This static property helps determine the memory size of different typed array types. Syntax TypedArray.BYTES_PER_ELEMENT Where TypedArray can be any typed array constructor like Int8Array, Float32Array, etc. Example: Different TypedArray Sizes JavaScript Example var sizeOfFloat32Array = Float32Array.BYTES_PER_ELEMENT; document.write("Size of Float32Array element: " + sizeOfFloat32Array + " bytes"); ...
Read MoreIs there a way to add/remove several classes in one single instruction with classList in HTML and JavaScript?
The classList property returns the class names of an element as a DOMTokenList object. While it's read-only, you can modify it using methods like add() and remove(). The classList property automatically prevents duplicate classes from being added. You can add or remove multiple classes in a single instruction using several approaches. Using Multiple Parameters (ES6+) Modern browsers support passing multiple class names as separate parameters: Content const element = document.getElementById('myDiv'); // Add multiple classes element.classList.add('active', 'highlighted', 'primary'); console.log(element.className); // Remove multiple classes element.classList.remove('active', 'highlighted'); console.log(element.className); container active ...
Read MoreTypedArray.buffer property in JavaScript
The buffer property of TypedArray instances provides access to the underlying ArrayBuffer object that stores the binary data for the typed array. Syntax typedArray.buffer Return Value Returns the ArrayBuffer object that backs the TypedArray instance. Example JavaScript Example var buffer = new ArrayBuffer(156); var float32 = new Float32Array(buffer); document.write("Buffer byte length: " + float32.buffer.byteLength); ...
Read MoreTypedArray.byteOffset property in JavaScript
The byteOffset property of TypedArray returns the offset (in bytes) from the start of the ArrayBuffer where the typed array begins. Syntax typedArray.byteOffset Parameters This is a property, not a method, so it takes no parameters. Return Value Returns a number representing the byte offset from the beginning of the ArrayBuffer. Example 1: TypedArray at Buffer Start JavaScript byteOffset Example var buffer = new ArrayBuffer(16); ...
Read MoreStrange cursor placement in modal when using autofocus in Internet Explorer with HTML
Internet Explorer has a known issue where autofocused elements in fading modals cause strange cursor placement. The cursor may appear in unexpected positions or behave erratically when the modal opens. The Problem When using Bootstrap modals with the autofocus attribute on input elements, IE places the cursor incorrectly during the fade transition. This happens because IE handles CSS transitions and focus events differently than other browsers. Solution 1: Modify CSS Transition Override the default modal transition to use only opacity changes: .modal.fade { transition: opacity .3s linear; } ...
Read More