Align the unit without a specific width in the middle?

Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
Link. The news block has no width and I want to align horizontally. How to do it?
by | 12 views

2 Answers

0 like 0 dislike
The news block is the width that it is 100%.
You can either align the content centered, or set the block width depending on the width of the content (10vw * 3) and align the block itself.
0 like 0 dislike
#news{ text-align: center; } #news{ position: absolute; left: 50%; transform: translateX(-50%); } #news{ display: flex; justify-content: center; }

Related questions

110,608 questions
257,187 answers
40,796 users