Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7072187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:46:41+00:00 2026-05-28T05:46:41+00:00

I am working on an assignment that is giving me grief. I am supposed

  • 0

I am working on an assignment that is giving me grief. I am supposed to make a red box that matches the color of an image. This box is supposed to be centered on the page. The box is supposed to be 80% of the page. The image is supposed to be inside the box. The image is supposed to be 80% width of the BOX it sits in. The image is to be centered vertically. I am trying to do this using CSS. Here is my code. What am I missing?

HTML:

<html>
    <head>
        <link rel="stylesheet" type="text/css" href="style.css" />
    </head>

    <body>
        <div class="box">
            <ul>
                <li>
                    <a href="http://blackhawks.nhl.com/">
                        <img src="http://www.wallpaperpimper.com/wallpaper/Hockey/Chicago_Blackhawks/Chicago-Blackhawks-Blackhawks-Logo-1-JPS6RQXFBC-1024x768.jpg">
                    </a>
                </li>
            </ul>
        </div>
    </body>
</html>

CSS:

.box  {
    width: 80%;
    background-color: #dd111;
    margin-left: auto;
    margin-right: auto;
} 
.box ul {
    margin-left:auto;
    margin-right:auto;
}
.box ul li {
    width: 80%;
    vertical-align: middle;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:46:42+00:00Added an answer on May 28, 2026 at 5:46 am

    If the list isn’t necessary you could do this. If you want to use a list you need to set the ul padding and margin to 0.

     <style type="text/css">
    
        .box {
           width:80%;
           margin:0 auto 0 auto;
        }
    
        img {
           width:80%;
           margin:0 auto 0 auto;
           display:block;
        }
    
       .box-stripe {
           width:80%;
           height:15px; 
           margin:0 auto 0 auto;
       }
    
        </style>
    
    
        <body>
    
        <div class="box">
    
        <div class="box-stripe"></div>
    
        <img src="yourimage.png" alt="" />
    
        <div class="box-stripe"></div>
    
        </div>
    
        </body>
    

    Or if you prefer the list you could do something like this. It should get you close anyways.

    <style type="text/javascript">
    
    .box {
    width:80%;
    margin:0 auto 0 auto;
    }
    
    .box ul {
    width:80%;
    margin:0 auto 0 auto;
    padding:0px;
    display:block; /*may not need to do this but I don't think a UL is a block element */
    }
    
    .box ul .box-stripe {
    width:100%;
    display:block;
    height:15px;
    padding:0px;
    margin:0px;
    }
    
    .box ul .img {
    width:100%;
    display:block;
    padding:0px;
    margin:0px;
    }
    
    </style>
    
    
    
          <body>
    
                <div class="box">
    
                <ul>
    
                 <li>class="box-stripe"></li>
    
                 <li class="img"><img src="yourimage.png" alt="" /></li>
    
                 <li class="box-stripe"></li>
    
               </ul>
    
                </div>
    
           </body>
    

    Every browser treats HTML elements differently in terms of padding, margin, line height, ect. This is why I recommend a CSS reset. And most UL’s have some padding by default.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good day, Stack Overflow. I have a homework assignment that I'm working on this
I'm currently working on a program (for fun, this is not an assignment) that
ok so this is the assignment that I'm working on: Implement a class Student
I have this school assignment that I've been working on and am totally stumped
I am working on an assignment that deals with reading data from a text
I am working on a homework assignment that deals with binary search trees and
I am working on a school assignment that requires me to be able to
I'm working on my assignment of PHP course. The problem that I don't understand
I'm working on a homework assignment (a project), for which one criterion is that
I am working on an assignment for networking where we are supposed to create

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.