21st Oct 2024, 5:55 AM
Elena
Elena - avatar
6 Antworten
+ 1
But is it still an h3, though? h3{ display:grid; place-items:center; background-color:#8b7487; width:100px; height:100px; text-align:center; }
21st Oct 2024, 6:14 AM
Bob_Li
Bob_Li - avatar
+ 1
Elena width and height needs units, not pure numbers. 100px not 100 also, proper formatting helps in readability. Try to put the properties on different lines. The problem with css is that errors are ignored, so you have to be extra careful or debugging is hard.
21st Oct 2024, 7:24 AM
Bob_Li
Bob_Li - avatar
+ 1
Thank you
21st Oct 2024, 9:03 AM
Elena
Elena - avatar
+ 1
perhaps something like this? use a div instead, so you can still use h3 for other things. I opted for a javascript solution because it is more versatile and animations can be reset after it is played. This is hard to do with pure css alone https://sololearn.com/compiler-playground/WuqiDCM0e9AT/?ref=app
21st Oct 2024, 9:07 AM
Bob_Li
Bob_Li - avatar
+ 1
That's pretty good. Thanks
21st Oct 2024, 9:10 AM
Elena
Elena - avatar
21st Oct 2024, 6:29 AM
Elena
Elena - avatar