Search

Nalezeno "body": 279

Need to scroll to the top of the page?


Perhaps the easiest way to offer that to the user is a link that targets an ID on the <html> element. So like... <html id="top"> <body> <!-- the entire document --> <a href="#top">Jump to top of page</a> ...

Can you nest @media and @support queries?


Yes, you can, and it doesn't really matter in what order. A CSS preprocessor is not required. It works in regular CSS. This works: @supports(--a: b) { @media (min-width: 1px) { body { background: red; } } } And so does this, the reverse nesting of the above: @media (min-width:...

How much specificity do @rules have, like @keyframes and @media?


I got this question the other day. My first thought is: weird question! Specificity is about selectors, and at-rules are not selectors, so... irrelevant? To prove that, we can use the same selector inside and outside of an at-rule and see if it seems to affect specificity. body { background:...

CSS :not() with Multiple Classes


Say you want to select an element when it doesn't have a certain class. That's what the :not() selector is for. body:not(.home) { } But what if there are multiple classes you want to avoid? There are no logical combinators with :not(), like and or or, but you can chain them, which...

Managing Multiple Backgrounds with Custom Properties


One cool thing about CSS custom properties is that they can be a part of a value. Let's say you're using multiple backgrounds to pull off a a design. Each background will have its own color, image, repeat, position, etc. It can be verbose! You have four images: body { background-position: ...

How to Section Your HTML


The sectioning elements in HTML5 are <nav>, <aside>, <article>, and <section>. <body> is also kind of a sectioning element since all content lying inside of it is part of the default document section. Here is a brief explanation of each sectioning element...

Prevent Page Scrolling When a Modal is Open


Please stop me if you've heard this one before. You open a modal, scroll through it, close it, and wind up somewhere else on the page than you were when you opened the modal. That's because modals are elements on a page just like any other. It may stay in place (assuming that's what it's meant...

The Simplest Ways to Handle HTML Includes


It's extremely surprising to me that HTML has never had any way to include other HTML files within it. Nor does there seem to be anything on the horizon that addresses it. I'm talking about straight up includes, like taking a chunk of HTML and plopping it right into another. For example the...

Smooth Scrolling for Screencasts


Let's say you wanted to scroll a web page from top to bottom programmatically. For example, you're recording a screencast and want a nice full-page scroll. You probably can't scroll it yourself because it'll be all uneven and jerky. Native JavaScript can do smooth scrolling. Here's a tiny snippet...

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: ...

Jak zjistit body řidiče: Nově to jde snadno přes Portál občana


Portál občana se rozrostl o dlouho očekávanou novinku a to okamžitý výpis bodového hodnocení řidiče. Nově je zde možné vše zobrazit přímo z administrace bez nutnosti zasílání žádosti o konkrétní výpis skrze datovou schránku. Na domovské stránce se tak nově po přihlášení ukazuje vedle čísla

Multiple Background Clip


You know how you can have multiple backgrounds? body { background-image: url(image-one.jpg), url(image-two.jpg); } That's just background-image. You can set their position too, as you might expect. We'll shorthand it: body { background: url(image-one.jpg) no-repeat top right, ...

Toggling Animations On and Off


A nicely detailed tutorial by Kirupa that gets into how you might provide a UI with persisted options that control whether animations run or not. The trick is custom properties that control the movement: body { --toggle: 0; --playState: "paused"; } Which are used within animations...

Your Body Text is Too Small


Several years ago, there was a big push by designers to increase the font-size of websites and I feel like we’re living in another era of accessibility improvements where a fresh batch of designers are pushing for even larger text sizing today. Take this post by Christian Miller, for example, where...

Scrolling Gradient


If you want a gradient that changes as you scroll down a very long page, you can create a gradient with a bunch of color stops, apply it to the body and it will do just that. But, what if you don't want a perfectly vertical gradient? Like you want just the top left corner to change color? Mike...

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