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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T19:47:06+00:00 2026-05-21T19:47:06+00:00

I have two divs that are inline. they both have similar styles and importantly

  • 0

I have two divs that are inline. they both have similar styles and importantly both are inline.

JQuery is reporting that their css “display” is block ONLY in chrome. I really need to know that these two are inline.

jsfiddle here

css:

div
{
    display: inline;
    width: 50%;
    float: left;
    height: 100px;
    text-align: center;
    font-weight: bold;
    padding: 10px;
    box-sizing: border-box;
}
.div1
{
    background-color: black;
    color: white;
    border: 2px solid grey;
}

.div2
{
    background-color: white;
    color: black;
    border: 2px solid black;
}

html:

<div class="div1">1</div>
<div class="div2">2</div>

jQuery:

jQuery("div").click(function()
{
    jQuery(this).append("<br/><span>" + jQuery(this).css("display") + "</span>");
});

jQuery("div").click();

Does anyone know what is happening or more importantly what can I do? (other than pull my hair out… its starting to hurt 😉 )

  • 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-21T19:47:06+00:00Added an answer on May 21, 2026 at 7:47 pm

    As I said in my comment, float: left forces display: block.

    Here’s the relevant information in the spec:

    http://www.w3.org/TR/CSS21/visuren.html#propdef-float

    The element generates a block box that
    is floated to the left.

    And then:

    http://www.w3.org/TR/CSS21/visuren.html#dis-pos-flo

    Otherwise, if ‘float’ has a value
    other than ‘none’, the box is floated
    and ‘display’ is set according to the
    table below.

    To summarize said table: float = display: block.

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

Sidebar

Related Questions

(Jquery) I have two divs that I'm toggling back and forth (show and hide)
I currently have two divs on my site: Notice that both have border [same
I have two divs floated left so that they appear next to each other.
I have two divs that are not nested, one below the other. They are
I have two divs that I need to position horizontally dependent on the width
I have two divs, one that holds some stuff and the other with all
I have two sibling divs sitting below each other, both contained in the same
I have two divs that have 50% width each. I want to make it
I have two divs, both with position:absolute; , one inside the other. The parent
I have two DIVs that I need to position exactly on top of each

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.