background-position

Using percentage values with background-position on a linear gradient

爱⌒轻易说出口 提交于 2019-11-25 21:53:01
问题 Is there any way to make background-position take percentage values? Currently my button only works with an explicit values for width and background-position . body { min-height: 100vh; display: flex; flex-direction: column; justify-content: space-around; align-items: center; } .button { display: flex; justify-content: center; align-items: center; text-decoration: none; color: white; font-weight: bold; width: 350px; height: 50px; border: 1px solid green; transition: background 0.5s;