跳到主要内容
CSS-Tricks
  • 文章
  • 笔记
  • 链接
  • 指南
  • 年鉴
  • 随机
搜索

文章标签
background

15 篇文章
{
,

}
文章的直接链接 CSS Checkerboard Background… But With Rounded Corners and Hover Styles
background gradients patterns repeating gradient

CSS Checkerboard Background… But With Rounded Corners and Hover Styles

一方面,用 CSS 创建简单的棋盘格背景很容易。另一方面,除非我们是 CSS-gradient-ninjas 中的一员,否则我们只能使用基本图案。

至少当我盯着...的时候,我是这么想的。

Avatar of Preethi
Preethi on Sep 20, 2022
文章的直接链接 Cool Hover Effects That Use Background Properties
background background-position hover links

Cool Hover Effects That Use Background Properties

不久前,Geoff 写了一篇关于酷炫悬停效果的文章 。 该效果依赖于 CSS 伪元素、变换和过渡的组合。很多评论表明,可以使用背景来实现相同的效果...

Avatar of Temani Afif
Temani Afif on May 26, 2022
文章的直接链接 Grainy Gradients
background filter gradients svg filters

Grainy Gradients

浏览 Dribbble 或 Behance,您会发现设计师使用一种简单的技术为图像添加纹理:噪声。添加噪声会使原本纯色或平滑的渐变(如阴影)更逼真。但尽管设计师偏爱纹理,...

Avatar of Jimmy Chion
Jimmy Chion on Sep 14, 2021
文章的直接链接 Creating Colorful, Smart Shadows
background emoji shadow

Creating Colorful, Smart Shadows

来自 Kirupa Chinnathambi 的一个正宗 CSS 技巧。要使彩色阴影与元素的 background-image 中的颜色相匹配,您需要在伪元素中继承背景,将其放在原始元素后面,然后模糊并过滤它。...

Avatar of Chris Coyier
Chris Coyier on May 4, 2021
文章的直接链接 Platform News: Prefers Contrast, MathML, :is(), and CSS Background Initial Values
:is background MathML prefers-contrast

Platform News: Prefers Contrast, MathML, :is(), and CSS Background Initial Values

在本周的综述中,prefers-contrast 在 Safari 中上线,MathML 受到了一些关注,:is() 实际上非常宽容,更多与 ADA 相关的诉讼,CSS 背景属性的不一致初始值会导致不希望出现但很酷的模式...

Avatar of Šime Vidas
Šime Vidas on Apr 15, 2021
文章的直接链接 Creative Background Patterns Using Gradients, CSS Shapes, and Even Emojis
background gradients patterns

Creative Background Patterns Using Gradients, CSS Shapes, and Even Emojis

您可以在 CSS 中创建条纹。很长一段时间,我对 CSS 背景图案的理解仅限于此。条纹并没有什么错,条纹很酷。它们可以定制成宽窄不一的带状,交叉...

Avatar of Preethi
Preethi on Jun 10, 2020
文章的直接链接 Managing Multiple Backgrounds with Custom Properties
background background-image custom properties multiple backgrounds

Managing Multiple Backgrounds with Custom Properties

CSS 自定义属性的一件很酷的事情是,它们可以成为值的一部分。假设您正在使用多个背景 来实现设计。每个背景将有自己的颜色、图像、重复、位置等。它...

Avatar of Chris Coyier
Chris Coyier on Jul 16, 2019
文章的直接链接 Multiple Background Clip
background background-clip multiple backgrounds

Multiple Background Clip

您知道如何拥有多个背景 吗?

body {
  background-image: 
    url(image-one.jpg),
    url(image-two.jpg);
}

这仅仅是 background-image。您可以像预期的那样设置它们的位置。我们将简写它

body {
  background: 
    url(image-one.jpg) no-repeat top right,
    url(image-two.jpg) 
…
Avatar of Chris Coyier
Chris Coyier on Jan 30, 2019
文章的直接链接 Moving Backgrounds With Mouse Position
background background-position custom properties JavaScript

Moving Backgrounds With Mouse Position

假设您想在鼠标悬停在元素上时移动元素的 background-position,为设计增添一些趣味。您有一个这样的元素

<div class="module" id="module"></div>

您在其上添加一个背景

.module 
…
Avatar of Chris Coyier
Chris Coyier on Oct 4, 2018
  • 1
  • 2
  • 较旧的

CSS-Tricks 由 DigitalOcean 提供支持。

关注 Web 开发最新动态

通过我们精心制作的时事通讯

DigitalOcean
  • 关于 DO
  • Cloudways
  • 法律事项
  • 获取免费积分!
CSS-Tricks
  • 为我们写作!
  • 与我们合作广告
  • 联系我们
社交
  • RSS Feed
  • CodePen
  • Mastodon
  • X
返回顶部

© 2024 . All rights reserved.