需要帮助对齐NETFLIX,选择标签,并在一行登录按钮
P粉769045426
P粉769045426 2023-08-02 16:46:59
0
1
461
<p>我试过显示:flex;font - family:宋体;我也试过改变宽度,高度,显示-内联,内联-块,但无法解决。</p> <pre class="brush:php;toolbar:false;"><!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Clone@Netflix</title> <link rel="stylesheet" href="netflix.css"> </head> <body> <header> <nav class="navigation"> <h2>NETFLIX</h2> <span class="language"> <select name="#" id="lang_inner"> <option value="en">English</option> <option value="hi">Hindi</option> <option value="ar">Arabic</option> <option value="es">Espaniol</option> </select> </span> <button class="signin_button">Sign in</button> </nav> </header> </body> </html></pre> <pre class="brush:php;toolbar:false;">*{ margin:0; padding:0; box-sizing: border-box; font-family: sans-serif; } header{ position:absolute; display:flex; justify-content: space-between; align-items: center; height:100vh; width: 100%; }</pre> <p><br /></p>
P粉769045426
P粉769045426

全部回复(1)
P粉879517403

你可以用float: left;:


*{
    margin:0;
    padding:0;
    box-sizing: border-box;
    font-family: sans-serif;
}
header{
    position:absolute;
    display:flex;
    justify-content: space-between;
    align-items: center;
    height:100vh;
    width: 100%;
}

header .navigation * {
    float: left;
}

header .navigation > :not(h2) {
    margin-top: 5px;
}
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Clone@Netflix</title>
    <link rel="stylesheet" href="netflix.css">
</head>

<body>
    <header>
        <nav class="navigation">
            <h2>NETFLIX</h2>
            <span class="language">
                <select name="#" id="lang_inner">
                    <option value="en">English</option>
                    <option value="hi">Hindi</option>
                    <option value="ar">Arabic</option>
                    <option value="es">Espaniol</option>
                </select>
            </span>
            <button class="signin_button">Sign in</button>
        </nav>
    </header>
</body>

</html>


热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板