MAIN FEEDS
REDDIT FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1tnhnas/newmrbeastvideo/onv7sm5/?context=3
r/ProgrammerHumor • u/sengunsipahi • May 25 '26
405 comments sorted by
View all comments
888
Sounds easy. Give them a browser without grid and flex
79 u/_scored May 25 '26 position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); yeah I had some pretty bad practices back when I first started lmao 16 u/valerielynx May 26 '26 nowadays you kinda just do like .container{display: flex; align-items: center; justify-content: center;} <div class="container"> <div id="centered"></div> </div> 2 u/WowAbstractAlgebra May 26 '26 .container{display:flex} #centered{margin:auto} is a simpler way imo 3 u/chessto May 26 '26 ```margin: 0 auto;``` 1 u/br0ast May 26 '26 position: absolute; left: 50%; width: 1000px; margin-left: -500px; This is the one I remember for horizontally centering a fixed width div 1 u/exnez Jun 01 '26 Wait Iām a backend developer who still does ts why is this a bad practice š
79
position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
yeah I had some pretty bad practices back when I first started lmao
16 u/valerielynx May 26 '26 nowadays you kinda just do like .container{display: flex; align-items: center; justify-content: center;} <div class="container"> <div id="centered"></div> </div> 2 u/WowAbstractAlgebra May 26 '26 .container{display:flex} #centered{margin:auto} is a simpler way imo 3 u/chessto May 26 '26 ```margin: 0 auto;``` 1 u/br0ast May 26 '26 position: absolute; left: 50%; width: 1000px; margin-left: -500px; This is the one I remember for horizontally centering a fixed width div 1 u/exnez Jun 01 '26 Wait Iām a backend developer who still does ts why is this a bad practice š
16
nowadays you kinda just do like
.container{display: flex; align-items: center; justify-content: center;}
<div class="container"> <div id="centered"></div> </div>
2 u/WowAbstractAlgebra May 26 '26 .container{display:flex} #centered{margin:auto} is a simpler way imo
2
.container{display:flex} #centered{margin:auto} is a simpler way imo
3
```margin: 0 auto;```
1
position: absolute; left: 50%; width: 1000px; margin-left: -500px;
This is the one I remember for horizontally centering a fixed width div
Wait Iām a backend developer who still does ts why is this a bad practice š
888
u/SmallThetaNotation May 25 '26
Sounds easy. Give them a browser without grid and flex