# background-image

Published articles for background-image.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## CSS radial-gradient(): Syntax and Examples

DevFeed: [CSS radial-gradient(): Syntax and Examples](<https://devfeed.tech/articles/css-radial-gradient-syntax-and-examples-98737.md>)

Original publisher: [Read original article](<https://markodenic.com/radial-gradient-css/>)

Author: Marko

Published: 2026-10-24T09:00:00Z

Content type: article

Language: en

Sources: [Marko Denic Blog](<https://devfeed.tech/sources/marko-denic-blog.md>)

Topics: [CSS](<https://devfeed.tech/topics/css.md>)

Tags: [animate](<https://devfeed.tech/tags/animate.md>), [background](<https://devfeed.tech/tags/background.md>), [background-image](<https://devfeed.tech/tags/background-image.md>), [background-size](<https://devfeed.tech/tags/background-size.md>), [calc](<https://devfeed.tech/tags/calc.md>), [circle](<https://devfeed.tech/tags/circle.md>), [color](<https://devfeed.tech/tags/color.md>), [conic-gradient](<https://devfeed.tech/tags/conic-gradient.md>), [css](<https://devfeed.tech/tags/css.md>), [css-gradients](<https://devfeed.tech/tags/css-gradients.md>), [dots](<https://devfeed.tech/tags/dots.md>), [examples](<https://devfeed.tech/tags/examples.md>), [faq](<https://devfeed.tech/tags/faq.md>), [glow](<https://devfeed.tech/tags/glow.md>), [gradient](<https://devfeed.tech/tags/gradient.md>), [gradient-generator](<https://devfeed.tech/tags/gradient-generator.md>), [pattern](<https://devfeed.tech/tags/pattern.md>), [position](<https://devfeed.tech/tags/position.md>), [size](<https://devfeed.tech/tags/size.md>), [syntax](<https://devfeed.tech/tags/syntax.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>), [web-development](<https://devfeed.tech/tags/web-development.md>)

### AI overview

CSS `radial-gradient()` creates an image whose colors spread outward from a point, usable in `background` or `background-image`. Its default is a centered ellipse reaching the farthest corner; choose `circle` to keep it round, size it with edge-based keywords or lengths, and move its center with `at` plus keywords, percentages, or lengths. Color stops can blend smoothly or share a position for a hard edge; a small gap between hard stops can reduce jagged edges. Examples show layered glows and photo vignettes, repeated dot patterns using `background-size`, and outward rings with `repeating-radial-gradient()`. The article says gradients themselves are not directly animatable, suggesting animation of background position or size, or a registered custom property inside the gradient.

### Source excerpt

How CSS radial-gradient() works: circle vs ellipse, size keywords, position, color stops, repeating gradients, and copy-paste examples for glows, spotlights, dot patterns and vignettes.

## CSS random()

DevFeed: [CSS random()](<https://devfeed.tech/articles/css-random-20774.md>)

Original publisher: [Read original article](<https://erikrunyon.com/2025/10/css-random/>)

Author: Erik Runyon

Published: 2025-10-08T00:00:00Z

Content type: article

Language: en

Sources: [Erik Runyon](<https://devfeed.tech/sources/erik-runyon.md>)

Topics: [CSS](<https://devfeed.tech/topics/css.md>), [Front end](<https://devfeed.tech/topics/frontend.md>), [Web Development](<https://devfeed.tech/topics/web-development.md>), [Image](<https://devfeed.tech/topics/image.md>)

Tags: [background-image](<https://devfeed.tech/tags/background-image.md>), [color](<https://devfeed.tech/tags/color.md>), [css](<https://devfeed.tech/tags/css.md>), [image](<https://devfeed.tech/tags/image.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [none](<https://devfeed.tech/tags/none.md>), [nth-child](<https://devfeed.tech/tags/nth-child.md>), [random](<https://devfeed.tech/tags/random.md>), [safari](<https://devfeed.tech/tags/safari.md>), [selectors](<https://devfeed.tech/tags/selectors.md>), [text](<https://devfeed.tech/tags/text.md>), [urls](<https://devfeed.tech/tags/urls.md>), [use-cases](<https://devfeed.tech/tags/use-cases.md>), [web-development](<https://devfeed.tech/tags/web-development.md>), [webkit](<https://devfeed.tech/tags/webkit.md>)

### AI overview

Safari's WebKit-only CSS random() function can generate values in numeric or color contexts, but the excerpt says it cannot replace most uses of JavaScript's Math.random(). Its form is random(min, max, step), with an optional step restricting possible values; for example, random(50px, 200px, 50px) yields values in multiples of 50. It cannot currently select elements with selectors such as :nth-child or build strings for URLs, text, or an ::after value. The author's desired uses--choosing a random item from a collection, selecting random images, and displaying a random number for a dice roller--therefore remain unsupported in CSS as described.

### Source excerpt

Safari recently implemented a non-standard (yet?) CSS random() function (currently only in WebKit, and not yet part of any CSS specification). Since many recent CSS features are directly aimed at replacing common JavaScript functionality, I expected this function to do the same. While it has some neat use cases, it doesn't cover most of the scenarios where I currently use JavaScript's Math.random(). What it does The basic format of the function follows the pattern "random(min, max, step)". For instance, if you want to assign an element a random height between 50px and 200px, you would use "height: random(50px, 200px)". You can also include a "step" value like so "height: random(50px, 200px, 50px)" where the values will always be a multiple of 50. You can see more examples on the WebKit post "Rolling the Dice with CSS random()" and Frontend Masters "Very Early Playing with random() in CSS". What it doesn't Currently, random() can only be used in numeric or color contexts -- not in selectors or string values like URLs or text content. I have two primary use cases, and one just for fun. All three are marked-up as I would expect to use them if they were supported in the CodePen below. Random items from a collection A common pattern on many Notre Dame sites would be to show a random item from a collection. These could be content such as faculty spotlights, recent publications, or student profiles. We always know how many we're choosing from, and they're always contained to a specific section. So being able to use CSS to show a random child using ":nth-child" would be fantastic. Random images Less common is showing random images. This could be in a feature area on the homepage, or even a decorative background image. This would require the ability to concatenate a string with the random number. Random numbers A "just for fun" feature would be displaying the value from the random() function. My initial thought would be a CSS only dice roller. The demo in the pen would requir

## Day 41: custom properties and url()s

DevFeed: [Day 41: custom properties and url()s](<https://devfeed.tech/articles/day-41-custom-properties-and-url-s-52210.md>)

Original publisher: [Read original article](<https://www.matuzo.at/blog/2022/100daysof-day41>)

Author: Manuel Matuzović

Published: 2022-11-21T00:00:00Z

Content type: tutorial

Language: en

Sources: [Manuel Matuzović](<https://devfeed.tech/sources/manuel-matuzovic-blog.md>)

Topics: [CSS](<https://devfeed.tech/topics/css.md>), [Web Development](<https://devfeed.tech/topics/web-development.md>), [properties](<https://devfeed.tech/topics/properties.md>), [function](<https://devfeed.tech/topics/function.md>)

Tags: [aria](<https://devfeed.tech/tags/aria.md>), [background-image](<https://devfeed.tech/tags/background-image.md>), [css](<https://devfeed.tech/tags/css.md>), [custom-properties](<https://devfeed.tech/tags/custom-properties.md>), [function](<https://devfeed.tech/tags/function.md>), [svg](<https://devfeed.tech/tags/svg.md>)

### AI overview

A CSS tutorial explaining why using a custom property inside an unquoted url() function can produce invalid characters, and showing how to place the url() function inside the custom property instead.

### Source excerpt

Let's say you want to swap the background image of an element based on a certain condition, like whether it's pressed, using custom properties. button { --background-image: "/not-pressed.svg"; background: url(var(--background-image)); } button[aria-pressed="true"] { --background-image: "/pressed.svg"; } This looks fine, but it doesn't work because var(--background-image) contains invalid characters. The reason the argument is invalid is that url() works both with quotes url("image.svg") or url('image.svg') and without quotes url(image.svg). By passing a value without quotes you're not passing a string to a CSS function, but you're creating an url-token and this token expects a certain format that requires characters like ( to be escaped. That's a very abbreviated explanation. For details, please read "Why custom properties don't work with the url() CSS function" by the amazing Stefan Judis. To work around that issue, you have to move the url() function into the value of the custom property. button { --background-image: url("/not-pressed.svg"); background: var(--background-image); } button[aria-pressed="true"] { --background-image: url("/pressed.svg"); } My blog doesn't support comments yet, but you can reply via blog@matuzo.at.

## Day 24: the backdrop-filter property

DevFeed: [Day 24: the backdrop-filter property](<https://devfeed.tech/articles/day-24-the-backdrop-filter-property-52191.md>)

Original publisher: [Read original article](<https://www.matuzo.at/blog/2022/100daysof-day24>)

Author: Manuel Matuzović

Published: 2022-10-27T00:00:00Z

Content type: tutorial

Language: en

Sources: [Manuel Matuzović](<https://devfeed.tech/sources/manuel-matuzovic-blog.md>)

Topics: [CSS](<https://devfeed.tech/topics/css.md>), [dialog](<https://devfeed.tech/topics/dialog.md>)

Tags: [background-image](<https://devfeed.tech/tags/background-image.md>), [css](<https://devfeed.tech/tags/css.md>), [dialog](<https://devfeed.tech/tags/dialog.md>), [filter](<https://devfeed.tech/tags/filter.md>), [property](<https://devfeed.tech/tags/property.md>)

### AI overview

A tutorial explaining the CSS backdrop-filter property, including how it filters the area behind an element or dialog and how it differs from filter.

### Source excerpt

The backdrop-filter property allows you to apply CSS filters to the area behind an element. This could be the background of an element or the backdrop of a dialog. In the following example, the parent element has a background image, nothing special about it, but the inner elements all have a backdrop-filter applied which changes how the image beneath them is displayed. <div class="parent"> <div class="blur">Blur</div> <div class="invert">Invert</div> <div class="hue">Hue</div> <div class="grayscale">Grayscale</div> </div> .parent { background-image: url("/images/neue-donau.webp"); } .blur { backdrop-filter: blur(5px); } .invert { backdrop-filter: invert(1); } .hue { backdrop-filter: hue-rotate(260deg); } .grayscale { backdrop-filter: grayscale(100%); } Blur Invert Hue Grayscale Notice how the filters don't affect the text? Yeah, that's the difference between backdrop-filter and filter. They both take the same values, but backdrop-filters only apply to the backdrop/background. In order for this to work the background of the element with the backdrop filter must either be fully or partially transparent. You can also apply the filter to the backdrop of a dialog. dialog::backdrop { backdrop-filter: blur(5px); } yo! close show modal PS: Thanks Kilian for the pointer! My blog doesn't support comments yet, but you can reply via blog@matuzo.at.

## How to set a React Component or dom element as a background image

DevFeed: [How to set a React Component or dom element as a background image](<https://devfeed.tech/articles/how-to-set-a-react-component-or-dom-element-as-a-background-image-20016.md>)

Original publisher: [Read original article](<http://engineering.hackerearth.com/2021/08/12/how-to-set-a-react-component-as-a-background-image/>)

Published: 2021-08-12T00:00:00Z

Content type: tutorial

Language: en

Sources: [HackerEarth](<https://devfeed.tech/sources/hackerearth.md>)

Topics: [React](<https://devfeed.tech/topics/react.md>)

Tags: [background](<https://devfeed.tech/tags/background.md>), [background-image](<https://devfeed.tech/tags/background-image.md>), [component](<https://devfeed.tech/tags/component.md>), [element](<https://devfeed.tech/tags/element.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [image](<https://devfeed.tech/tags/image.md>), [react](<https://devfeed.tech/tags/react.md>), [react-component](<https://devfeed.tech/tags/react-component.md>), [set](<https://devfeed.tech/tags/set.md>)

### AI overview

The excerpt describes placing a React component behind a textarea to make it appear as the textarea's background. Wrap both in a relatively positioned div, position the component absolutely at the top left, and place it behind the textarea with a negative z-index. Make the textarea background transparent so the component shows through. Because the overlay can interfere with editing, the excerpt says to set pointer-events: none; centering the component is optional. The excerpt ends during the CSS example, so it does not provide complete implementation details.

### Source excerpt

During my internship at HackerEarth, I faced an interesting problem. This blog is about that and how I solved it. Problem: To set a background image to the textarea element. My initial impression on seeing the design was that it would be easy. I thought it's a image but after exploring the code I came to know that it's not an image that we have to show as background instead, it's a React Component. So now what? To solve this problem we need to think from scratch. Solution: First, we will think about how to do it and then will implement it step by step. 1. Think From Scratch In this example, as you can see the content in the body element overlap the background-image. To solve this problem we just need to overlap the React Component with the textarea. 2. Implementation Create a textarea and React Component which we are going to use. The text area is to the left and to the right is the React Component which we are going to set as a background image in the textarea element. Steps: 1.Create a div which wrap textarea and React Component. Set the div position: relative and React Component position: absolute, top: 0 & left: 0. <div className="editor-container"> // position: relative <textarea className="editor"/> <BackGround /> // position: absolute; top: 0; left: 0; </div> 2.To overlap textarea on React component we need to set React Component z-index: -1. .bg-img { position: absolute; top: 0; left: 0; width: 250px; font-family: monospace; text-align: center; color: rgba(0, 0, 0, 0.29); z-index: -1; } As you can see we have a problem now. React Component is below the textarea and we are not able to see. 3.To solve the problem we need to make the textarea background transparent. But then if you click on the React Component you won't be able to edit the textarea. To solve this set pointer-events: none. .editor { height: 400px; width: 400px; background: rgba(0, 0, 0, 0); // background transparent } .bg-img { position: absolute; top: 0; left: 0; width: 250px; font-family: mono

## Understanding CSS Multiple Backgrounds

DevFeed: [Understanding CSS Multiple Backgrounds](<https://devfeed.tech/articles/understanding-css-multiple-backgrounds-45297.md>)

Original publisher: [Read original article](<https://ishadeed.com/article/css-multiple-backgrounds/>)

Author: Ahmad Shadeed

Published: 2020-07-22T00:00:00Z

Content type: tutorial

Language: en

Sources: [Ahmad Shadeed](<https://devfeed.tech/sources/ahmad-shadeed.md>)

Topics: [CSS](<https://devfeed.tech/topics/css.md>), [Web Development](<https://devfeed.tech/topics/web-development.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [background](<https://devfeed.tech/tags/background.md>), [background-attachment](<https://devfeed.tech/tags/background-attachment.md>), [background-image](<https://devfeed.tech/tags/background-image.md>), [background-longhand](<https://devfeed.tech/tags/background-longhand.md>), [background-size](<https://devfeed.tech/tags/background-size.md>), [browser](<https://devfeed.tech/tags/browser.md>), [css](<https://devfeed.tech/tags/css.md>), [css-backgrounds](<https://devfeed.tech/tags/css-backgrounds.md>), [css-properties](<https://devfeed.tech/tags/css-properties.md>), [developers](<https://devfeed.tech/tags/developers.md>), [examples](<https://devfeed.tech/tags/examples.md>), [explainer](<https://devfeed.tech/tags/explainer.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [layer](<https://devfeed.tech/tags/layer.md>), [multiple](<https://devfeed.tech/tags/multiple.md>)

### AI overview

A tutorial on CSS multiple backgrounds explains the background shorthand, positioning and sizing layers, and how to combine multiple background layers with visual examples.

### Source excerpt

CSS is one of the most used CSS properties. However, using multiple backgrounds is still not well known across all developers. I will hugely focus on the potential of using multiple backgrounds and leverage the CSS to its full power. In this article, I will explain the property in detail, and provide a visual explainer on how we can stack multiple backgrounds, and the actual benefit of it. Of course, there will be some visual examples, you're in for a treat!

## Uncommon Use Cases For Pseudo Elements

DevFeed: [Uncommon Use Cases For Pseudo Elements](<https://devfeed.tech/articles/uncommon-use-cases-for-pseudo-elements-45403.md>)

Original publisher: [Read original article](<https://ishadeed.com/article/unusual-use-cases-pseudo-elements/>)

Author: Ahmad Shadeed

Published: 2019-10-29T00:00:00Z

Content type: tutorial

Language: en

Sources: [Ahmad Shadeed](<https://devfeed.tech/sources/ahmad-shadeed.md>)

Topics: [Website](<https://devfeed.tech/topics/website.md>)

Tags: [background-image](<https://devfeed.tech/tags/background-image.md>), [clickable](<https://devfeed.tech/tags/clickable.md>), [component](<https://devfeed.tech/tags/component.md>), [design](<https://devfeed.tech/tags/design.md>), [developers](<https://devfeed.tech/tags/developers.md>)

### AI overview

A practical tutorial for developers on less familiar uses of CSS pseudo-elements, including parent-child hover effects, project and blog link thumbnails, expanded clickable areas, card interactions, and overlays.

### Source excerpt

Pseudo-elements are in use for a long time. However, there are some uses cases that I feel they are not entirely known across developers. I wrote down this article to shed light on them so they can be used more. Parent-child Hover Effect Since the pseudo-element belongs to its parent element, there are some unusual use cases for that. For now, let's explore a straightforward example to demonstrate what I mean. The design has a section title, with a little circle on the left side of it.

## The CSS background-image property as an anti-pattern

DevFeed: [The CSS background-image property as an anti-pattern](<https://devfeed.tech/articles/the-css-background-image-property-as-an-anti-pattern-31308.md>)

Original publisher: [Read original article](<https://nystudio107.com/blog/the-css-background-image-property-as-an-anti-pattern>)

Author: andrew@nystudio107.com (Andrew Welch)

Published: 2019-05-28T12:49:00Z

Content type: opinion

Language: en

Sources: [nystudio107](<https://devfeed.tech/sources/nystudio107-articles-on-modern-web-development.md>)

Topics: [CSS](<https://devfeed.tech/topics/css.md>), [Web Accessibility (a11y)](<https://devfeed.tech/topics/web-accessibility.md>), [Search engine optimization (SEO)](<https://devfeed.tech/topics/seo.md>), [Web Development](<https://devfeed.tech/topics/web-development.md>)

Tags: [accessibility](<https://devfeed.tech/tags/accessibility.md>), [allowed](<https://devfeed.tech/tags/allowed.md>), [alt-text](<https://devfeed.tech/tags/alt-text.md>), [amazing](<https://devfeed.tech/tags/amazing.md>), [background-image](<https://devfeed.tech/tags/background-image.md>), [browsers](<https://devfeed.tech/tags/browsers.md>), [cases](<https://devfeed.tech/tags/cases.md>), [css](<https://devfeed.tech/tags/css.md>), [image](<https://devfeed.tech/tags/image.md>), [insights](<https://devfeed.tech/tags/insights.md>), [it-s](<https://devfeed.tech/tags/it-s.md>), [leave](<https://devfeed.tech/tags/leave.md>), [property](<https://devfeed.tech/tags/property.md>), [seo](<https://devfeed.tech/tags/seo.md>), [things](<https://devfeed.tech/tags/things.md>), [time](<https://devfeed.tech/tags/time.md>)

### AI overview

The article argues that CSS background-image is often misused for CTA hero and UI images. It discusses SEO, accessibility, and performance drawbacks and points toward using more appropriate browser image techniques instead.

### Source excerpt

The CSS background-image property allowed us to do some amazing things, but in most cases, it's time to leave it behind.

## Folding the DOM

DevFeed: [Folding the DOM](<https://devfeed.tech/articles/folding-the-dom-45231.md>)

Original publisher: [Read original article](<https://www.joshwcomeau.com/react/folding-the-dom/>)

Author: Josh W. Comeau

Published: 2019-05-19T19:00:00Z

Content type: tutorial

Language: en

Sources: [Josh Comeau's blog](<https://devfeed.tech/sources/josh-comeau-s-blog.md>)

Topics: [Front end](<https://devfeed.tech/topics/frontend.md>), [CSS](<https://devfeed.tech/topics/css.md>), [Document Object Model (DOM)](<https://devfeed.tech/topics/dom.md>), [React](<https://devfeed.tech/topics/react.md>), [3D](<https://devfeed.tech/topics/3d.md>), [Web Development](<https://devfeed.tech/topics/web-development.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>)

Tags: [3d](<https://devfeed.tech/tags/3d.md>), [animation](<https://devfeed.tech/tags/animation.md>), [background-image](<https://devfeed.tech/tags/background-image.md>), [code](<https://devfeed.tech/tags/code.md>), [css](<https://devfeed.tech/tags/css.md>), [developer](<https://devfeed.tech/tags/developer.md>), [react](<https://devfeed.tech/tags/react.md>), [rotation](<https://devfeed.tech/tags/rotation.md>), [scale](<https://devfeed.tech/tags/scale.md>), [techniques](<https://devfeed.tech/tags/techniques.md>)

### AI overview

A React-focused tutorial explains how to simulate folding a DOM image using duplicated images, CSS 3D transforms, perspective, and animation techniques. It also notes that the approach can be adapted to vanilla JavaScript and other front-end frameworks.

### Source excerpt

In this post, we'll explore a technique we can use to "fold" a DOM node, like folding a letter in real-life. On that journey, we'll learn a lot about 3D transforms and CSS animation techniques!

## The Hack is Back!

DevFeed: [The Hack is Back!](<https://devfeed.tech/articles/the-hack-is-back-39441.md>)

Original publisher: [Read original article](<https://aerotwist.com/blog/the-hack-is-back>)

Author: Paul Lewis

Published: 2016-01-25T00:00:00Z

Content type: tutorial

Language: en

Sources: [Paul Lewis](<https://devfeed.tech/sources/paul-lewis.md>)

Topics: [Image](<https://devfeed.tech/topics/image.md>), [performance-optimization](<https://devfeed.tech/topics/performance-optimization.md>), [async](<https://devfeed.tech/topics/async.md>), [User interface design](<https://devfeed.tech/topics/ui-design.md>), [Google Chrome](<https://devfeed.tech/topics/google-chrome.md>)

Tags: [accessibility](<https://devfeed.tech/tags/accessibility.md>), [accessible](<https://devfeed.tech/tags/accessible.md>), [alt-text](<https://devfeed.tech/tags/alt-text.md>), [aria](<https://devfeed.tech/tags/aria.md>), [background-image](<https://devfeed.tech/tags/background-image.md>), [based](<https://devfeed.tech/tags/based.md>), [blob](<https://devfeed.tech/tags/blob.md>), [block](<https://devfeed.tech/tags/block.md>), [blocking](<https://devfeed.tech/tags/blocking.md>), [browser](<https://devfeed.tech/tags/browser.md>), [bug](<https://devfeed.tech/tags/bug.md>), [canary](<https://devfeed.tech/tags/canary.md>), [canvas](<https://devfeed.tech/tags/canvas.md>), [chrome](<https://devfeed.tech/tags/chrome.md>), [chrome-canary](<https://devfeed.tech/tags/chrome-canary.md>), [code](<https://devfeed.tech/tags/code.md>), [decoding](<https://devfeed.tech/tags/decoding.md>), [hack](<https://devfeed.tech/tags/hack.md>), [image](<https://devfeed.tech/tags/image.md>), [images](<https://devfeed.tech/tags/images.md>), [jank](<https://devfeed.tech/tags/jank.md>), [perf](<https://devfeed.tech/tags/perf.md>)

### AI overview

`createImageBitmap` offers a browser-managed way to decode images in a worker, so decoding need not block other paint work on the main thread. The excerpt shows fetching an image as a blob, creating an `ImageBitmap` in a worker, and transferring it back with `postMessage`; `requestIdleCallback` can defer drawing until the main thread has time. Compared with the older JavaScript-decoder workaround, this avoids making developers manage decoding, memory use, image quality, and extra code. The feature is described as experimental in Chrome Canary behind the "Enable experimental canvas features" flag and available in Firefox 42 onward. Replacing `<img>` with `<canvas>` requires accessible markup; the excerpt recommends a labeled `role="img"` wrapper with an `aria-hidden="true"` canvas so hiding it also removes it from the accessibility tree.

### Source excerpt

Image decoding can be a source of checkboarding and jank. What if there was a way to work around it without resorting to a cluster of horror hacks? Step right up and meet my new friend createImageBitmap!

## Learning Angular: Conditionally add styles to an element

DevFeed: [Learning Angular: Conditionally add styles to an element](<https://devfeed.tech/articles/learning-angular-conditionally-add-styles-to-an-element-21286.md>)

Original publisher: [Read original article](<https://juri.dev/blog/2016/01/learning-ng2-dynamic-styles/>)

Published: 2016-01-24T00:00:00Z

Content type: article

Language: en

Sources: [Juri Strumpflohner](<https://devfeed.tech/sources/juri-strumpflohner.md>)

Topics: [Angular](<https://devfeed.tech/topics/angular.md>), [CSS](<https://devfeed.tech/topics/css.md>), [Learning](<https://devfeed.tech/topics/learning.md>)

Tags: [angular](<https://devfeed.tech/tags/angular.md>), [background-image](<https://devfeed.tech/tags/background-image.md>), [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [egghead](<https://devfeed.tech/tags/egghead.md>), [element](<https://devfeed.tech/tags/element.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [security](<https://devfeed.tech/tags/security.md>), [string](<https://devfeed.tech/tags/string.md>), [style](<https://devfeed.tech/tags/style.md>)

### AI overview

The excerpt outlines Angular (version 2 or later) approaches to conditional styling. It presents direct style-property binding, but notes that dynamically supplied values such as profile-image URLs can trigger Angular's unsafe-style sanitization warning; values known to be safe can be explicitly marked safe. For conditional classes, it describes NgClass as the preferred option for applying one or more classes based on boolean conditions, and mentions a separate syntax for a single class. It also introduces applying classes to the component host based on settings, with styles supplied by the component for reusability. Code examples and some API names are missing from the excerpt.

### Source excerpt

Lorem ipsum dolor sit amet

## Your logo is still an image... and so is mine!

DevFeed: [Your logo is still an image... and so is mine!](<https://devfeed.tech/articles/your-logo-is-still-an-image-and-so-is-mine-45553.md>)

Original publisher: [Read original article](<https://csswizardry.com/2013/01/your-logo-is-still-an-image-and-so-is-mine/>)

Author: Harry Roberts

Published: 2013-01-23T18:33:00Z

Content type: article

Language: en

Sources: [CSS Wizardry](<https://devfeed.tech/sources/css-wizardry.md>)

Topics: [Web Development](<https://devfeed.tech/topics/web-development.md>), [CSS](<https://devfeed.tech/topics/css.md>), [HTML](<https://devfeed.tech/topics/html.md>), [SVG](<https://devfeed.tech/topics/svg.md>), [Website](<https://devfeed.tech/topics/website.md>)

Tags: [background-image](<https://devfeed.tech/tags/background-image.md>), [css](<https://devfeed.tech/tags/css.md>), [html](<https://devfeed.tech/tags/html.md>), [images](<https://devfeed.tech/tags/images.md>), [logo](<https://devfeed.tech/tags/logo.md>), [performance](<https://devfeed.tech/tags/performance.md>), [responsive](<https://devfeed.tech/tags/responsive.md>), [semantics](<https://devfeed.tech/tags/semantics.md>), [svg](<https://devfeed.tech/tags/svg.md>), [web-platform](<https://devfeed.tech/tags/web-platform.md>)

### AI overview

An article explains how to preserve semantic HTML for a site logo while using a transparent GIF and CSS-applied SVG sprite for visual rendering and performance. It discusses the distinction between how people and machines access websites.

### Source excerpt

Balancing image semantics with performance ideals

## Checkerboard, striped & other background patterns with CSS3 gradients

DevFeed: [Checkerboard, striped & other background patterns with CSS3 gradients](<https://devfeed.tech/articles/checkerboard-striped-other-background-patterns-with-css3-gradients-51982.md>)

Original publisher: [Read original article](<https://lea.verou.me/2010/12/checkered-stripes-other-background-patterns-with-css3-gradients/>)

Author: Lea Verou

Published: 2010-12-22T00:00:00Z

Content type: article

Language: en

Sources: [Lea Verou's blog](<https://devfeed.tech/sources/lea-verou-s-blog.md>)

Topics: [CSS](<https://devfeed.tech/topics/css.md>), [HTML](<https://devfeed.tech/topics/html.md>), [selectors](<https://devfeed.tech/topics/selectors.md>), [browser](<https://devfeed.tech/topics/browser.md>)

Tags: [background](<https://devfeed.tech/tags/background.md>), [background-image](<https://devfeed.tech/tags/background-image.md>), [background-size](<https://devfeed.tech/tags/background-size.md>), [blog](<https://devfeed.tech/tags/blog.md>), [browsers](<https://devfeed.tech/tags/browsers.md>), [css](<https://devfeed.tech/tags/css.md>), [css-images](<https://devfeed.tech/tags/css-images.md>), [css-values](<https://devfeed.tech/tags/css-values.md>), [css3](<https://devfeed.tech/tags/css3.md>), [effect](<https://devfeed.tech/tags/effect.md>), [fallback](<https://devfeed.tech/tags/fallback.md>), [gradient](<https://devfeed.tech/tags/gradient.md>), [linear](<https://devfeed.tech/tags/linear.md>), [make](<https://devfeed.tech/tags/make.md>), [mozilla](<https://devfeed.tech/tags/mozilla.md>), [multiple](<https://devfeed.tech/tags/multiple.md>), [multiple-backgrounds](<https://devfeed.tech/tags/multiple-backgrounds.md>), [opera](<https://devfeed.tech/tags/opera.md>), [original](<https://devfeed.tech/tags/original.md>), [pattern](<https://devfeed.tech/tags/pattern.md>), [patterns](<https://devfeed.tech/tags/patterns.md>), [spec](<https://devfeed.tech/tags/spec.md>), [stop](<https://devfeed.tech/tags/stop.md>), [support](<https://devfeed.tech/tags/support.md>), [syntax](<https://devfeed.tech/tags/syntax.md>), [tips](<https://devfeed.tech/tags/tips.md>), [transparent](<https://devfeed.tech/tags/transparent.md>)

### AI overview

CSS3 gradients can create repeating stripe and picnic-style backgrounds without images by placing color stops at the same position for a sharp transition, setting a background color as both a stripe color and fallback, and using background-size to control the tile. The picnic pattern overlays horizontal and vertical stripes. The described checkerboard instead uses four diagonal gradients, each contributing part of the dark squares; the author says a regular, non-diagonal checkerboard would require too many gradients, and notes conical gradients were not then supported or in the spec. The excerpt lists WebKit, Firefox 3.6+, Opera 11.50+ and IE10+ for the demo.

### Source excerpt

You're probably familiar with CSS3 gradients by now, including the closer to the standard Mozilla syntax and the ugly verbose Webkit one. I assume you know how to add multiple color stops, make your gradients angled or create radial gradients. What you might not be aware of, is that CSS3 gradients can be used to create many kinds of commonly needed patterns, including checkered patterns, stripes and more. View demo (Works in Webkit, Firefox 3.6+, Opera 11.50+ and IE10+) The main idea behind the technique is the following, taken from the CSS3 Images spec: If multiple color-stops have the same position, they produce an infinitesimal transition from the one specified first in the rule to the one specified last. In effect, the color suddenly changes at that position rather than smoothly transitioning. I guess this makes it obvious how to create the tile for the stripes (unless you've never created a striped background before, but teaching you this is beyond the scope of this post). For example the gradient for the horizontal stripes is: background-color: #0ae; background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(.5, rgba(255, 255, 255, .2)), color-stop(.5, transparent), to(transparent)); background-image: -moz-linear-gradient(rgba(255, 255, 255, .2) 50%, transparent 50%, transparent); background-image: -o-linear-gradient(rgba(255, 255, 255, .2) 50%, transparent 50%, transparent); background-image: linear-gradient(rgba(255, 255, 255, .2) 50%, transparent 50%, transparent); Why transparent instead of the actual colors we want? For flexibility. background-color serves two purposes here: Setting the color of half the stripes and serving as a fallback for browsers that don't support gradients. However, without anything else, the tile will occupy the whole container. To control the size of each tile, you can use background-size: -webkit-background-size: 50px 50px; -moz-background-size: 50px 50px; background-size: 50px 50px; To create the picnic-style pattern, yo