admin管理员组

文章数量:1122832

Css styles.css

body {
    position: relative;
    background-image: url('blue.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav ul li {
    margin-left: 20px;
}

.nav ul li a {
    text-decoration: none;
    color: black;
}

.text {
    text-align: center;
}

.txt1, .txt2 {
    margin: 10px 0;
}

.cpyrgt {
    text-align: center;
    margin-top: 20px;
}

.smicons {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.smicons a {
    margin: 0 10px;
}

.button{
    position: absolute;
    top: 50%;
    background-color: #0a0a23;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 15px;
    min-height: 30px;
    min-width: 120px;
}

Html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Edrin John's Enterprise</title>
    <link rel="stylesheet" href="styles.css">
    <script src=".js" crossorigin="anonymous"></script>
</head>
<body>
    <div class="container">
        <div class="nav">
            <h2 class="bname">Edrin John's Enterprise</h2>
            <ul>
                <li><a href="home.html">Home</a></li>
                <li><a href="about.html">About</a></li>
                <li><a href="services.html">Services</a></li>
                <li><a href="contact.html">Contact</a></li>
            </ul>
        </div>
        <div class="text">
            <p class="txt1">Your One-Stop Solution to All Document Services.</p>
            <p class="txt2">Explore our wide range of services designed to meet all your document needs.</p>
            <button class="btn">Explore</button>
            <p class="cpyrgt">© 2013, Edrin John's Enterprise. All Rights Reserved.</p>
        </div>
    </div>
    <div class="smicons">
        <a href="">
            <i class="fa-brands fa-facebook fa-2xl"></i>
        </a>
        <a href="">
            <i class="fa-brands fa-instagram fa-2xl"></i>
        </a>
    </div>

</body>
</html>

本文标签: htmlMy backround image in css is not showing