Question

What I need to do :) Go to the code_scroll.css file and create a style rule...

What I need to do :)

Go to the code_scroll.css file and create a style rule for the section element with the id container with the following styles:

1. Set the width of the element to 900 pixels and the height to 370 pixels.

2. Horizontally center the element by adding a 10 pixel top/bottom margin and set the left/right margin to auto.

3. Place the element with relative positioning, setting the top value to 30 pixels and the left value to 0 pixels.

4. Add a 2 pixel solid brown outline to the element.

5. Have the browser automatically display scrollbars for any overflow content.

- Create a style rule for every div element, setting the width to 300 pixels and the height to 330 pixels. Position the element with absolute positioning. There are nine div elements with ids ranging from slide1 to slide9.

- Set the left position of the elements in 300 pixel increments starting with 0 pixels for slide1, 300 pixels for slide2, 600 pixels for slide3, and so forth up to 2400 pixels for slide9.

- Display every inline image as a block-level element with a width and height of 300 pixels.

What I have so far...

@charset "utf-8";

/*

   New Perspectives on HTML5 and CSS3, 8th Edition

   Tutorial 3

   Coding Challenge 3

   Author: Alexandria Woodson

   Date:10/21/2020   

   

   Filename: code3-3_scroll.css

*/

html{

overflow: auto;

}

#container{

overflow: auto;

position: relative;

left: 0px;

top: 30px;

outline-style: solid;

outline-color: brown;

outline-width: 2px;

height:370px;

width:900px;

margin-top: 10px;

margin-right: auto;

border: 2px solid brown;

}

div{

overflow: auto;

display: inline-block;

position: absolute;

height:330px;

width:300px;

}

img { width: 300px; height: 300px; }

#slide1

{

left: 0px;

}

#slide2

{

left:300px;

}

#slide3

{

left:600px;

}

#slide4

{

left:900px;

}

#slide5

{

left:1200px;

}

#slide6

{

left:1500px;

}

#slide7

{

left:1800px;

}

#slide8

{

left:2100px;

}

#slide9

{

left:2400px;

}

can anyone help with the CORRECT solution?

Homework Answers

Answer #1

HTML:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>HTML CSS Tuto</title>
    <link href="style.css" rel="stylesheet" type="text/css" />
  </head>
  <body>
    <section id="container">
        <div id="slide1">
          <img src="https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=701&q=80" />
        </div>
        <div id="slide2">
           <img src="https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=701&q=80" />
        </div>
        <div id="slide3">
           <img src="https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=701&q=80" />
        </div>
        <div id="slide4">
           <img src="https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=701&q=80" />
        </div>
        <div id="slide5">
           <img src="https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=701&q=80" />
        </div>
        <div id="slide6">
           <img src="https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=701&q=80" />
        </div>
        <div id="slide7">
           <img src="https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=701&q=80" />
        </div>
        <div id="slide8">
           <img src="https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=701&q=80" />
        </div>
        <div id="slide9">
           <img src="https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=701&q=80" />
        </div>
    </section>
  </body>
</html>

CSS:

section#container {
  width: 900px;
  height: 370px;
  margin: 10px auto;
  position: relative;
  top: 30px;
  left: 0px;
  outline: 2px solid brown;
  overflow: auto;
}

section > div[id^="slide"] {
  width: 300px;
  height: 330px;
  position: absolute;
}

#slide1 {
  left: 0px;
}

#slide2 {
  left: 300px;
}

#slide3 {
  left: 600px;
}

#slide4 {
  left: 900px;
}

#slide5 {
  left: 1200px;
}

#slide6 {
  left: 1500px;
}

#slide7 {
  left: 1800px;
}

#slide8 {
  left: 2100px;
}

#slide9 {
  left: 2400px;
}

img { 
  width: 300px; 
  height: 300px; 
  display: block;
}

Updated with some changes. Please take a look and let me know if you have any doubts.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
nav.horizontal ul {    width: 100%;    display: grid;    grid-template-columns: repeat (5, 1fr); } nav.horizontal ul li {...
nav.horizontal ul {    width: 100%;    display: grid;    grid-template-columns: repeat (5, 1fr); } nav.horizontal ul li {    display: block;    text-align: center; } /* Coupon Section Styles */ section {    display: grid;    grid-gap:  20px;    grid-template-columns: repeat (3, 1fr); } section div {    outline: 4px dashed gray;    position: relative; } section div p.last-of-type {    position: absolute;    bottom: 1px;    right: 5px; } The style rules for the horizontal navigation list and the section element also define grid styles for those elements. Locate and fix errors...
TASK 2: Open numberic-variable_problem.js file in a text editor (e.g., NotePad++). What is the syntax error...
TASK 2: Open numberic-variable_problem.js file in a text editor (e.g., NotePad++). What is the syntax error in the JavaScript file? Find error message in console in a browser’s developer tool. Fix that error and reload the web page in browser. What is the change in the content displayed in the web page after fix the syntax error in the JavaScript code? Replace the line#18 statement (el.textContent = '$' + total;) in the JavaScript code with    el.textContent = '$' + total.toFixed(3);...
Aqueous HBr reacts with solid NaOH to produce sodium bromide NaBr and liquid water. What is...
Aqueous HBr reacts with solid NaOH to produce sodium bromide NaBr and liquid water. What is the theoretical yield of water formed from the reaction of 34.0 g of HBr and 6.05g of NaOH? 3 sig figs please. <div id="ansed_tree_ansedimage_7" class="ansed_tree" overflow:visible;"="" unselectable="on" aria-hidden="true" style="position: absolute; left: 0px; top: 0px; z-index: 3; width: 9px; height: 24px;">
I have trouble in my code with - Create and append the fancySheet link element to...
I have trouble in my code with - Create and append the fancySheet link element to the document head - Create and append figBox element to element with id box - Populate the figure box with preview images of the five fancy style sheets I don't understand what went wrong. New Perspectives HMTL5, CSS3, and JavaScript T12 Case Problem 1: New Accents Photography JavaScript File Event Listener Go to the na_styler.js file in your editor. Add an event listener that...
Challenge 5 Read ALL of the instructions carefully before starting the exercise! Dear Colleague, Earlier today...
Challenge 5 Read ALL of the instructions carefully before starting the exercise! Dear Colleague, Earlier today I built my fourth website using HTML5 and CSS3. This time I wanted to try using CSS float layout options on a website dedicated to my favorite topic: robotics. I wanted my website to look like what is shown in Figure 1 (see below). However, after giving it my best effort, things once again didn’t turn out the way I wanted (see the code...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>All Pets Veterinary Hospital</title> <style> body { font-family: arial,...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>All Pets Veterinary Hospital</title> <style> body { font-family: arial, sans-serif; font-size: 100%; } /* outer container */    #wrapper { width: 960px; margin: 50px auto; padding: 0px; background-color: rgb(255, 255, 255); /* white */ border: 1px solid #000; /* black */ }    header h1 { text-align: center; }    nav { text-align: center; background: rgb(175, 196, 206); }    address figure { text-align: center; } </style> </head> <body> <div id="wrapper"> <!-- outer...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT