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 13 of 47
What should be done with the left/ right edges of the content on overflow with JavaScript?
When content overflows horizontally in a container, the overflowX property controls how the left and right edges are handled. This property allows you to add horizontal scrolling, hide overflow, or make it visible. Syntax element.style.overflowX = "value"; Common overflowX Values Value Description Use Case scroll Always shows horizontal scrollbar ...
Read MoreUsage of text-transform property in CSS
The text-transform property in CSS is used to control the capitalization of text content. It allows you to transform text to uppercase, lowercase, capitalize first letters, or leave it unchanged. Syntax text-transform: value; Property Values Value Description none No transformation (default) capitalize Capitalizes the first letter of each word uppercase Converts all text to uppercase lowercase Converts all text to lowercase Example Text Transform Example ...
Read MoreExample of embedded CSS
Embedded CSS allows you to place CSS rules directly within an HTML document using the element. This tag is placed inside the section, and the rules defined will apply to all elements in the document. Syntax /* CSS rules go here */ selector { property: value; } ...
Read MoreWorking 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 use style attribute to define style rules?
The style attribute allows you to apply CSS rules directly to individual HTML elements. This is called inline CSS and provides element-specific styling with the highest specificity. Syntax Content Example: Basic Inline Styling Inline CSS Example This is inline CSS Styled div with multiple properties Example: Multiple Style Properties ...
Read MoreIncluding an external stylesheet file in your HTML document
The element can be used to include an external style sheet file in your HTML document. An external style sheet is a separate text file with .css extension. You define all the Style rules within this text file and then you can include this file in any HTML document using element. Creating an External CSS File Consider a simple style sheet file with a name new.css having the following rules: h1, h2, h3 { color: #36C; font-weight: normal; letter-spacing: .4em; ...
Read MoreRules to override Style Sheet Rule in CSS
CSS follows a specific hierarchy when multiple styles are applied to the same element. Understanding the cascade and specificity rules helps you control which styles take precedence. CSS Cascade Priority Order CSS applies styles based on the following priority order, from highest to lowest: Inline styles - Styles applied directly to HTML elements using the style attribute Internal stylesheets - Styles defined within tags in the HTML document External stylesheets - Styles defined in separate CSS files linked to the HTML document Example: Style Override Hierarchy ...
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 MoreWhich Measurement Unit should be used in CSS to set letter spacing
To set letter spacing with CSS, use the em measurement unit for most cases, though other units like px and rem are also available depending on your needs. The em unit is a relative measurement based on the font size of the current element. Because an em unit equals the size of the current font, if you assign a font to 12pt, each "em" unit would be 12pt; thus, 2em would be 24pt. Why Use em for Letter Spacing? Using em units makes letter spacing responsive and proportional to the font size. When the font size changes, ...
Read MoreHow to set font size using CSS Measurement Unit vmin?
The vmin CSS unit sets font size based on the smaller dimension of the viewport (width or height). It's useful for creating responsive text that scales with screen size. What is vmin? The vmin unit represents 1% of the viewport's smaller dimension. If the viewport is 800px wide and 600px tall, 1vmin = 6px (1% of 600px). Syntax font-size: [number]vmin; Example vmin Font Size Example ...
Read More