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 38 of 47
Usage of background-color property in CSS
The background-color property is used to set the background color of an element. It accepts color values in various formats including color names, hexadecimal, RGB, and HSL values. Syntax background-color: color | transparent | inherit | initial; Example: Using Color Names You can use predefined color names to set the background color: Background Color Example This text ...
Read MoreSet the Background Attachment with CSS
The background-attachment property controls whether a background image scrolls with the content or remains fixed in the viewport. This CSS property is useful for creating parallax effects or keeping decorative backgrounds stationary. Syntax background-attachment: value; Property Values Value Description scroll Background scrolls with content (default) fixed Background stays fixed in viewport local Background scrolls with element's content Example: Fixed Background This example demonstrates a fixed background that remains stationary while content scrolls: ...
Read MoreUsage of background property in CSS
The background property in CSS is a shorthand property that allows you to set multiple background-related properties in a single declaration. It can include background color, image, position, size, repeat behavior, and attachment. Syntax background: [color] [image] [repeat] [attachment] [position] / [size]; Individual Background Properties The background shorthand can include any combination of these properties: background-color - Sets the background color background-image - Sets the background image background-repeat - Controls image repetition background-attachment - Controls scrolling ...
Read MoreIncrease or decrease the size of a font with CSS
The font-size property in CSS controls the size of text elements. You can use various units and keywords to set font sizes, from absolute values like pixels to relative keywords like "small" and "large". Syntax font-size: value; Available Values The font-size property accepts several types of values: Absolute keywords: xx-small, x-small, small, medium, large, x-large, xx-large Relative keywords: smaller, larger Length units: pixels (px), points (pt), ems (em), rems (rem) Percentage: relative to parent element's font size Example: ...
Read MoreShorthand property to set the font with CSS
The CSS font property is a shorthand that allows you to set multiple font-related properties in a single declaration, including font style, variant, weight, size, line-height, and family. Syntax font: [font-style] [font-variant] [font-weight] font-size[/line-height] font-family; The font-size and font-family values are required, while other properties are optional. Example Here's how to use the font shorthand property to apply multiple font styles at once: .shorthand-example ...
Read MoreUsage of font-family property in CSS
The font-family property in CSS specifies the typeface or font family to be used for displaying text. It accepts a prioritized list of font names, allowing fallback options if the preferred font is not available on the user's system. Syntax font-family: "font-name", fallback1, fallback2, generic-family; Font Family Categories CSS defines five generic font families: serif - Fonts with decorative strokes (Times, Georgia) sans-serif - Clean fonts without strokes (Arial, Helvetica) monospace - Fixed-width fonts (Courier, Monaco) cursive - Script-like fonts (Comic Sans, Brush Script) fantasy - Decorative display fonts (Impact, Papyrus) ...
Read MoreUsage of font-variant property in CSS
The CSS font-variant property controls typographic variations of text, primarily creating small-caps effects where lowercase letters appear as smaller uppercase letters. Syntax font-variant: normal | small-caps | initial | inherit; Values normal - Default value, displays text normally small-caps - Converts lowercase letters to smaller uppercase letters initial - Sets to default value inherit - Inherits from parent element Example: Small Caps Effect .normal-text { ...
Read MoreIndent the text of a paragraph with CSS
The text-indent property is used to indent the first line of text in a paragraph or block-level element. This creates a traditional paragraph indentation effect commonly seen in books and formal documents. Syntax text-indent: value; Possible Values Length units: px, em, rem, cm, mm, in, pt Percentage: % (relative to parent element's width) Keywords: inherit, initial, unset Example: Basic Text Indentation Here's how to implement text indentation using different measurement units: ...
Read MoreAlign the text of a paragraph with CSS
To align and control the positioning of text within a paragraph, CSS provides several properties including text-align for horizontal alignment and text-indent for first-line indentation. Text Alignment Properties The main CSS properties for text alignment are: text-align - Controls horizontal alignment (left, right, center, justify) text-indent - Indents the first line of a paragraph Using text-align Property .left { text-align: left; } .center { text-align: center; } ...
Read MoreCapitalize text with CSS
To capitalize text in CSS, use the text-transform property with the capitalize value. This property transforms the first letter of each word to uppercase while keeping the rest lowercase. Syntax text-transform: capitalize; Basic Example Here's how to capitalize text using CSS: hello world from india Hello World From ...
Read More