GithubHelp home page GithubHelp logo

slide content height about shower HOT 2 CLOSED

mfrigerio17 avatar mfrigerio17 commented on May 28, 2024
slide content height

from shower.

Comments (2)

mfrigerio17 avatar mfrigerio17 commented on May 28, 2024 1

aaah.. yes, actually I remember having realized before, in the past, that the amount it sticks out is exactly the height of the title..

100% means the full height of the parent, not just available space.

Yes, in fact I did mention that I expected the element to stretch to fit the container (or "parent").
The problem is that the container is just the slide, and not the slide "minus" the title... (stupid me)

The only solution that seems to do what I want, is a flex container:

CSS

.title-content {
	  height: 100%;
	  display: flex;
	  flex-direction: column;
}
.title-content > div {
	  flex: auto;
}

HTML

    <section class="slide">
      <div class="title-content">
        <h2>Title 2</h2>
        <div>
          This div will fill the available vertical space
        </div>
      </div>
    </section>

Anything deeply wrong with this?

It's easier to style images in fixed units, keeping in mind that the slide's height is 1024 by 576.

yes, it is easier, but I was aiming to avoid hardcoded sizes for more flexibility.

Thanks for the fast reply!

from shower.

pepelsbey avatar pepelsbey commented on May 28, 2024

Hello! Yes, you're missing the way height: 100% works in CSS. 100% means the full height of the parent, not just available space. It means that it sticks out of the slide exactly by the height of the title.

I'd suggest looking a the examples in the theme's index file: cover and place primitives.

It's easier to style images in fixed units, keeping in mind that the slide's height is 1024 by 576.

from shower.

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.