Using percentage values with background-position on a linear-gradient

TL;DR All the percentage values used with background-position are equivalent when using a gradient as background, so you won’t see any difference. You need to specify a background-size different from the container size: body { display: flex; flex-direction: column; justify-content: space-around; align-items: center; min-height:90vh; } .button { text-decoration: none; color: white; font-weight: bold; width: 350px; … Read more

How to set a transparent background of JPanel?

Calling setOpaque(false) on the upper JPanel should work. From your comment, it sounds like Swing painting may be broken somewhere – First – you probably wanted to override paintComponent() rather than paint() in whatever component you have paint() overridden in. Second – when you do override paintComponent(), you’ll first want to call super.paintComponent() first to … Read more

CSS background image in :after element

A couple things (a) you cant have both background-color and background, background will always win. in the example below, i combined them through shorthand, but this will produce the color only as a fallback method when the image does not show. (b) no-scroll does not work, i don’t believe it is a valid property of … Read more

CSS – white text on black background, looks bolder

The text is bold because of the anti-aliasing algorithm being used in your browser. It’s easy to verify. Take screengrabs in IE, Safari, Firefox and Chrome. They all anti-alias differently. Some make the text look thicker than others. Generally the better text looks white-on-black, the fatter it looks reversed. There’s a full explanation here: http://www.lighterra.com/articles/macosxtextaabug/ … Read more

Old paper background texture with just css

May I suggest my solution ? (tested on Chrome v92+, Firefox v90+, Edge v92+). A bit of box shadow : #parchment { position: absolute; display: flex; width: 75%; min-height: calc((1vw + 1vh) * 75); /* center page with absolute position */ top: 0%; left: 50%; transform: translate(-50%, 0); margin: 2em 0; padding: 4em; box-shadow: 2px … Read more