#DigitalOcean
Explore tagged Tumblr posts
Text
Revisiting CSS Multi-Column Layout
New Post has been published on https://thedigitalinsider.com/revisiting-css-multi-column-layout/
Revisiting CSS Multi-Column Layout
Honestly, it’s difficult for me to come to terms with, but almost 20 years have passed since I wrote my first book, Transcending CSS. In it, I explained how and why to use what was the then-emerging Multi-Column Layout module.
Hint: I published an updated version, Transcending CSS Revisited, which is free to read online.
Perhaps because, before the web, I’d worked in print, I was over-excited at the prospect of dividing content into columns without needing extra markup purely there for presentation. I’ve used Multi-Column Layout regularly ever since. Yet, CSS Columns remains one of the most underused CSS layout tools. I wonder why that is?
Holes in the specification
For a long time, there were, and still are, plenty of holes in Multi-Column Layout. As Rachel Andrew — now a specification editor — noted in her article five years ago:
“The column boxes created when you use one of the column properties can’t be targeted. You can’t address them with JavaScript, nor can you style an individual box to give it a background colour or adjust the padding and margins. All of the column boxes will be the same size. The only thing you can do is add a rule between columns.”
She’s right. And that’s still true. You can’t style columns, for example, by alternating background colours using some sort of :nth-column() pseudo-class selector. You can add a column-rule between columns using border-style values like dashed, dotted, and solid, and who can forget those evergreen groove and ridge styles? But you can’t apply border-image values to a column-rule, which seems odd as they were introduced at roughly the same time. The Multi-Column Layout is imperfect, and there’s plenty I wish it could do in the future, but that doesn’t explain why most people ignore what it can do today.
Patchy browser implementation for a long time
Legacy browsers simply ignored the column properties they couldn’t process. But, when Multi-Column Layout was first launched, most designers and developers had yet to accept that websites needn’t look the same in every browser.
Early on, support for Multi-Column Layout was patchy. However, browsers caught up over time, and although there are still discrepancies — especially in controlling content breaks — Multi-Column Layout has now been implemented widely. Yet, for some reason, many designers and developers I speak to feel that CSS Columns remain broken. Yes, there’s plenty that browser makers should do to improve their implementations, but that shouldn’t prevent people from using the solid parts today.
Readability and usability with scrolling
Maybe the main reason designers and developers haven’t embraced Multi-Column Layout as they have CSS Grid and Flexbox isn’t in the specification or its implementation but in its usability. Rachel pointed this out in her article:
“One reason we don’t see multicol used much on the web is that it would be very easy to end up with a reading experience which made the reader scroll in the block dimension. That would mean scrolling up and down vertically for those of us using English or another vertical writing mode. This is not a good reading experience!”
That’s true. No one would enjoy repeatedly scrolling up and down to read a long passage of content set in columns. She went on:
“Neither of these things is ideal, and using multicol on the web is something we need to think about very carefully in terms of the amount of content we might be aiming to flow into our columns.”
But, let’s face it, thinking very carefully is what designers and developers should always be doing.
Sure, if you’re dumb enough to dump a large amount of content into columns without thinking about its design, you’ll end up serving readers a poor experience. But why would you do that when headlines, images, and quotes can span columns and reset the column flow, instantly improving readability? Add to that container queries and newer unit values for text sizing, and there really isn’t a reason to avoid using Multi-Column Layout any longer.
A brief refresher on properties and values
Let’s run through a refresher. There are two ways to flow content into multiple columns; first, by defining the number of columns you need using the column-count property:
Second, and often best, is specifying the column width, leaving a browser to decide how many columns will fit along the inline axis. For example, I’m using column-width to specify that my columns are over 18rem. A browser creates as many 18rem columns as possible to fit and then shares any remaining space between them.
Then, there is the gutter (or column-gap) between columns, which you can specify using any length unit. I prefer using rem units to maintain the gutters’ relationship to the text size, but if your gutters need to be 1em, you can leave this out, as that’s a browser’s default gap.
The final column property is that divider (or column-rule) to the gutters, which adds visual separation between columns. Again, you can set a thickness and use border-style values like dashed, dotted, and solid.
These examples will be seen whenever you encounter a Multi-Column Layout tutorial, including CSS-Tricks’ own Almanac. The Multi-Column Layout syntax is one of the simplest in the suite of CSS layout tools, which is another reason why there are few reasons not to use it.
Multi-Column Layout is even more relevant today
When I wrote Transcending CSS and first explained the emerging Multi-Column Layout, there were no rem or viewport units, no :has() or other advanced selectors, no container queries, and no routine use of media queries because responsive design hadn’t been invented.
We didn’t have calc() or clamp() for adjusting text sizes, and there was no CSS Grid or Flexible Box Layout for precise control over a layout. Now we do, and all these properties help to make Multi-Column Layout even more relevant today.
Now, you can use rem or viewport units combined with calc() and clamp() to adapt the text size inside CSS Columns. You can use :has() to specify when columns are created, depending on the type of content they contain. Or you might use container queries to implement several columns only when a container is large enough to display them. Of course, you can also combine a Multi-Column Layout with CSS Grid or Flexible Box Layout for even more imaginative layout designs.
Using Multi-Column Layout today
Patty Meltt is an up-and-coming country music sensation. She’s not real, but the challenges of designing and developing websites like hers are.
My challenge was to implement a flexible article layout without media queries which adapts not only to screen size but also whether or not a <figure> is present. To improve the readability of running text in what would potentially be too-long lines, it should be set in columns to narrow the measure. And, as a final touch, the text size should adapt to the width of the container, not the viewport.
Article with no <figure> element. What would potentially be too-long lines of text are set in columns to improve readability by narrowing the measure.
Article containing a <figure> element. No column text is needed for this narrower measure.
The HTML for this layout is rudimentary. One <section>, one <main>, and one <figure> (or not:)
<section> <main> <h1>About Patty</h1> <p>…</p> </main> <figure> <img> </figure> </section>
I started by adding Multi-Column Layout styles to the <main> element using the column-width property to set the width of each column to 40ch (characters). The max-width and automatic inline margins reduce the content width and center it in the viewport:
main margin-inline: auto; max-width: 100ch; column-width: 40ch; column-gap: 3rem; column-rule: .5px solid #98838F;
Next, I applied a flexible box layout to the <section> only if it :has() a direct descendant which is a <figure>:
section:has(> figure) display: flex; flex-wrap: wrap; gap: 0 3rem;
This next min-width: min(100%, 30rem) — applied to both the <main> and <figure> — is a combination of the min-width property and the min() CSS function. The min() function allows you to specify two or more values, and a browser will choose the smallest value from them. This is incredibly useful for responsive layouts where you want to control the size of an element based on different conditions:
section:has(> figure) main flex: 1; margin-inline: 0; min-width: min(100%, 30rem); section:has(> figure) figure flex: 4; min-width: min(100%, 30rem);
What’s efficient about this implementation is that Multi-Column Layout styles are applied throughout, with no need for media queries to switch them on or off.
Adjusting text size in relation to column width helps improve readability. This has only recently become easy to implement with the introduction of container queries, their associated values including cqi, cqw, cqmin, and cqmax. And the clamp() function. Fortunately, you don’t have to work out these text sizes manually as ClearLeft’s Utopia will do the job for you.
My headlines and paragraph sizes are clamped to their minimum and maximum rem sizes and between them text is fluid depending on their container’s inline size:
h1 font-size: clamp(5.6526rem, 5.4068rem + 1.2288cqi, 6.3592rem); h2 font-size: clamp(1.9994rem, 1.9125rem + 0.4347cqi, 2.2493rem); p font-size: clamp(1rem, 0.9565rem + 0.2174cqi, 1.125rem);
So, to specify the <main> as the container on which those text sizes are based, I applied a container query for its inline size:
main container-type: inline-size;
Open the final result in a desktop browser, when you’re in front of one. It’s a flexible article layout without media queries which adapts to screen size and the presence of a <figure>. Multi-Column Layout sets text in columns to narrow the measure and the text size adapts to the width of its container, not the viewport.
Modern CSS is solving many prior problems
Structure content with spanning elements which will restart the flow of columns and prevent people from scrolling long distances.
Prevent figures from dividing their images and captions between columns.
Almost every article I’ve ever read about Multi-Column Layout focuses on its flaws, especially usability. CSS-Tricks’ own Geoff Graham even mentioned the scrolling up and down issue when he asked, “When Do You Use CSS Columns?”
“But an entire long-form article split into columns? I love it in newspapers but am hesitant to scroll down a webpage to read one column, only to scroll back up to do it again.”
Fortunately, the column-span property — which enables headlines, images, and quotes to span columns, resets the column flow, and instantly improves readability — now has solid support in browsers:
h1, h2, blockquote column-span: all;
But the solution to the scrolling up and down issue isn’t purely technical. It also requires content design. This means that content creators and designers must think carefully about the frequency and type of spanning elements, dividing a Multi-Column Layout into shallower sections, reducing the need to scroll and improving someone’s reading experience.
Another prior problem was preventing headlines from becoming detached from their content and figures, dividing their images and captions between columns. Thankfully, the break-after property now also has widespread support, so orphaned images and captions are now a thing of the past:
figure break-after: column;
Open this final example in a desktop browser:
You should take a fresh look at Multi-Column Layout
Multi-Column Layout isn’t a shiny new tool. In fact, it remains one of the most underused layout tools in CSS. It’s had, and still has, plenty of problems, but they haven’t reduced its usefulness or its ability to add an extra level of refinement to a product or website’s design. Whether you haven’t used Multi-Column Layout in a while or maybe have never tried it, now’s the time to take a fresh look at Multi-Column Layout.
#:has#ADD#almanac#Article#Articles#back up#background#book#box#browser#challenge#clamp#colours#columns#container#content#course#creators#CSS#CSS Grid#css-tricks#Design#designers#desktop#developers#digitalocean#display#easy#English#Explained
2 notes
·
View notes
Text
Working on building my new site using #pixieset cause I want something reliable and not my never ending side project #digitalocean droplet 😮💨
0 notes
Text
#hostingblackfriday#blackfridaydeals2024#hostingservices#hostinger#wpxhosting#Namecheap#hosting#DigitalOcean#Cloudways#besthosting#smallbusinessbigdreams#wordpresswebsite#wordpressdesign#WordPressHosting#AffordableHosting#cheapesthosting#cheaphosting#webhosting#buyhosting#bestwebhosting#besthostingprovider
0 notes
Text
Top 10 Alternatives and Competitors to Amazon Web Services (AWS)
AWS is Amazon’s cloud service that provides fast, flexible, and affordable solutions for building and running apps online. It has many tools you can use to create and manage your applications. But AWS has some limits and changes in performance depending on where you are and the hardware it uses. This can affect how well your application works. Here is a list of the top alternatives to AWS. These…
#Amazon Web Services#AWS#aws alternatives#aws competitors#Cloudways#Digitalocean#Google Cloud#Hostinger#Kamatera#Linode#LiquidWeb#Microsoft Azure#OVHcloud#ScalaHosting#Vultr
1 note
·
View note
Text
Overriding netplan config managed by cloud-init on an existing Digital Ocean Ubuntu droplet
(please excluse any bad formatting, still haven't moved this away from tumblr...)
I saw a bunch of suggestions out there for doing this which have you entirely disable cloud-init's management of the network settings. I didn't want to do that, I just want to change the DNS servers away from DO's default of Google's DNS and to a local unbound service running on the droplet.
It's easy enough to edit /etc/systemd/resolved.conf and set DNS= there, but that still leaves Google's servers in the netplan config for the default interface which may be used as fallback.
Here's the relevant part of the netplan config on a Ubuntu 24.04:
# /etc/netplan/50-cloud-init.yaml network: version: 2 ethernets: eth0: match: macaddress: ... addresses: - ... nameservers: addresses: - 8.8.8.8 - 8.8.4.4 search: []
It doesn't look like simply dropping a new network configuration in /etc/cloud/cloud.cfg.d/ will do what I want. It doesn't seem to do anything at all (local configs run too early/late?), but even if it did, I'm also concerned it might overwrite the whole netplan config I'm trying to preserve. So instead, I'm going to use the runcmd directive to call netplan directly.
I added the following to /etc/cloud/cloud.cfg.d/99-local-dns.cfg:
#cloud-config runcmd: - | netplan set network.ethernets.eth0.nameservers=null \ && netplan set network.ethernets.eth0.nameservers="{ \ addresses: [127.0.0.1], \ search: [] \ }" \ && netplan apply
The reason I'm setting nameservers to null instead of setting nameservers.addresses directly is because "netplan set" will simply append when applied to a list.
Rebooted, and confirmed.
# /etc/netplan/50-cloud-init.yaml network: version: 2 ethernets: eth0: match: macaddress: ... addresses: - ... nameservers: addresses: - 127.0.0.1 search: []
$ resolvectl status ... Link 2 (eth0) Current Scopes: DNS Protocols: +DefaultRoute -LLMNR -mDNS -DNSOverTLS DNSSEC=yes/supported Current DNS Server: 127.0.0.1 DNS Servers: 127.0.0.1 ...
0 notes
Photo

VPS: 12 Step to Create and Secure a Virtual Private Server on DigitalOcean
#VPS#DigitalOcean#CloudComputing#ServerManagement#VPSsecurity#Cybersecurity#SecureServer#Dataprotection#CreateAVPS#DigitalOceanTutorial#VPSGuide#CloudSetup
0 notes
Link
The cloud ☁️ of choice for developers, startups, and growing digital businesses around the world.
#software #product #technology @digitalocean
0 notes
Text
Digital Ocean Review: All You Need to Know Before Buying
1 note
·
View note
Text
Explore the world of cloud hosting with Digital Ocean: Droplets, Kubernetes, and more, brought to you by Coupon Stopper. Dive into the versatility and scalability of Digital Ocean's cloud infrastructure, including Droplets for reliable virtual machines and Kubernetes for seamless container orchestration. Learn how Digital Ocean empowers developers and businesses with flexible solutions tailored to their unique needs. From deploying web applications to managing data workloads, Coupon Stopper's guide covers everything you need to know about leveraging Digital Ocean's cloud services effectively. Stay ahead in the digital landscape with Digital Ocean and Coupon Stopper.
#DigitalOcean#CloudHosting#Droplets#Kubernetes#CouponStopper#Infrastructure#VirtualMachines#ContainerOrchestration#Developers#Businesses
0 notes
Text
A Few Ways That Cloudways Makes Running This Site a Little Easier
New Post has been published on https://thedigitalinsider.com/a-few-ways-that-cloudways-makes-running-this-site-a-little-easier/
A Few Ways That Cloudways Makes Running This Site a Little Easier
It’s probably no surprise to you that CSS-Tricks is (proudly) hosted on Cloudways, DigitalOcean’s managed hosting arm. Given both CSS-Tricks and Cloudways are part of DigitalOcean, it was just a matter of time before we’d come together this way. And here we are!
We were previously hosted on Flywheel which was a fairly boutique WordPress hosting provider until WP Engine purchased it years back. And, to be very honest and up-front, Flywheel served us extremely well. There reached a point when it became pretty clear that CSS-Tricks was simply too big for Flywheel to scale along. That might’ve led us to try out WP Engine in the absence of Cloudways… but it’s probably good that never came to fruition considering recent events.
Anyway, moving hosts always means at least a smidge of contest-switching. Different server names with different configurations with different user accounts with different controls.
We’re a pretty low-maintenance operation around here, so being on a fully managed host is a benefit because I see very little of the day-to-day nuance that happens on our server. The Cloudways team took care of all the heavy lifting of migrating us and making sure we were set up with everything we needed, from SFTP accounts and database access to a staging environment and deployment points.
Our development flow used to go something like this:
Fire up Local (Flywheel’s local development app)
Futz around with local development
Push to main
Let a CI/CD pipeline publish the changes
I know, ridiculously simple. But it was also riddled with errors because we didn’t always want to publish changes on push. There was a real human margin of error in there, especially when handling WordPress updates. We could have (and should have) had some sort of staging environment rather than blindly trusting what was working locally. But again, we’re kinduva a ragtag team despite the big corporate backing.
The flow now looks like this:
Fire up Local (we still use it!)
Futz around with local development
Push to main
Publish to staging
Publish to production
This is something we could have set up in Flywheel but was trivial with Cloudways. I gave up some automation for quality assurance’s sake. Switching environments in Cloudways is a single click and I like a little manual friction to feel like I have some control in the process. That might not scale well for large teams on an enterprise project, but that’s not really what Cloudways is all about — that’s why we have DigitalOcean!
See that baseline-status-widget branch in the dropdown? That’s a little feature I’m playing with (and will post about later). I like that GitHub is integrated directly into the Cloudways UI so I can experiment with it in whatever environment I want, even before merging it with either the staging or master branches. It makes testing a whole lot easier and way less error-prone than triggering auto-deployments in every which way.
Here’s another nicety: I get a good snapshot of the differences between my environments through Cloudways monitoring. For example, I was attempting to update our copy of the Gravity Forms plugin just this morning. It worked locally but triggered a fatal in staging. I went in and tried to sniff out what was up with the staging environment, so I headed to the Vulnerability Scanner and saw that staging was running an older version of WordPress compared to what was running locally and in production. (We don’t version control WordPress core, so that was an easy miss.)
I hypothesized that the newer version of Gravity Forms had a conflict with the older version of WordPress, and this made it ridiculously easy to test my assertion. Turns out that was correct and I was confident that pushing to production was safe and sound — which it was.
That little incident inspired me to share a little about what I’ve liked about Cloudways so far. You’ll notice that we don’t push our products too hard around here. Anytime you experience something delightful — whatever it is — is a good time to blog about it and this was clearly one of those times.
I’d be remiss if I didn’t mention that Cloudways is ideal for any size or type of WordPress site. It’s one of the few hosts that will let you BOYO cloud, so to speak, where you can hold your work on a cloud server (like a DigitalOcean droplet, for instance) and let Cloudways manage the hosting, giving you all the freedom to scale when needed on top of the benefits of having a managed host. So, if you need a fully managed, autoscaling hosting solution for WordPress like we do here at CSS-Tricks, Cloudways has you covered.
#Accounts#app#arm#automation#Blog#CI/CD#Cloud#cloudways#Conflict#CSS#css-tricks#Database#deployment#development#digitalocean#dropdown#easy#engine#enterprise#Environment#Events#Forms#friction#github#Giving#gravity#Hosting#hosting provider#human#incident
2 notes
·
View notes
Text
makes me want to take a dip
fallen star
2K notes
·
View notes
Text
🚀 Unlock $200 in Free Credits with DigitalOcean! 🌐
Hey friends! 👋 Exciting news – I've partnered with DigitalOcean to bring you an exclusive offer! 🎉 Sign up using my referral link, and you'll receive $200 in free credits to explore DigitalOcean's powerful cloud platform.
🔗 from her DigitalOcean
Why choose DigitalOcean?
✨ Simplicity: User-friendly interface for hassle-free deployment.
💰 Cost-Effective: Competitive pricing with transparent billing.
🚀 Developer-Friendly: Robust tools for seamless application management.
How to claim your $200 credit:
1️⃣ Click on the referral link: her
2️⃣ Sign up for a DigitalOcean account.
3️⃣ Redeem your $200 credit in the Billing section.
#DigitalOcean#server#cloud#html#css#js#javascript#php#python#code#django#react#admn#theme#themezoz#themezoz.com#template#templates#ai#ml#now#today
1 note
·
View note
Text
Blog Application Using DigitalOcean Functions| AntStack
DigitalOcean Functions is a fast, scalable, and cost-effective serverless compute solution that enables you to build quickly, scale automatically, and save costs by removing the need to pay for idle resources. Functions are snippets of code that run in response to event-based triggers, and it allows developers to create serverless functions for a variety of purposes, including serverless APIs for your web apps and mobile apps.
0 notes
Text
1 note
·
View note
Text
DigitalOcean Review - Are They Really One of The Best?
DigitalOcean is a cloud infrastructure provider that offers scalable and developer-friendly cloud computing services. With a focus on simplicity and ease of use, DigitalOcean provides developers and businesses with the tools and resources to deploy, manage, and scale their applications and websites effortlessly. From virtual machines (Droplets) and managed databases to object storage and…

View On WordPress
0 notes