小编Dev*_*ock的帖子

为什么align-content/align-items不在这里工作?

所以我只是想制作一个简单的导航栏,我刚刚开始使用flexbox.为什么不在align-content这里工作?我可以开始justify-content工作,但我无法垂直对齐.这是代码.

* {
    margin: 0;
    padding: 0;
}

#Navbar_Wrapper {

}

#Navbar {
    width: 100%;
    height: 300px;
    background: darkslategray;
}

#Navbar_Content_Wrapper {
    width: 100%;
    display: flex;
    list-style: none;
    justify-content: center;
    align-content: center;
}

#Navbar_Content_Wrapper li {
    display: inline-block;
}

#Navbar_Content_Wrapper a {
    color: white;
    font: 16px normal Arial;
    text-decoration: none;
    padding: 5px 10px 5px 0px;
}
Run Code Online (Sandbox Code Playgroud)
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" type="text/css" href="CSS Files/Navbar.css"/>
</head>
<body>
<section id="Navbar_Wrapper">
    <div id="Navbar">
        <div …
Run Code Online (Sandbox Code Playgroud)

html css html5 css3 flexbox

10
推荐指数
1
解决办法
2万
查看次数

标签 统计

css ×1

css3 ×1

flexbox ×1

html ×1

html5 ×1