3 experiments with CSS paper effects
Suzanne Aitchison

Suzanne Aitchison @s_aitchison

About: Software developer based in Edinburgh, working on Forem - the code that powers DEV 🌱

Location:
Edinburgh, Scotland
Joined:
Jul 17, 2019

3 experiments with CSS paper effects

Publish Date: Jan 8 '21
346 45

Over the last few days I've been playing around with a few paper-inspired CSS effects in CodePen, and thought I'd share!

Experiment 1: Folded paper with taped edges

Inspired by new year's resolutions (and my lack of them), for this experiment I had a play about with a folded paper effect, and transparent layers to look like sellotape (or whatever brand of tape is popular in your country 😂).

The folded paper effect is created with an ::after pseudo element (I used ::after instead of ::before to make sure the text looked like it had been folded in the paper too), with two layered linear-gradients - one running left to right, and another top to bottom.

The tape itself has opacity set to 0.5 to give the semi-transparent effect, and I added a small dotted border on the tape ends to make it look a little serrated like it'd been cut.

Experiment 2: Pinned card

I then wanted to play about with some less crumpled paper, and had a go at a pinned card. Sticking with the 'pop it on your noticeboard' theme, it just has a simple reminder about a zoom call on the card itself.

The fun part of this - of course - was the pin. I love a bit of CSS art 😄. The different components of the pin are commented in the code so you can see how I went about it (much like all these experiments, the CSS could very usefully be tidied up in future, but hopefully you'll get the idea!). Much like the folded paper, it relies primarily on linear, and this time radial, gradients to make it look a bit more 'life like'.

Experiment 3: "Contact me" tear-off paper

Remember in the old days when you'd see adverts on noticeboards/lamp-posts/wherever with little phone number slips you could rip off and take home? I thought it might be fun to try to make one in CSS as an alternative "contact" section.

I wanted to try and make this semantic and accessible, so the contact links are all marked up as list items (this makes sure they're announced as a list to screen reader users, and show as a nice vanilla list if the CSS fails to load). I've also made heavy use of rem units, as a slightly hacky way of making sure that if a user has a larger font-size set on their browser, the content scales up without affecting the "CSS art" of it 🙂

I've tried to make some of the paper slips stick out a bit more, as if they'd been folded out from the poster slightly. To do this I used skew and - yet again - some linear gradients. It would be cool to make this interactive at some point, to let a user "tear" an item off of the list. Maybe a future experiment!

Comments 45 total

  • Alvaro Montoro
    Alvaro MontoroJan 8, 2021

    These demos look great. And the last one is a really cool idea.

    • Suzanne Aitchison
      Suzanne AitchisonJan 8, 2021

      Thank you! I might keep noodling on the last one - I think there's something in it... maybe... but it's not quite there yet!

  • Thomas Bnt
    Thomas BntJan 8, 2021

    Beautiful! ☕

  • Waylon Walker
    Waylon WalkerJan 8, 2021

    Those folds are fantastic!

  • RealToughCandy.io
    RealToughCandy.ioJan 8, 2021

    The folded paper with taped edges is my favorite.

  • Nick Taylor
    Nick TaylorJan 8, 2021

    These look amazing! Nice work. 🔥

  • Gal Elmalah
    Gal ElmalahJan 8, 2021

    Really cool stuff!

  • hkly
    hklyJan 8, 2021

    These are great! I love the folded and taped effect!

    • Suzanne Aitchison
      Suzanne AitchisonJan 8, 2021

      Thanks! Now I need to work out how to make it look like the paper's torn or crumpled or something 🤔

  • Mohammed-Farrag
    Mohammed-FarragJan 8, 2021

    I like it

  •  My Code Magic
    My Code MagicJan 8, 2021

    Really I love 1 paper effect

  • Jasmin Virdi
    Jasmin VirdiJan 8, 2021

    This looks so amazing!❤️

  • Benjamin La Madrid
    Benjamin La MadridJan 8, 2021

    sweet!

  • Suzanne Aitchison
    Suzanne AitchisonJan 8, 2021

    Maybe we can tempt you over to the front end haha 😈

  • حسین عظیمی بیرجندی
    حسین عظیمی بیرجندی Jan 9, 2021

    It was great. You are the best

  • АнонимJan 9, 2021

    [deleted]

  • .
    .Jan 9, 2021

    wonderful look, thanks a lot.

  • Bhupesh Singh Nikhurpa
    Bhupesh Singh NikhurpaJan 9, 2021

    "Folded paper with taped edges" is the show stopper for me.

  • Lhoutre
    LhoutreJan 9, 2021

    Impressive work ! I'm inspired now 😊

  • Chris Cooper
    Chris CooperJan 9, 2021

    That looks so good

  • Anjil bishowkarma
    Anjil bishowkarmaJan 9, 2021

    nice work,

  • blakewood84
    blakewood84Jan 9, 2021

    This is good stuff! Impressed with your skills

  • Designer Anna
    Designer AnnaJan 10, 2021

    Nice CSS tricks. 👏🏼👏🏼👏🏼

  • Jakub Narębski
    Jakub NarębskiJan 13, 2021

    The "contact me" design looks nice... but unfortunately the addresses are highly unreadable.

    • Suzanne Aitchison
      Suzanne AitchisonJan 13, 2021

      Yes, I agree. Even at larger font sizes, rotating the text like that isn't very readable. Definitely more of an experiment than something immediately usable on a site 👍

  • Mariano Maison
    Mariano Maison Jan 13, 2021

    Awesome!

  • Phong Duong
    Phong DuongJan 13, 2021

    Very beautiful 👏

  • Aydın küçükoğlu
    Aydın küçükoğluJan 13, 2021

    Thank you

  • Júlio Santos
    Júlio SantosJan 13, 2021

    It's amazing. Good job.

  • allisonlu
    allisonluJan 13, 2021

    So cool! Thanks for sharing.

  • Eddie
    EddieJan 15, 2021

    Incredible work! Can I use this for my website?

    • Suzanne Aitchison
      Suzanne AitchisonJan 15, 2021

      Sure! If you want to do a straight copy paste, it'd be cool if you could maybe credit me in a wee code comment, but otherwise just have fun adjusting it and making it your own 😊

      • Eddie
        EddieJan 15, 2021

        Nice thanks and will do on the code attribution.

  • Pfc
    PfcJan 16, 2021

    Wow! Nice work

  • Natalia Chernysheva
    Natalia ChernyshevaAug 4, 2021

    Love the paper notes!!

  • Katy
    KatyOct 25, 2023

    These are so cool. Using the sellotape one for a school website I am building. Thank you!

Add comment