Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Center the concent vertically #61

Open
alliquot opened this issue Oct 29, 2015 · 2 comments
Open

Center the concent vertically #61

alliquot opened this issue Oct 29, 2015 · 2 comments

Comments

@alliquot
Copy link

Hello, dinbror,

First of all, thank you very much for providing such a nice component. I really love it.

I'd like to ask you for some help: is there any way to center its content vertically? I have some lines of a message to display but cannot center it.

Let's assume this is the content:

<div id="element_to_pop_up">
        <div id="content">Some text
        some<br/>
        text<br/>
        here<br/>
        ...<br/>
         </div>
</div>

I don't know size of the content. I've tried to add another container and use display:table and table-cell with vertical-align:middle:

<div id="element_to_pop_up">
        <div id="becomes_a_table">
            <div id="content_becomes_a_table_cell">Some text
        some<br/>
        text<br/>
        here<br/>
        ...<br/>
          </div>
       </div>
</div>

But I cannot set the "table" div's height to 100% of the popup. It doesn't resize to fill the parent entirely. Thus, I can see only a small div with my text in the left upper corner of a bPopupped div. The content is centered inside the table, but the table doesn't expand to a whole container.

Could you provide a simple example on how to center vertically some strokes of a text inside?

@dinbror
Copy link
Owner

dinbror commented Nov 10, 2015

Have you tried to set "amsl" to 0?

$('#element_to_pop_up').bPopup({
amsl: 0
});

@thomsebastin
Copy link

Thanks @dinbror. Adding amsl:0 solved my issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants