Open index.html in your browser to view the file. Add the text, CH 5 Extend Your Knowledge, to the title element. Open the styles.css file and locate the "sticky” comment and create a style rule for the sticky class selector with the following rules: Add a declaration for the position property with a value of -webkit-sticky. Add a declaration for the position property with a value of sticky. Add a declaration for the top property and specify a 0 value. Refresh your page, and scroll down to view the changes. In the index.html file, use the empty paragraph element within the sticky div element to briefly explain how to use the sticky position. In the styles.css file, locate the “relative” comment and create a style rule for the relative class selector with the following declarations: Add a declaration for the position property with a value of relative. Add another declaration for the top property and specify a value of 90px. Add another declaration for the left property with a value of 30px Refresh your page, and scroll down to view the changes. In the index.html file, use the empty paragraph element within the relative div element to explain how the style rules affected the relative box. In the styles.css file, locate the “fixed” comment and create a style rule for the fixed class selector with the following declarations: Add a declaration for the position property with a value of fixed. Add another declaration for the top property and specify a value of 90px. Add another declaration for the right property with a value of 10px. Refresh your page, and scroll down to view the changes. In the index.html file, use the empty paragraph element within the fixed div element to explain how the style rules affected the fixed box. In the styles.css file, locate the “absolute” comment and create a style rule for the absolute class selector with the following declarations: Add a declaration for the position property with a value of absolute. Add another declaration for the bottom property and specify a 0 value. Add another declaration for the right property and specify a 0 value. Refresh your page, and scroll down to view the changes. In the index.html file, use the empty paragraph element within the absolute div element to explain how the style rules affected the absolute box.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Open index.html in your browser to view the file.

Add the text, CH 5 Extend Your Knowledge, to the title element.

Open the styles.css file and locate the "sticky” comment and create a style rule for the sticky class selector with the following rules:

  • Add a declaration for the position property with a value of -webkit-sticky.
  • Add a declaration for the position property with a value of sticky.
  • Add a declaration for the top property and specify a 0 value.

Refresh your page, and scroll down to view the changes. In the index.html file, use the empty paragraph element within the sticky div element to briefly explain how to use the sticky position.

In the styles.css file, locate the “relative” comment and create a style rule for the relative class selector with the following declarations:

  • Add a declaration for the position property with a value of relative.
  • Add another declaration for the top property and specify a value of 90px.
  • Add another declaration for the left property with a value of 30px

Refresh your page, and scroll down to view the changes. In the index.html file, use the empty paragraph element within the relative div element to explain how the style rules affected the relative box.

In the styles.css file, locate the “fixed” comment and create a style rule for the fixed class selector with the following declarations:

  • Add a declaration for the position property with a value of fixed.
  • Add another declaration for the top property and specify a value of 90px.
  • Add another declaration for the right property with a value of 10px.

Refresh your page, and scroll down to view the changes. In the index.html file, use the empty paragraph element within the fixed div element to explain how the style rules affected the fixed box.

In the styles.css file, locate the “absolute” comment and create a style rule for the absolute class selector with the following declarations:

  • Add a declaration for the position property with a value of absolute.
  • Add another declaration for the bottom property and specify a 0 value.
  • Add another declaration for the right property and specify a 0 value.

Refresh your page, and scroll down to view the changes. In the index.html file, use the empty paragraph element within the absolute div element to explain how the style rules affected the absolute box.

index.html

<!DOCTYPE html>
<html lang="en">
<head>
  <title></title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <link rel="stylesheet" href="css/styles.css">
</head>
<body>

  <div id="container">
    
        <!-- Use the header area for the website name or logo -->
        <header>
            <h1>Working with Positions</h1>
        </header>

        <!-- Use the main area to add the main content of the webpage -->
        <main>
            
            <div class="box sticky">
                
                <h2>Sticky</h2>
                <p>This is an example of an element with a sticky position. Its position is based on the user's scroll position.</p>
                <!-- Use the empty paragraph element below to briefly explain how to use the sticky position. -->
                <p></p>
                
            </div>
            
            <div class="box relative">
                
                <h2>Relative</h2>
                <p>This is an example of an element with a relative position. It can move around a little, depending on the viewport, but it is in a position relative to itself.</p>
                <!-- Use the empty paragraph element below to identify the values you used for the top and left properties and how it affected the relative box. -->
                <p></p>
                
            </div>
            
            <div class="box fixed">
            
                <h2>Fixed</h2>
                <p>This is an example of an element with a fixed position. Its position is relative to the viewport.</p>
                <!-- Use the empty paragraph element below to identify the values you used for the top and right properties and how it affected the fixed box. -->
                <p></p>
                
            </div>
            
            <div class="box absolute">
                
                <h2>Absolute</h2>
                <p>This is an example of an element with an absolute position. It is similar to the fixed position; however, it is positioned relative to the closest parent element.</p>
                <!-- Use the empty paragraph element below to identify the values you used for the bottom and right properties and how it affected the absolute box. -->
                <p></p>
                
            </div>
            
        </main>

  </div>
  
</body>
</html>
styles.css
 
body {
    background-color: #dde3fd;
}

#container {
    padding-bottom: 500px;
}
.box {
    border: 1px solid #000;
    margin: 2%;
    padding: 2%;
    background-color: #798ef6;
    color: #091034;
    width: 400px;
    height: 170px;
}
/* sticky */
/* relative */
/* fixed */
/* absolute */
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 4 images

Blurred answer
Knowledge Booster
Image Element
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY