- Aug 2022
-
chromestatus.com chromestatus.com
-
www.w3.org www.w3.org
-
-
-
The clientHeight property returns the inner height of an element in pixels. The property includes padding but excludes borders, margins and horizontal scrollbars.Alternatively, you can use the offsetHeight property, which returns the height of the element in pixels, including vertical padding and borders.
```js useEffect(() => { setDivHeight(ref.current.offsetHeight); console.log('height: ', ref.current.offsetHeight);
console.log('width: ', ref.current.offsetWidth); }, []); ```
Tags
Annotators
URL
-
-
pudding.cool pudding.cool
-
Tags
Annotators
URL
-
- Jul 2022
-
www.phpied.com www.phpied.com
-
And immediately after it, the 2 CSS downloads begin. What we want to do is move the CSS downloads to the left, so all rendering starts (and finishes!) sooner. So all you do it take the URLs of these two files and add them to .htaccess with H2PushResource in front. For me that means the URL to my custom theme's CSS /wp-content/themes/phpied2/style.css as well as some WordPress CSS stuff. While I was there I also added a JavaScript file which is loaded later. Why now start early? So the end result is:
WordPress tip to start loading some CSS and JS files earlier.
Sample code to add to
.htaccess
:H2PushResource /wp-content/themes/phpied2/style.css H2PushResource /wp-includes/css/dist/block-library/style.min.css?ver=5.4.1 H2PushResource /wp-includes/js/wp-emoji-release.min.js?ver=5.4.1
-
-
educational-innovation.sydney.edu.au educational-innovation.sydney.edu.au
-
An article discussing the creation of custom HTML and CSS for blackboard
-
-
developer.mozilla.org developer.mozilla.org
- Jun 2022
-
css-tricks.com css-tricks.com
Tags
Annotators
URL
-
-
blogs.perficient.com blogs.perficient.com
-
davidpiesse.github.io davidpiesse.github.io
Tags
Annotators
URL
-
-
css-tricks.com css-tricks.com
Tags
Annotators
URL
-
-
gist.github.com gist.github.com
-
Tailwind replicated using css variables
-
-
www.smashingmagazine.com www.smashingmagazine.com
-
Tags
Annotators
URL
-
-
css-tricks.com css-tricks.com
-
-
css { content-visibility: auto; contain-intrinsic-size: 1px 5000px; }
-
- May 2022
-
time2hack.com time2hack.com
-
javascript.plainenglish.io javascript.plainenglish.io
-
```css .long-text { margin-bottom: 10px; }
.clamp { -webkit-line-clamp: 5; -webkit-box-orient: vertical; display: -webkit-box; overflow: hidden; text-overflow: ellipsis; overflow-wrap: break-word; } ```
```js import { LoremIpsum } from "https://cdn.skypack.dev/lorem-ipsum@2.0.3"; import classnames from "https://cdn.skypack.dev/classnames@2.3.1"; import * as lodash from "https://cdn.skypack.dev/lodash@4.17.21";
const getText = (paragraphs) => { const lorem = new LoremIpsum(); return lorem.generateParagraphs(paragraphs); };
const ReadMoreText = ({ text }) => { const [clamped, setClamped] = React.useState(true); const [showButton, setShowButton] = React.useState(true); const containerRef = React.useRef(null); const handleClick = () => setClamped(!clamped);
React.useEffect(() => { const hasClamping = (el) => { const { clientHeight, scrollHeight } = el; return clientHeight !== scrollHeight; };
const checkButtonAvailability = () => { if (containerRef.current) { // Save current state to reapply later if necessary. const hadClampClass = containerRef.current.classList.contains("clamp"); // Make sure that CSS clamping is applied if aplicable. if (!hadClampClass) containerRef.current.classList.add("clamp"); // Check for clamping and show or hide button accordingly. setShowButton(hasClamping(containerRef.current)); // Sync clamping with local state. if (!hadClampClass) containerRef.current.classList.remove("clamp"); } }; const debouncedCheck = lodash.debounce(checkButtonAvailability, 50); checkButtonAvailability(); window.addEventListener("resize", debouncedCheck); return () => { window.removeEventListener("resize", debouncedCheck); };
}, [containerRef]);
return ( <> <div ref={containerRef} className={classnames("long-text", clamped && "clamp")} > {text} </div> {showButton && ( <button onClick={handleClick}>Read {clamped ? "more" : "less"}</button> )} <br /> ); };
const App = () => { const text = getText(2); return <ReadMoreText text={text} />; };
ReactDOM.render(<App />, document.getElementById("App")); ```
-
-
web.simmons.edu web.simmons.edu
-
-
oreillymedia.github.io oreillymedia.github.io
-
To select an element tag or attribute defined in a specific namespace, you declare a namespace prefix with an @namespace rule, then use it in your selector. The namespace is separated from the tag name with a | (vertical bar or pipe) character; if there is no tag name in the selector, use a universal * selector:
```css @namespace svg "http://www.w3.org/2000/svg";
a { / These rules would apply to any
a
elements. / text-decoration: underline; color: purple; } svg|a { / These rules would apply to SVGa
elements, but not HTML links. / stroke: purple; } svg| { / These rules apply to all SVG-namespaced elements, but not HTML elements. */ mix-blend-mode: multiply; } ```
-
-
css-tricks.com css-tricks.com
-
```css .dont-break-out {
/ These are technically the same, but use both / overflow-wrap: break-word; word-wrap: break-word;
-ms-word-break: break-all; / This is the dangerous one in WebKit, as it breaks things wherever / word-break: break-all; / Instead use this non-standard one: / word-break: break-word;
/ Adds a hyphen where the word breaks, if supported (No Blink) / -ms-hyphens: auto; -moz-hyphens: auto; -webkit-hyphens: auto; hyphens: auto;
} ```
-
-
dev.to dev.to
-
Say hello to the sassy new Media Queries!
js const html = document.getElementsByTagName('html')[0]; const toggleTheme = (theme) => { html.dataset.theme = theme; }
html <script> // If `prefers-color-scheme` is not supported, fall back to light mode. // In this case, light.css will be downloaded with `highest` priority. if (window.matchMedia('(prefers-color-scheme: dark)').media === 'not all') { document.documentElement.style.display = 'none'; document.head.insertAdjacentHTML( 'beforeend', '<link rel="stylesheet" href="/light.css" onload="document.documentElement.style.display = \'\'">' ); } </script> <!-- Conditionally either load the light or the dark stylesheet. The matching file will be downloaded with `highest`, the non-matching file with `lowest` priority. If the browser doesn't support `prefers-color-scheme`, the media query is unknown and the files are downloaded with `lowest` priority (but above I already force `highest` priority for my default light experience). --> <link rel="stylesheet" href="/dark.css" media="(prefers-color-scheme: dark)"> <link rel="stylesheet" href="/light.css" media="(prefers-color-scheme: light)"> <!-- The main stylesheet --> <link rel="stylesheet" href="/style.css">
html <img src="./sun.svg" data-light-src="./sun.svg" data-dark-src="./moon.svg" alt="light theme" id="theme-selector" onclick="switchTheme(this)">
Tags
Annotators
URL
-
-
dev.to dev.to
-
The only catch with this method is, it will also invert all the images in your application. So we will add the same rule to all images to reverse the effect.
css html[theme='dark-mode'] img{ filter: invert(1) hue-rotate(180deg); }
and we will also add a transition to the HTML element to make sure the transition does not become flashy!css html { transition: color 300ms, background-color 300ms; }
-
html[theme='dark-mode'] { filter: invert(1) hue-rotate(180deg); }
Ultimate CSS to turn on dark mode
Tags
Annotators
URL
-
- Apr 2022
-
stackoverflow.com stackoverflow.com
-
css .hoverClassColor:hover { color:var(--hover-color) !important; }
js render() { return <a className={'hoverClassColor'} style={{'--hover-color':'red'}}>Test</a> }
-
-
css-tricks.com css-tricks.com
Tags
Annotators
URL
-
-
dev.to dev.to
Tags
Annotators
URL
-
-
stackoverflow.com stackoverflow.com
-
Since elements can overlap each other in a CSS grid, it doesn't even try to align them. As its name suggests, it is a grid, not a column layout.
-
-
stackoverflow.com stackoverflow.com
-
However, when 2 elements begin at the same grid row, they overlap.
-
-
css-tricks.com css-tricks.com
-
-
It’ll fill the area by default, but it doesn’t have to. It could be smaller or bigger. It could be aligned into any of the corners or centered.
-
-
-
https://github.com/deathau/obsidian-snippets
Some code and clever hacks for Obsidian
-
-
-
css ul { list-style-type: none; } ul li:before { content:"\2713"; }
-
-
stackoverflow.com stackoverflow.com
-
Setting "img max-width:100%" is a technique employed in responsive/fluid web site design so that images re-size proportionally when the browser is re-sized. Apparently some css grid systems have started setting this style by default. More info about fluid images here: http://www.alistapart.com/articles/fluid-images/
-
-
alistapart.com alistapart.com
-
Now, our img element will render at whatever size it wants, as long as it’s narrower than its containing element. But if it happens to be wider than its container, then the max-width: 100% directive forces the image’s width to match the width of its container.
-
- Mar 2022
-
css-tricks.com css-tricks.com
-
css .bg { background: url('data:image/svg+xml;utf8,<svg ...> ... </svg>'); }
Tags
Annotators
URL
-
-
codepen.io codepen.io
-
-
headlessui.dev headlessui.dev
Tags
Annotators
URL
-
-
tailwind-elements.com tailwind-elements.com
Tags
Annotators
URL
-
-
tailblocks.cc tailblocks.cc
-
-
www.youtube.com www.youtube.com
-
-
nasreddinebacali.info nasreddinebacali.info
Tags
Annotators
URL
-
-
flowbite.com flowbite.com
-
play.tailwindcss.com play.tailwindcss.com
Tags
Annotators
URL
-
-
umeshmk.github.io umeshmk.github.io
Tags
Annotators
URL
-
-
tailwindcomponents.com tailwindcomponents.com
Tags
Annotators
URL
-
-
www.smashingmagazine.com www.smashingmagazine.com
-
www.sitepoint.com www.sitepoint.com
Tags
Annotators
URL
-
-
www.codeinwp.com www.codeinwp.com
Tags
Annotators
URL
-
-
blog.logrocket.com blog.logrocket.com
-
-
css-tricks.com css-tricks.com
Tags
Annotators
URL
-
-
jsfiddle.net jsfiddle.net
-
-
lexoral.com lexoral.com
Tags
Annotators
URL
-
- Feb 2022
-
designmodo.com designmodo.com
Tags
Annotators
URL
-
-
css-tricks.com css-tricks.com
Tags
Annotators
URL
-
-
Tags
Annotators
URL
-
-
developer.mozilla.org developer.mozilla.orgflex3
-
shrink
-
grow
-
flex container
Tags
Annotators
URL
-
-
www.internetingishard.com www.internetingishard.com
-
Class selectors
可以理解为是针对特定一个元素(Element)的的修饰
Tags
Annotators
URL
-
-
www.leemeichin.com www.leemeichin.com
Tags
Annotators
URL
-
- Jan 2022
-
uxdesign.cc uxdesign.cc
-
-
webdesign.tutsplus.com webdesign.tutsplus.com
-
css-tricks.com css-tricks.com
Tags
Annotators
URL
-
-
headlessui.dev headlessui.dev
-
-
varun.ca varun.ca
-
-
www.joshwcomeau.com www.joshwcomeau.com
Tags
Annotators
URL
-
-
www.impressivewebs.com www.impressivewebs.com
-
When you give an element a width of 100% in CSS, you’re basically saying “Make this element’s content area exactly equal to the explicit width of its parent — but only if its parent has an explicit width.” So, if you have a parent container that’s 400px wide, a child element given a width of 100% will also be 400px wide, and will still be subject to margins, paddings, and borders — on top of the 100% width setting.
-
-
codesandbox.io codesandbox.io
-
-
-
-
csstracking.dev csstracking.dev
-
-
css-tricks.com css-tricks.com
-
-
stackoverflow.com stackoverflow.com
-
Add a
::after
which autofills the space. No need to pollute your HTML. Here is a codepen showing it: http://codepen.io/DanAndreasson/pen/ZQXLXj.grid { display: flex; flex-flow: row wrap; justify-content: space-between; } .grid::after { content: ""; flex: auto; }
-
- Dec 2021
-
blog.bitsrc.io blog.bitsrc.io
-
www.sliderrevolution.com www.sliderrevolution.com
-
<span>See the Pen Timeline Style Navigation by Naila Ahmad (@nailaahmad) on CodePen.</span>
<script async src="https://cpwebassets.codepen.io/assets/embed/ei.js"></script>
Tags
Annotators
URL
-
-
developers.google.com developers.google.com
Tags
Annotators
URL
-
-
blog.logrocket.com blog.logrocket.com
-
css-tricks.com css-tricks.com
Tags
Annotators
URL
-
-
stackoverflow.com stackoverflow.com
-
.container { width: 100%; height: 100vh; overflow: scroll; -webkit-overflow-scrolling: touch; scroll-snap-type: y mandatory; } .item { position: sticky; position: -webkit-sticky; top: 0; scroll-snap-align: start; width: 100%; height: 100vh; }
-
-
app.htmlplanetforkids.com app.htmlplanetforkids.com
-
elad.medium.com elad.medium.com
-
Stick to the bottom?!
[...]
But you can also use it to stick elements to the bottom. That means that the footer can be defined to have a sticky position, and it will always appear to stick to the bottom when scrolling down. When we reach the end of the sticky container, the element will stop in its natural position. It’s better to use it on elements whose natural position is the bottom of the sticky container.
Full Example:
- HTML
<main class="main-container"> <header class="main-header">HEADER</header> <div class="main-content">MAIN CONTENT</div> <footer class="main-footer">FOOTER</footer> </main>
- CSS
Live CodePen Example.main-footer{ position: sticky; bottom: 0; }
- HTML
-
-
developer.mozilla.org developer.mozilla.org
Tags
Annotators
URL
-
-
2021.stateofcss.com 2021.stateofcss.com
Tags
Annotators
URL
-
-
www.sitepoint.com www.sitepoint.com
Tags
Annotators
URL
-
-
css-tricks.com css-tricks.com
Tags
Annotators
URL
-
-
-
-
css-tricks.com css-tricks.com
-
If you want to define a theme color for light and dark mode, your best bet is to define both colors and use the first meta tag as a fallback for browsers that don’t support the media feature.
<meta name="theme-color" content="#319197" media="(prefers-color-scheme: light)"> <meta name="theme-color" content="#872e4e" media="(prefers-color-scheme: dark)">
Tags
Annotators
URL
-
-
every-layout.dev every-layout.dev
-
-
web.dev web.dev
-
-
-
-
moderncss.dev moderncss.dev
-
-
developers.google.com developers.google.com
Tags
Annotators
URL
-
-
stackoverflow.com stackoverflow.com
-
table{ width:100%; table-layout: fixed; overflow-wrap: break-word; }
-
-
daily-dev-tips.com daily-dev-tips.com
-
<!-- HTML --> <div class="text-container"> <h1>Difference</h1> </div> <section></section> <section></section>
/* CSS */ section { width: 100vw; height: 100vh; background: #000; &:nth-child(odd) { background: #fff; } } .text-container { position: fixed; width: 100vw; height: 100vh; display: flex; justify-content: center; align-items: center; color: #fff; mix-blend-mode: difference; h1 { font-size: 150px; } }
-
-
ishadeed.com ishadeed.com
-
-
www.digitalocean.com www.digitalocean.com
-
csshint.com csshint.com
-
-
developers.google.com developers.google.com
-
csspoint101.com csspoint101.com
-
-
css-tricks.com css-tricks.com
Tags
Annotators
URL
-
- Nov 2021
-
getbootstrap.com getbootstrap.comFlex1
-
around
Tags
Annotators
URL
-
-
www.interviewbit.com www.interviewbit.com
-
Front end framework is a combination of two separate words, Front end + Framework. Front end is the visual site of any web application or a website, it is that part of the website with which a user interacts, note that backend is that part that involves API calls, database connectivity, authentication and so on, and a framework in literal sense means an essential supporting structure of an object, the object is a website in this case.
What's Front End Frameworks? Here's the complete guide to understand the best front end frameworks.
-
-
www.kirillvasiltsov.com www.kirillvasiltsov.com
-
We also need at least something in our CSS that can be set from outside. CSS custom properties are a great fit for this!
-
- Oct 2021
-
materializecss.com materializecss.com
-
We did most of the heavy lifting for you to provide a default stylings that incorporate our custom components.
(The English here sounds awkward.)
Gyuri Lajos, in the Stop Reset Go team, recommended using Materialize CSS.
If it is based on Google’s Material Design, there are a lot of resources available to explore the possibilities. If I was building a Progressive Web App, this might be the place to start.
The project appears to be at an early stage of development, with a 1.0.0 release.
-
-
materializecss.com materializecss.com
-
Created and designed by Google, Material Design is a design language that combines the classic principles of successful design along with innovation and technology.
-
-
themes.materializecss.com themes.materializecss.comGallery1
-
getuikit.com getuikit.comUIkit1
-
A lightweight and modular front-end framework for developing fast and powerful web interfaces.
So far, this is one of the most complete web design frameworks that I have encountered. The list of components is extensive.
-
- Sep 2021
-
tailwindcss.com tailwindcss.com
-
If you can suppress the urge to retch long enough to give it a chance, I really think you'll wonder how you ever worked with CSS any other way.
-
-
www.freecodecamp.org www.freecodecamp.org
- Aug 2021
-
-
The most likely cause of this problem is having set the height of an element to be 100% of the page somewhere in your CSS. This is normally on the html or body elements, but it could be on any element in the page. This can sometimes be got around by using the taggedElement height calculation method and added a data-iframe-height attribute to the element that you want to define the bottom position of the page. You may find it useful to use position: relative on this element to define a bottom margin or allow space for a floating footer.
-
-
destroytoday.com destroytoday.com
-
With JavaScript, you can actually calculate the width of the scrollbar and whether it’s visible by comparing two properties—window.innerWidth and document.body.clientWidth. If these are equal, the scrollbar isn’t visible. If these are different, we can subtract the body width from the window width to get the width of the scrollbar:const scrollbarWidth = window.innerWidth - document.body.clientWidthWe’ll want to perform this both on page load and on resize, in case someone resizes the window vertically and changes the overflow. Then, once we have the scrollbar width, we can assign it as a CSS variable:document.body.setProperty("--scrollbarWidth", `${scrollbarWidth}px`)
missing feature: vw/vh can't be used "directly" because doesn't account for scrollbars
-
-
www.joshwcomeau.com www.joshwcomeau.com
-
- Jul 2021
-
www.w3.org www.w3.org
-
dated 95/10/10
Correction: 94/10/10
-
- Jun 2021
-
stackoverflow.com stackoverflow.com
-
If you don't need to support IE9 or lower, you can use flexbox freely, and don't need to use floated layouts.
-
- May 2021
-
www.pixelartcss.com www.pixelartcss.com
-
This is a cool little tool for turning self-made pixel art to CSS.
Tags
Annotators
URL
-
-
forum.obsidian.md forum.obsidian.md
-
Task lists [x] can now contain any character to indicate a completed task, instead of just x. This value can be used by custom CSS to change the appearance of the check mark, and is also available for plugins to use.
I'll need to create some custom CSS for these in the past as I've used:
- [>] to indicate that an item was pushed forward
- [?] to indicate something I'm not sure was done in retrospect (typically for a particular day)
- others?
-
-
mxb.dev mxb.dev
-
This looks cool! I can think of some interesting applications, but the example here is pretty slick.
-
-
stackoverflow.com stackoverflow.com
-
You need to use the :target pseudo-class: :target { background-color: #ffa; }
-
-
stackoverflow.com stackoverflow.com
-
Negative margins are in many cases equivalent to position:relative; with negative position, e.g. position:relative; top:-100px, as in Guffa's answer.
-
-
stackoverflow.com stackoverflow.com
-
Negative margins get removed by Gmail and others. So, no negative margins.
-
-
stackoverflow.com stackoverflow.com
-
You can't use negative margin in html email. To mimic this, there are 2 ways to do it, the nested tables way and the more complex rowspan way:
-
gmail and other mail services are ignoring the negative margin.
-
-
stackoverflow.com stackoverflow.com
-
Negative values are mostly unsupported in html email. So is CSS position. For webmail at least, this is so that your email doesn't render outside of the desired window. Imagine Gmail with your CSS or email affecting the interface - they've limited the CSS you can use specifically to prevent this.
-
-
hashnode.com hashnode.com
-
No, most css doesn't work in emails, stick to tables and images.
-
Honestly, even without flexbox support, most of the layout problems would be solved with simple-basic CSS3 support that is standard in all clients.
layout problems don't need ; all we need is simple-basic CSS3 support that is standard in all clients.
-
-
hashnode.com hashnode.com
-
But more so, external style cannot be applied to a subsection of a web page unless they force it into an iframe, which has all sorts of issues of it's own which is why external CSS is usually ignored. Inline CSS is often stripped by the tag strippers who don't want you turning things on or off... and media queries shouldn't even play into it since the layout should be controlled by the page it's being shown inside (for webmail) or the client itself, NOT your mail.
-
-
litmus.com litmus.com
-
iOS 9 and 10 support @supports. Make sure your ESP is not stripping it, or feel free to share your code so we can help you.
-
-
www.hteumeuleu.com www.hteumeuleu.com
-
As a conclusion, I’d say that Flexbox in an email unfortunately causes more troubles than it helps solving.
-
-
-
developer.mozilla.org developer.mozilla.org
-
css-tricks.com css-tricks.com
-
-
/* referencing path from an inline SVG */ clip-path: url(#c1);
first sighting: referencing image by ID in CSS
-
-
codepen.io codepen.io
-
-
-
This media query only targets WebKit-supported email clients—which have incredible support for HTML5 and CSS3. This media query allows you to use of modern techniques like HTML5 video, CSS3 animation, web fonts, and more.
-
-
content.myemma.com content.myemma.com
-
Embedded CSS: This style is becoming more popular with the rise of mobile and responsive emails. Embedded CSS codes are determined in one place of an email, generally in the <head> section as a <style>. Some email servers still strip the information out of this section, which can cause display problems.
-
-
-
stackoverflow.com stackoverflow.com
-
I would try designing your mail-template as "normal" as possible. Tables help a lot for example (yuck).
-
-
css-tricks.com css-tricks.com
-
stackoverflow.com stackoverflow.com
-
Use this tool to do to convert internal and external style into inline for you: http://inlinestyler.torchboxapps.com/styler/
-
- Apr 2021
-
www.michaelbransonsmith.net www.michaelbransonsmith.net
-
www.michaelbransonsmith.net www.michaelbransonsmith.net
-
developer.mozilla.org developer.mozilla.org
-
list-style
-
-
css-tricks.com css-tricks.com
-
list-style: "✓ " outside none;
Tags
Annotators
URL
-
-
blog.steren.fr blog.steren.fr
-
-
The best tool is no tool, the best build step is no build step, the best update is no update. HTML gives us all that, and more.
Truth!
-
-
stackoverflow.com stackoverflow.com
-
It should be defined inline. If you are using the img tag, that image should have semantic value to the content, which is why the alt attribute is required for validation. If the image is to be part of the layout or template, you should use a tag other than the img tag and assign the image as a CSS background to the element. In this case, the image has no semantic meaning and therefore doesn't require the alt attribute. I'm fairly certain that most screen readers would not even know that a CSS image exists.
I believed this when I first read it, but changed my mind when I read this good rebuttal: https://hyp.is/f1ndKJ5eEeu_IBtubiLybA/stackoverflow.com/questions/640190/image-width-height-as-an-attribute-or-in-css
-
What's the "correct" semantic way to specify image height and width? In CSS... width:15px; or inline... <img width="15" ?
-
-
laurakalbag.com laurakalbag.com
-
Custom CSS to make Twitter write-only! How awesome is this?
Tags
Annotators
URL
-
-
highlights.melanie-richards.com highlights.melanie-richards.com
-
I LOVE the hover effects for the book covers on this site which is also a great example of someone collecting highlights/annotations of the books they read and hosting them in public on their personal website.
Melanie has written about the CSS part of the hover effect here: https://melanie-richards.com/blog/highlights-minisite/ and like all awesome things, she's got the site open at https://github.com/melanierichards/highlights. I may have to do some serious digging for figuring out how she's creating the .svg images for the covers though.
-
-
css-tricks.com css-tricks.com
-
css-tricks.com css-tricks.com
Tags
Annotators
URL
-
-
css-tricks.com css-tricks.com
-
css-tricks.com css-tricks.com
-
css-tricks.com css-tricks.com
-
css-tricks.com css-tricks.com
-
-
But floats are still useful and relevant! In fact, we have to use them for the shape-outside property to work.
first sighting: shape-outside
-
Now that we’ve gotten newer layout features — again, like grid and flexbox — floats, too, have sort of fallen by the wayside, perhaps either because there are better ways to accomplish what they do
-
-
css-tricks.com css-tricks.com
-
-
This way the text will wrap above the shape even though the div extends to the top.
-
shape-outside: inset(100px 100px 100px 100px 10px);
-
It might be better to think of it this way: with the shape-outside property we’re changing the relationship of other elements around an element, not the geometry of the element itself.
-
-
developer.mozilla.org developer.mozilla.org
-
interactive-examples.mdn.mozilla.net interactive-examples.mdn.mozilla.net
-
stackoverflow.com stackoverflow.com
-
vertical-align: -50%;
-
- Mar 2021
-
-
Last week, I shared how to check if an input is empty with CSS. Today, let’s talk about the same thing, but with JavaScript.
-
-
stackoverflow.com stackoverflow.com
-
The :empty selector refers only to child nodes, not input values. [value=""] does work; but only for the initial state. This is because a node's value attribute (that CSS sees), is not the same as the node's value property (Changed by the user or DOM javascript, and submitted as form data).
-
You can use the :placeholder-shown pseudo class. Technically a placeholder is required, but you can use a space instead.
-
Generally, CSS selectors refer to markup or, in some cases, to element properties as set with scripting (client-side JavaScript), rather than user actions. For example, :empty matches element with empty content in markup; all input elements are unavoidably empty in this sense. The selector [value=""] tests whether the element has the value attribute in markup and has the empty string as its value. And :checked and :indeterminate are similar things. They are not affected by actual user input.
-
The selector [value=""] tests whether the element has the value attribute in markup and has the empty string as its value.
-
-
css-tricks.com css-tricks.com
-
-
it does require some CSS trickery to get everything just right
-
You can’t use @supports for selectors, only property/values (e.g. @supports (display: flex))
first sighting CSS: @supports
-
You can do and impressive amount of form validation with just HTML attributes. You can make the user experience pretty clean and clear with CSS selectors.
-