Web Development Articles

Page 392 of 801

Set the Background Attachment with CSS

Ramu Prasad
Ramu Prasad
Updated on 15-Mar-2026 139 Views

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 More

Usage of background property in CSS

Sreemaha
Sreemaha
Updated on 15-Mar-2026 128 Views

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 More

Increase or decrease the size of a font with CSS

Nikitha N
Nikitha N
Updated on 15-Mar-2026 721 Views

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 More

Shorthand property to set the font with CSS

Priya Pallavi
Priya Pallavi
Updated on 15-Mar-2026 279 Views

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 More

Usage of font-family property in CSS

seetha
seetha
Updated on 15-Mar-2026 221 Views

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 More

Usage of font-variant property in CSS

Sreemaha
Sreemaha
Updated on 15-Mar-2026 93 Views

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 More

Indent the text of a paragraph with CSS

Samual Sam
Samual Sam
Updated on 15-Mar-2026 326 Views

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 More

Align the text of a paragraph with CSS

Abhinanda Shri
Abhinanda Shri
Updated on 15-Mar-2026 543 Views

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 More

Capitalize text with CSS

V Jyothi
V Jyothi
Updated on 15-Mar-2026 1K+ Views

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

Usage of white-space property in CSS

radhakrishna
radhakrishna
Updated on 15-Mar-2026 108 Views

The CSS white-space property controls how whitespace characters (spaces, tabs, line breaks) are handled within an element. It determines whether text wraps, how spaces are collapsed, and whether line breaks are preserved. Syntax white-space: normal | nowrap | pre | pre-wrap | pre-line | break-spaces; White-space Values Value Spaces Collapsed? Line Breaks Honored? Text Wraps? normal Yes No Yes nowrap Yes No No pre No Yes No pre-wrap No Yes Yes pre-line Yes Yes Yes Example: Using white-space: pre ...

Read More
Showing 3911–3920 of 8,010 articles
« Prev 1 390 391 392 393 394 801 Next »
Advertisements