[CSS] Create a self-centering, full-width stripe with CSS Grid

In this lesson, we'll take simple HTML and create a stripe with a full-width background color and centered content. We'll do all of this without adding an additional "wrapper" level in our HTML by using CSS Grid.

 

.stripe {
    background-color: lavender;
    padding: 2rem 1rem;

    
    display: grid;
    grid-template-columns: minmax(auto, 900px);
    justify-content: center;

}

 

posted @ 2020-04-21 02:44  Zhentiw  阅读(126)  评论(0编辑  收藏  举报