Part 4 - Positions














    Part 4 - Positions

        /*  element selector */
        replace-me {
            font-size: 10px;
            margin: 0;
            background-color:#414046;
        }

        /*  class selector */
        .replace-me {
            position: fixed;
            left: 4em;
            top: 0;
            background-color: white;
            width: 4em;
            height: 100vh;
        }

        /*  class selector */
        .replace-me {
            position: fixed;
            right: 4em;
            top: 0;
            background-color: white;
            width: 4em;
            height: 100vh;
        }

        /*  class selector */
        .replace-me {
            position: fixed;
            right: 0;
            top: 0;
            background-color: green;
            width: 4em;
            height: 100vh;
        }

        /*  class selector */
        .replace-me {
            position: fixed;
            left: 0;
            top: 0;
            background-color: green;
            width: 4em;
            height: 100vh;
        }

        /*  class selector */
        .replace-me {
            background: url('./images/white-car.png');
            background-repeat: no-repeat;
            background-size: cover;
            transform: rotate(180deg);
            position: sticky;
            margin-top: 50em;
            top: 0;
            left: 20%;
            width: 20em;
            height: 40em;
            float: left;
        }

        /*  General sibling combinator */
        .replace-me ~ .replace-me {
            position: relative;
            background: url('./images/red-car.png');
            background-repeat: no-repeat;
            background-size: cover;
            margin-top: 5em;
            top: 0;
            right: 20%;
            width: 20em;
            height: 40em;
            float: right;
        }

        /* General sibling combinator */
        .replace-me ~ replace-me {
            background-color: #EFB700;
            border-radius: 2px;
            margin: 4em auto;
            width: 4em;
            height: 10em;
        }


























































































































































































































































































































































































































































































































































































Part 4 - Positions (positions.html)<br>At the end of this section, you will have a webpage that looks and functions like the webpage in<br>the video below (white and green lines are fixed, the white car sticks to the top of the viewport<br>instead of leaving the viewport on scroll):<br>I used a mix of sticky, relative and absolute positions to achieve the effect demonstrated above.<br>Your job is to replace the default selectors in sticky.html with correct selectors. You will need<br>to explore the HTML and prewritten style rulesto do this.<br>Hint:<br>use process of elimination<br>o ex: the line on the left side is green<br>• look in the style sheet for a rule that could create a green line on the left<br>side<br>• look in the html to see if there is an element you can match with that<br>rule<br>• finally, modify that rule's selector, refresh your browser to confirm that<br>the CSS rule was applied to that element<br>

Extracted text: Part 4 - Positions (positions.html) At the end of this section, you will have a webpage that looks and functions like the webpage in the video below (white and green lines are fixed, the white car sticks to the top of the viewport instead of leaving the viewport on scroll): I used a mix of sticky, relative and absolute positions to achieve the effect demonstrated above. Your job is to replace the default selectors in sticky.html with correct selectors. You will need to explore the HTML and prewritten style rulesto do this. Hint: use process of elimination o ex: the line on the left side is green • look in the style sheet for a rule that could create a green line on the left side • look in the html to see if there is an element you can match with that rule • finally, modify that rule's selector, refresh your browser to confirm that the CSS rule was applied to that element

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here