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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:16:12+00:00 2026-05-19T05:16:12+00:00

On one of my web pages I have a DIV element, containing string of

  • 0

On one of my web pages I have a DIV element, containing string of text inside, which is of, say, 1.1em size. For example:

<div id="displaydiv">
    <b>Hello World</b>
</div>

Another page has the same DIV element, but with no text inside it at all. And that’s why this DIV has the visual height of less value than the one on the first page.

<div id="displaydiv">

</div>

What is the recommended way of keeping the DIV element on the second page of the same height as on the first one?

  • 1 1 Answer
  • 1 View
  • 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-19T05:16:13+00:00Added an answer on May 19, 2026 at 5:16 am

    Try putting an &nbsp; inside.

    If the page is dynamically generated and your template language supports conditionals, make sure only to show the &nbsp; when there’s no content.

    Otherwise, if you can’t show it only when empty, to avoid messing up your text alignment (thanks to @bensiu for pointing this out), stick the &nbsp; at the end of the string (or beginning if the text is right-aligned). If it’s center-aligned, you can put an &nbsp; on both ends.

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

Sidebar

Related Questions

We have some web pages which have two frames, with one frame in the
I have a solution with 3 projects.One of UI (contains web pages) and one
I'm currently writing a web application that have about 6-12 pages. On each one
I have a one page web application, which means alot of javascript. External scripts
I have web-pages based on widget and I have given all the div the
I have a slider-like widget which is basically, a div of sub-divs containing some
I have a web page which has three <div> elements: Right_bar contains several layouts
I have 2 separate pages, each opens a web socket to the server, one
I have a web page with 3 forms on it. Not nested, just one
One of the web pages on our site is extremely long. Although the page

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.