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

  • Home
  • SEARCH
  • 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 8062235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:36:02+00:00 2026-06-05T10:36:02+00:00

I have a container div for my website with the following CSS code .container

  • 0

I have a container div for my website with the following CSS code

.container {
    width: 1020px;
    background-color:transparent;
    margin: 0 auto;
}

and it has a fixed width as it is shown above. In the container there is a navbar and a section in between of those I am using an <hr> property in order to separate them, but the issue I am having is even if I will give this hr a 100% width it will fit just the width of my container, but I want it to expand through out the whole page.

Is there any way to manage that? Thanks in advance.

  • 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-06-05T10:36:04+00:00Added an answer on June 5, 2026 at 10:36 am

    An element’s width, when given relative sizing, is relative to its parent element. In this case, then, there’s no way to have the hr element’s width be relative to another parent.

    You can, though, give a width of greater than 100%, and then use a negative margin to centre, if required:

    ​div {
        width: 50%;
        margin: 0 auto;
        border: 1px solid #f90;
    }
    
    ​div hr {
        width: 190%;
        margin-left: -45%;
    }​
    
    <div id="a">
        <hr />
    </div>​
    

    JS Fiddle proof-of-concept.

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

Sidebar

Related Questions

I have a container div with the following CSS: #container { position:relative; overflow:hidden; width:200px;
I have a website with the following setup: <div id=container> <div id=header></div> <div id=content></div>
I have a website using a huge background image (2000x1500) in a div container
I have a container (div) with a background image. In this div there is
I have this container div whose width I would like to set according to
Here are my styles: Parent container: div.musicContainer { width:820px; height:54px; margin-bottom:20px; } Child containers:
If I have a container div called #container which has a bunch of .inside
I have a container div with a footer div placed outside of it. First
I have a container DIV which contains several block-DIVS. Every block-DIV contains SPAN items
i have a container div which is position:relative and the squares are position:absolute because

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.