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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:11:30+00:00 2026-05-23T11:11:30+00:00

I have a ul with li’s which in turn contains some divs. You could

  • 0

I have a ul with li’s which in turn contains some divs. You could see it on jsFiddle: http://jsfiddle.net/rtKra/

Here is the ul structure:

<ul class="categoryListing">

<li class="category">
    <div class="hoverMenu">
        <a class="edit">
            <img class="hoverButton editIcon" src="${baseRef}/images/editpencil.png"/>
        </a>
        <a class="delete">
            <img class="hoverButton deleteIcon" src="${baseRef}/images/deleteredicon.png"/>
        </a>
    </div>

    <div style="width:20px; height:20px; background-color:red; position:relative; top:2px; margin:0; padding:0; float:left; border-radius:2px; text-align:center;"><div class="arrow-down"></div></div>
    <div style="width:185px; margin:0; padding:0; float:right; z-index:100; display:visible;">Here is the name of the category that you want to use</div>
    <!--DISAPPEARING DIV-->


</li>

<li class="category">
    <div class="hoverMenu">
        <a class="edit">
            <img class="hoverButton editIcon" src="${baseRef}/images/editpencil.png"/>
        </a>
        <a class="delete">
            <img class="hoverButton deleteIcon" src="${baseRef}/images/deleteredicon.png"/>
        </a>
    </div>
    <div style="position:relative; display:block">
        <div style="width:20px; height:20px; background-color:yellow; position:relative; top:2px; margin:0; padding:0; float:left; border-radius:2px; text-align:center;">&#9660;</div>
        <div style="width:185px; margin:0; padding:0; float:right;">Here is the name of the category that you want to use</div>
    </div>
</li>
</ul>

The thing is that the div with the content just disappears if it’s not within an outer div which
has style set to display:block. Is there a reason for that happening??

I’m using the inline style only for testing out the layout…the styles for the ul and li, can be seen on the above url if you wish. But am I missing some CSS thing that is preventing the div from showing? Why is that?

  • 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-23T11:11:30+00:00Added an answer on May 23, 2026 at 11:11 am

    I can’t reproduce it here (I’ve only got Firefox on this machine), but I think I can guess what the problem is:

    The problem is likely to be because the <div> is contained within an <li>, and because the <div> is styled by default as display:block;, whereas the <li> is styled by default as display:list-item;.

    display:list-item works similarly to display:inline in that it cannot contain block elements. The rules say you cannot have a block element inside an inline element. It doesn’t make sense.

    Obviously people do this all the time, and the browsers have to be able to cope with it, but it is an error, and some browsers will cope better than others.

    The solution to the problem is to style the <li> as display:inline-block;.

    inline-block is a way of styling the display property such that the element remains inline in relation to the other elements around it, but can contain block type contents.

    So add this CSS and you should be fine:

    li.category { display:inline-block; }
    

    Hope that helps. As I say, I can’t test it here, but please let me know if it solves the problem.

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

Sidebar

Related Questions

I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
have written this little class, which generates a UUID every time an object of
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
Have deployed numerous report parts which reference the same view however one of them
Have an issue with marshall and unmarshall readers and writers. So here it is.
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Have some code: using (var ctx = new testDataContext()) { var options = new
Have data that has this kind of structure. Will be in ascending order by
I have an autohotkey script which looks up a word in a bilingual dictionary

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.