Giter Club home page Giter Club logo

Comments (7)

gregorypratt avatar gregorypratt commented on May 13, 2024

Maybe I should add this to docs but you need to give the block some height...

from atoms.

gregorypratt avatar gregorypratt commented on May 13, 2024

Added some doc help text...if you want to re-open this issue feel free 👍

from atoms.

Psykukumber avatar Psykukumber commented on May 13, 2024

Okay, just tried your suggestion

html:

<div class="u-center-block">
  <div class="u-center-block__content">Hello Blaze</div>
</div>

main.css:

.u-center-block {
  height: 100%
}

and what i got:
screenshot_2016-06-20_22-41-19

well, what if i try like this:

main.css:

.u-center-block__content {
  height: 100%
}

and then:
screenshot_2016-06-20_22-42-02

looks little bit better ;)

Maybe i do something wrong?

from atoms.

Kurre avatar Kurre commented on May 13, 2024
.u-center-block {
  height: 100%
}

doesn't really work, if the div doesn't have measurable height (which it doesn't have in this context).

Here's a quick example how you could use it.
Give the outer div a fixed height (in px, em, rem...) or put some content in it.

from atoms.

Psykukumber avatar Psykukumber commented on May 13, 2024

Unfortunately, this one works perfect for some blocks, but not for entire page.
For example, if i want responsive vertical alignment it's not working.

from atoms.

gregorypratt avatar gregorypratt commented on May 13, 2024

Try this:

<body>
  <div class="u-center-block__content">Hello Blaze</div>
</body>

Would you like this to be a separate feature?

u-absolute-center for instance

from atoms.

Psykukumber avatar Psykukumber commented on May 13, 2024

Thanks, this one works like a charm.

Would you like this to be a separate feature?

Yes, this makes sense. Also i think this example needs to be added in docs.

from atoms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.