CSS tips you won't see in most tutorials.

🧵
1. When you work with transparent images you can use the `drop-shadow()` filter function to create a shadow on the image's content, instead of `box-shadow` property which creates a rectangular shadow behind an element's entire box:

filter: drop-shadow(2px 4px 8px #585858); Two images shown. One with rectangular shadow around whole i
2. Center anything

Easily center anything, horizontally and vertically, with 3 lines of CSS: ```css .center {   display: flex;   align-items: center;   j
3. Smooth scrolling

Smooth scrolling with zero JavaScript, with just one line of CSS. ```css html {   scroll-behavior: smooth; } ```
4. Typing Effect

Did you know that you can create a typing effect with zero JavaScript?

Demo and code:
codepen.io/denic/pen/GRoO…
5. Create beautiful gradient text: Preview of the codepen. Code:  ```html  <p>   Lorem ipsum, d
6. `caret-color`

You can change the color of the text input cursor. ```css input {   caret-color: red; } ```
7. CSS Scroll Snap

You can use the CSS Scroll Snap feature to create well-controlled scroll experiences:
8. Cursors

Did you know that you can use your own image, or even emoji as a cursor? ```css .my-cursor {   cursor: url('path-to-image.png'), auto
9. Truncate text

Truncate text with plain CSS. ```css .truncate {   white-space: nowrap;   overflow: hidden
10. The `::selection` CSS pseudo-element

The `::selection` CSS pseudo-element applies styles to the part of a document that has been highlighted by the user (such as clicking and dragging the mouse across text). ```css ::selection {     background-color: #8e44ad } ```
11. Use the `inset` CSS property as a shorthand for `top`, `right`, `bottom`, `left`: ```css /* Instead of doing this:*/ .class {   top: 0;   righ
12. Anything resizable

Did you know that you can make any element resizable, just like `<textarea>`? ```css .resize {   resize: both; } ```
13. Use the `gap` CSS property to set the gaps (gutters) between rows and columns. Codepen preview.  Code: ```html <div class="flex">
14. Use the `background-clip` property to create beautiful headlines. Codepen preview.   Code:   ```html <h1>CSS IS AWESOME</h1> `
15. Dynamic Tooltips

Create dynamic CSS-only tooltips, using the `attr()` CSS function. ```html <span class="tooltip" data-tooltip="T
Did you find this useful?

Retweet the 1st tweet and help others discover it.

Happy coding!
If you're learning HTML, CSS or JavaScript be sure to follow me and never miss tips like this.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Marko ⚡ Denic

Marko ⚡ Denic Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @denicmarko

17 Oct
Useful websites for web developers.

🧵
1. Mockuper (by Enrico Toniato)

The free mockups generator to create custom images to show your awesome projects.

Link: mockuper.net
2. Poet (by @reviews_experts)

Capture and share Twitter posts as beautiful images.

Link: poet.so
Read 8 tweets
7 Oct
CSS generators can save you a lot of time and effort.

🧵
1. Buttons CSS generator

100+ buttons you can use in your project.

Link: markodenic.com/tools/buttons-…
2. Neumorphism/Soft UI generator

CSS code generator that will help with colors, gradients, and shadows to adopt this new design trend or discover its possibilities.

Link: neumorphism.io
Read 12 tweets
5 Oct
10 JavaScript Array methods to simplify your code.

🧵
1. filter()

The `filter()` method creates a new array with all elements that pass the test implemented by the provided function.  ```javascript const words = ['HTML', 'CSS', 'JavaScript', '
2. forEach()

The `forEach()` method executes a provided function once for each array element. ```javascript const words = ['HTML', 'CSS', 'JavaScript'];
Read 13 tweets
1 Oct
HTML tips you won't see in most tutorials.

🧵
1. The `loading=lazy` attribute

You can use the `loading=lazy` attribute to defer the loading of the image until the user scrolls to them. <img src='image.jpg' loading='lazy' alt='Alternative Text'>
2. Use the `<datalist>` element to create native HTML autocomplete. Codepen preview.  HTML code:   <div class="wrapper"
Read 21 tweets
29 Sep
Useful websites for web developers.

🧵
1. Sidebar (@SidebarIO)

The five best design links, every weekday.

Link: sidebar.io
2. Public APIs (@publicapis)

A collective list of more than 1000 Free Public and Open REST APIs for developers.

LInk: public-apis.io
Read 9 tweets
22 Sep
Useful websites for web developers.

🧵
1. Vercel (@vercel)

Deploy web projects with the best frontend developer experience and highest end-user performance.

Link: vercel.com
2. UI Garage (@uigarage)

Daily handpicked UI inspiration & patterns.

Link: uigarage.net
Read 9 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(