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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:53:53+00:00 2026-05-28T02:53:53+00:00

So basically I have a layout like this: <div id=header> <div id=elementAbsolute> <div id=headerElement1>

  • 0

So basically I have a layout like this:

<div id="header">
   <div id="elementAbsolute">
   <div id="headerElement1">
   <div id="headerElement2">
</div>

<div id="content">
etc etc

My problem is that div id “elementAbsolute” can be randomly turned on or off on the page. I have no control over that. When it’s on it needs to appear underneath the header but before the content. Since it’s absolutely positioned, it just appears over the content. It does not create any vertical whitespace above or below itself obviously.

In this particular template, that element must be called where it is in the markup. It can’t be moved. Is there a way, possibly through javascript, to say that if “elementAbsolute” is turned on and exists on the page inside the “header” div then move it between the header and content div and create some whitespace?

Also keep in mind that this template is used for multiple sites, so the whitespace can only be added if “elementAbsolute” exists within “header”.

I was thinking along the lines of using the jQuery after() function to put an empty divs before and after it to create that space, but then my problem becomes I only want this function to run if “elementAbsolute” is on the page, otherwise I’ll have whitespace there no matter what.

Thanks for any help!

  • 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-28T02:53:53+00:00Added an answer on May 28, 2026 at 2:53 am

    If elementAbsolute is of a fixed height then a simple fix would be to add the whitespace to the headerElement 1 or 2 instead

    #elementAbsolute + #headerElement1 + #headerElement2
    {
      margin-bottom: 50; /* Size of absolute element /*
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I basically have a layout like this: <body> <div style=height: 150px; width: 200px; background:
I would like to have this android layout basically works like the dolphin browser,
I basically have something like this: void Foo(Type ty) { var result = serializer.Deserialize<ty>(inputContent);
I have a VBScript script that looks like this: Const ForAppending = 8 Set
Hey all, so basically I have a very simple layout with a header image,
I have a layout that is working, but it has one very annoying problem..
I have the following layout: <div style=float:right ...>Contents</div> <table>contents</table> I want that the div
Basically I need div.content to have a default padding of 15px EXCEPT for when
i have some troubles implementing this layout: http://deconcini.net/maurer-schneebacher/projekte/elisabethinum.html Basically i would like to display
I'm working on a layout where the main content div will have a with

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.