The very simple mistake that is in your CSS

If you add display: block to elements with position: absolute or position: fixed, please, you shouldn’t do that. Browsers always use block values by default.

Besides, the inline or inline-block value will be changed to block, inline-flex -> flex, …


This content originally appeared on DEV Community and was authored by Stas Melnikov

If you add display: block to elements with position: absolute or position: fixed, please, you shouldn't do that. Browsers always use block values by default.

Besides, the inline or inline-block value will be changed to block, inline-flex -> flex, inline-grid -> grid, and inline-table -> table.

don't do this

.example::before {
  content: "";
  display: block;
  position: absolute; 
  /* or
  position: fixed;
  */ 
}

you can use this instead

.example::before {
  content: "";
  position: absolute; 
  /* or
  position: fixed;
  */ 
}

P.S.
? If you want to be first who take my tips get my paid subscription on Patreon

? Also I make written CSS/HTML code review so that you don't make common mistakes. If you're interested in that chat me on melnik909@ya.ru or dev.to direct.

? Make a gift yourself or friends who like frontends: ? T-Shirt, ? Stickers, ? Masks, ? Magnets

P.S.S. This post was written with the support of my sponsors: Ashlea Gable, Ben Rinehart, Sergio Kagiema, Jesse Willard, Tanya Ten.


This content originally appeared on DEV Community and was authored by Stas Melnikov


Print Share Comment Cite Upload Translate Updates
APA

Stas Melnikov | Sciencx (2021-07-28T20:57:54+00:00) The very simple mistake that is in your CSS. Retrieved from https://www.scien.cx/2021/07/28/the-very-simple-mistake-that-is-in-your-css/

MLA
" » The very simple mistake that is in your CSS." Stas Melnikov | Sciencx - Wednesday July 28, 2021, https://www.scien.cx/2021/07/28/the-very-simple-mistake-that-is-in-your-css/
HARVARD
Stas Melnikov | Sciencx Wednesday July 28, 2021 » The very simple mistake that is in your CSS., viewed ,<https://www.scien.cx/2021/07/28/the-very-simple-mistake-that-is-in-your-css/>
VANCOUVER
Stas Melnikov | Sciencx - » The very simple mistake that is in your CSS. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/07/28/the-very-simple-mistake-that-is-in-your-css/
CHICAGO
" » The very simple mistake that is in your CSS." Stas Melnikov | Sciencx - Accessed . https://www.scien.cx/2021/07/28/the-very-simple-mistake-that-is-in-your-css/
IEEE
" » The very simple mistake that is in your CSS." Stas Melnikov | Sciencx [Online]. Available: https://www.scien.cx/2021/07/28/the-very-simple-mistake-that-is-in-your-css/. [Accessed: ]
rf:citation
» The very simple mistake that is in your CSS | Stas Melnikov | Sciencx | https://www.scien.cx/2021/07/28/the-very-simple-mistake-that-is-in-your-css/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.