需要協助對齊NETFLIX,選擇標籤,並在一行登入按鈕
P粉769045426
P粉769045426 2023-08-02 16:46:59
0
1
447
<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>


#
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板