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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:00:37+00:00 2026-05-18T12:00:37+00:00

It is probably easy to implement, but hard to name it. I am struggling

  • 0

It is probably easy to implement, but hard to name it. I am struggling to display this layout:

<ul class='menu'>
  <li>
    <a>item1</a>
    <ul class='submenu'> ... </ul>
  <li>
  <li><a>item2</a></li>
</ul>

in 2 horizontal lines: first line is ul.menu and second line is ul.submenu

Css:

ul.menu
{
  position: relative;
  height: 20px;
}
ul.menu li {
  display: inline;
}
ul.submenu {
  top: 20px;
  left: 0px;
  position: absolute;
}

Is there a way to do it without position:absolute, so that menu container is in the flow of the document (there is no gap is submenu isn’t present)?

  • 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-18T12:00:38+00:00Added an answer on May 18, 2026 at 12:00 pm

    I’ve set up a jsFiddle for this.

    If I understand the problem correctly, you want a two-line menu, the submenu of which is still in the document flow, so the page will adjust when there is no submenu.

    The catch is this: Without position: absolute, the parent <li> elements will expand to contain the submenu <ul> elements. This will leave your top-level menu items will odd spacing, depending on the width of your submenu elements.

    If this isn’t a problem, then the above jsFiddle should solve the issue. If it is a problem, then there is a little more work to do (and I don’t have a solution quite yet).

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

Sidebar

Related Questions

This is probably v.easy but my php is very rusty. I need to implement
I know that this is probably something easy to implement, but I am having
This is probably easy but I am getting stuck: when I build a solution
Probably really easy for a pro, but could someone re-write this from it's PHP
This is probably an easy question, but I want to understand better how Apache
This is probably really easy but I can't seem to figure out how to
This is probably seriously easy to solve for most of you but I cannot
This is probably really easy, but I'm lost on how to make sure it
So this is probably an easy thing that I'm trying to do but I'm
I've been working all day and I somehow can't get this probably easy task

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.