Before and after pseudo elements practice in css

technical talkiess
0

Preview of the before and after psedo class






 <!DOCTYPE html>

<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Before And After Psudo Eelements</title>
</head>
<style>
    body{
        background-color: black;
        color: white;
    }
    .navbar{
        display: flex;
    }
    .content{
        top: 0;
        bottom: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border: 1px solid red;
        padding: 100px;
        margin: 100px;
    }
    .content p{
        text-align:center;
    }
    header::before{
            background: url('https://source.unsplash.com/collection/190727/1600x900') no-repeat center center/cover;
            content: "";
            position: absolute;
            top:0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
            opacity: 0.4;
        }
</style>
<body>
    <header>
    <div class="navbar">
        <ul class="li" id="list1">Home</ul>
        <ul class="li" id="list2">About</ul>
        <ul class="li" id="list3">Contact</ul>
        <ul class="li" id="list4">Phone</ul>
        <ul class="li" id="list5">Photo</ul>
    </div>
</header>
    <div class="content">
        <h1>This is before and after psuedo Eelements</h1>
        <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Nisi a neque quo deserunt ex laudantium. Tempora
            tenetur inventore adipisci ullam accusantium assumenda fugit quidem recusandae temporibus. Officiis quia
            adipisci velit?z</p>
    </div>
</body>

</html>

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)