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 8821517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:52:31+00:00 2026-06-14T05:52:31+00:00

I have an element (in my case a HR tag) that needs to be

  • 0

I have an element (in my case a HR tag) that needs to be as wide as the browser but which is also wider than it’s parent container. However, it still needs to maintain relative positioning so that it scrolls vertically with the page. The problem is that my parent div has to have relative positioning as well (due to other layouts that are working).

The only way I have been able to solve this is to set the width of the HR tag to 3000px with a left position of -1000px. This works, but it adds a horizontal scrollbar to the page (to display the 3000px width). Is there any way to accomplish this cleanly (without the horizontal scroll bar)? You can see my fiddle at http://jsfiddle.net/UGwst/.

Here’s the HTML:

<div id="layout-wrapper">
  <p>Above Content</p>
  <div id="content-wrapper">
    <p>Top Content Here</p>
    <hr class="rule" />
    <p>Bottom Content Here</p>
  </div>
</div>​

Here’s the CSS:

#content-wrapper {
  width: 400px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 8px;
  background-color: #ddd;
  position: relative;
}
.rule {
  background-color: #dbb328;
  height: 5px;
  position: relative;
  left: -1000px;
  width: 3000px;
}
​

I realize that there are a couple of other questions here that are similar, but don’t quite seem to fix this issue.

  • 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-14T05:52:32+00:00Added an answer on June 14, 2026 at 5:52 am

    Use position:relative on the parent.

    Use position:absolute on the HR, that way the HR is bound to the parent and will scroll with it.

    To hide scroll bars use overflow:hidden on your outer wrapper, or BODY.

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

Sidebar

Related Questions

I have an element which may contain very big amounts of data, but I
Pretty simple question. I have an element (a tag) which has an onclick to
I have an element in a window in a web page, which I am
I have DIV element which only has a few lines in and a background
If have an element that maybe disabled on a page, and would like to
I have an element that can have multiple types (not my design). The element
I have been developing a jquery widget that extends ui.mouse. The widget needs to
I have a plugin that changes the look of select html tag on all
Ok, I have a case where I need to add a tag to a
In Theory I have a div (container) that when hovered over one of its

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.