Search

Nalezeno "border": 481

Change Color of SVG on Hover


There are a lot of different ways to use SVG. Depending on which way, the tactic for recoloring that SVG in different states or conditions — :hover, :active, :focus, class name change, etc. — is different. Let's look at the ways. Inline SVG Inline SVG is my favorite way to use...

Getting To Know The MutationObserver API


MutationObserver watches the DOM, specifically the places you tell it to, like: document.querySelector('#watch-this'); ...and it can tell you (trigger a callback) when stuff happens — like when a child is added, removed, changed, or a number of other things. I used it just the other day...

Simulating Mouse Movement


If you've ever had to display an interactive animation during a live talk or a class, then you may know that it's not always easy to interact with your slides and while talking. This happened to me when I needed to show this particles demo to my students. I didn't want to have to stay next to...

Blurred Borders in CSS


Say we want to target an element and just visually blur the border of it. There is no simple, single built-in web platform feature we can reach for. But we can get it done with a little CSS trickery. Here's what we're after: The desired result. Let's see how we can code this effect, how we...

Creating a Custom Element from Scratch


In the last article, we got our hands dirty with Web Components by creating an HTML template that is in the document but not rendered until we need it. Next up, we’re going to continue our quest to create a custom element version of the dialog component below which currently only uses...

Stacked “Borders”


A little while back, I was in the process of adding focus styles to An Event Apart’s web site. Part of that was applying different focus effects in different areas of the design, like white rings in the header and footer and orange rings in the main text. But in one place, I wanted rings that were...

CSS Triangles, Multiple Ways


I like Adam Laki's Quick Tip: CSS Triangles because it covers that ubiquitous fact about front-end techniques: there are always many ways to do the same thing. In this case, drawing a triangle can be done: with border and a collapsed element with clip-path: polygon() with transform: rotate()...

Control Icons with Font Size


Here’s a nifty trick from Andy Bell that now seems a little obvious in hindsight: if you set an SVG to have a width and height of 1em then you can change the size of it with the font-size property. Try and change the font-size on the body element below to see the icon scale with the text: ...

Diana Smith’s Top 5 CSS Properties She Uses to Produce CSS Art


Have you seen Diana Smith's CSS drawings? Stunning. These far transcend the CSS drawings that sort of crudely replicate a flat SVG scene, like I might attempt. We were lucky enough for her to post some of her CSS drawing techniques here last year. Well, Diana has also listed the top five...

Slide an Image to Reveal Text with CSS Animations


I want to take a closer look at the CSS animation property and walk through an effect that I used on my own portfolio website: making text appear from behind a moving object. Here’s an isolated example if you’d like to see the final product. Here’s what we're going to work with: See the...

The Secret Weapon to Learning CSS


For some reason, I’ve lately been thinking a lot about what it takes to break into the web design industry and learn CSS. I reckon it has something to do with Keith Grant’s post earlier this month on a CSS mental model where he talks about a “common core for CSS”: We need common core tricks like...

The Great Divide


Let’s say there is a divide happening in front-end development. I feel it, but it's not just in my bones. Based on an awful lot of written developer sentiment, interviews Dave Rupert and I have done on ShopTalk, and in-person discussion, it’s, as they say... a thing. The divide is between people...

Slice and Dice a Disc with CSS


I recently came across an interesting sliced disc design. The disc had a diagonal gradient and was split into horizontal slices, offset a bit from left to right. Naturally, I started to think what would the most efficient way of doing it with CSS be. Sliced gradient disc. The first thought...

Gradient Borders in CSS


Let's say you need a gradient border around an element. My mind goes like this: There is no simple obvious CSS API for this. I'll just make a wrapper element with a linear-gradient background, then an inner element will block out most of that background, except a thin line of padding around...

An Initial Implementation of clip-path: path();


One thing that has long surprised (and saddened) me is that the clip-path property, as awesome as it is, only takes a few values. The circle() and ellipse() functions are nice, but hiding overflows and rounding with border-radius generally helps there already. Perhaps the most useful value...

Drawing Images with CSS Gradients


What I mean by "CSS images" is images that are created using only HTML elements and CSS. They look as if they were SVGs drawn in Adobe Illustrator but they were made right in the browser. Some techniques I’ve seen used are tinkering with border radii, box shadows, and sometimes clip-path. You...

Nahoru
Tento web používá k poskytování služeb a analýze návštěvnosti soubory cookie. Používáním tohoto webu s tímto souhlasíte. Další informace