How to center the block in the block?

You can't center the news. In fact exercise creating news. At the start had 3 columns and 2 rows of news.

Specifically, the news is not responding to margin:auto; even set a specific size. But how to make them in the center? Without padding unit news__content

https://codepen.io/dunakov/pen/MxNzdo
March 19th 20 at 09:07
2 answers
March 19th 20 at 09:09
Of course the margin is not working. you did it absolute did. Make a flake, container
display: flex; justify-content: center; align-items: center;
and the inner element of the required size.
I forgot to write that the Flex has not juzat) - jake_Balistreri93 commented on March 19th 20 at 09:12
@jake_Balistreri93, then the absolute block
.news__content {
 position: absolute;
 top: 70px;
 left: 50%;
 transform: translateX(-50%);
 width: 300px;
}
- Rosemarie_Abbott commented on March 19th 20 at 09:15
And I removed the absolute positioning, it did not help - jake_Balistreri93 commented on March 19th 20 at 09:18
@Rosemarie_Abbott, And transform forbidden) In General, you need to first do purely on the float-Ah and position. - jake_Balistreri93 commented on March 19th 20 at 09:21
March 19th 20 at 09:11
Please

.news__content {
 width: calc(960px - 50px);
 position: absolute;
 top: 70px;
 right: 0;
 bottom: 0;
 left: 0;
 margin: 0 auto;
 }
Then there will be no reduction in the number of blocks in the line (jumping at the bottom)

Okay, I already said, there center are not necessary, so that the extra question was asked. But the huskies will throw all - jake_Balistreri93 commented on March 19th 20 at 09:14

Find more questions by tags HTMLCSS