Ok, I have some div element, which should be displayed inline after AJAX
call and should replace other element.
Without display:inline it works, new element is on new line, and looks like
it supposed to be.
But when I add display:inline to styling, Ajax call just hides element but
renders nothing.
If I add display:inline-block than all element change their size with each
new, which I completely don't like.
Any ideas how to fix that?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/hMv1IJ3UZh8J.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Robert Walker at Mar 22, 2013 at 2:16 pm

    Barry wrote in post #1102737:
    Ok, I have some div element, which should be displayed inline after AJAX
    call and should replace other element.
    First I have to ask, If you want inline content why are you using a div
    and not a span? A span displays content "inline" that's its purpose for
    existence. Using the CSS display:inline on a div causes the div to
    behave just like span anyway.
    Without display:inline it works, new element is on new line, and looks
    like
    it supposed to be.
    This statement contradicts your fist statement, where you said the div
    "should be displayed inline." If the div is on a "new line" as you say,
    then it is NOT displayed inline.

    Here is a line with a [div] displayed inline.

    Here is a line with a
    [div]
    displayed as a block. (Block is the default for a <div> tag.)

    Here is the sensible way to display <span>inline content</span> on a
    line.
    But when I add display:inline to styling, Ajax call just hides element
    but
    renders nothing.
    I have no idea how to help you with this without knowing what your AJAX
    is actually doing.
    If I add display:inline-block than all element change their size with
    each
    new, which I completely don't like.
    Any ideas how to fix that?
    display: inline-block; Makes the div (or other element) behave just like
    a block, using the CSS box model, but rather than displaying the div on
    its own line, it instead displays inline without the apparent line
    feeds.

    See the accepted answer on this Stack Overflow question, which explains
    why span is the generally preferred way to display inline content:

    http://stackoverflow.com/questions/1611065/span-vs-div-inline-block.

    --
    Posted via http://www.ruby-forum.com/.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Barry at Mar 22, 2013 at 4:55 pm
    sorry, problem is solved, I just needed so set up unique id for every
    element I create, and than every new element has needed lenght

    пятница, 22 марта 2013 г., 12:40:07 UTC+4 пользователь Barry написал:
    Ok, I have some div element, which should be displayed inline after AJAX
    call and should replace other element.
    Without display:inline it works, new element is on new line, and looks
    like it supposed to be.
    But when I add display:inline to styling, Ajax call just hides element but
    renders nothing.
    If I add display:inline-block than all element change their size with each
    new, which I completely don't like.
    Any ideas how to fix that?
    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/nuZodhjjztoJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Tamouse at Mar 23, 2013 at 4:48 am

    On Fri, Mar 22, 2013 at 11:55 AM, Barry wrote:
    sorry, problem is solved, I just needed so set up unique id for every
    element I create
    Unique id's are in the standard:
    http://www.w3.org/TR/html401/struct/global.html#h-7.5.2
    and than every new element has needed lenght
    What does this part mean?

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedMar 22, '13 at 8:40a
activeMar 23, '13 at 4:48a
posts4
users3
websiterubyonrails.org
irc#RubyOnRails

3 users in discussion

Barry: 2 posts Tamouse: 1 post Robert Walker: 1 post

People

Translate

site design / logo © 2021 Grokbase