用于在100vh的cointainer内显示全部内容并使溢出可滚动的Css

enxuqcxy  于 2023-01-10  发布在  其他
关注(0)|答案(1)|浏览(115)

我想要的是我现在的一般行为,但是它没有显示tickets类的全部内容。我需要做什么?

.toolbar {
  background-color: deeppink;
}

.tickets {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: lime;
  font-size: 3em;
  word-break: break-word;
  overflow: auto;
}

.pagination {
  background-color: cyan;
}

.has-pagination {
  outline: 3px dotted black;
  height: 100%;
  background-color: grey;
  display: flex;
  flex-direction: column;
}

body {
  padding: 0;
  margin: 0;
  height: 100vh;
}
<div class="has-pagination">
  <div class="toolbar">
    Toolbar
  </div>
  <div class="tickets">
    Crispy iceberg lettuce cool off edamame Italian linguine puttanesca chocolate peanut butter dip Thai sun pepper blueberries cocoa kale caesar salad spiced pumpkin chili cinnamon toast Italian pepperoncini picnic Malaysian grenadillo. Salted scotch bonnet
    pepper spring chocolate cookie cinnamon quinoa flatbread creamy cauliflower alfredo plums sweet potato falafel bites strawberries main course candy cane winter chilies garlic sriracha noodles. With sleepy morning tea soup lavender lemonade Sicilian
    pistachio pesto cool cucumbers kung pao pepper citrusy coconut milk grapefruit summertime casserole sriracha pecans delightful blueberry scones fruit smash tahini drizzle almonds pineapple salsa sesame soba noodles lentils Chinese five-spice powder.
    Bruschetta dark and stormy maple orange tempeh matcha grains hot cranberry spritzer green tea lime black beans lemon tahini dressing crumbled lentils ginger carrot spiced juice leek red curry tofu noodles veggie burgers. Toasted hazelnuts mediterranean
    mushroom risotto avocado golden cayenne pepper Thai basil curry sparkling pomegranate punch red grapes four-layer overflowing berries soy milk. Entree heat lemon lime minty ginger lemongrass agave green tea fiery fruit spicy almond milk chai latte
    pinch of yum apples samosa raspberry fizz macadamia nut cookies alfalfa sprouts cumin mint blueberry chia seed jam avocado basil pesto mocha chocolate zesty tofu pad thai Thai miso dressing appetizer green pepper ultra creamy avocado pesto bite sized
    cilantro. Mediterranean vegetables Indian spiced walnut mushroom tart hazelnut shiitake chickpea crust pizza seeds chocolate mint lime taco salsa cherry bomb pepper bananas hearty mediterranean luxury bowl miso turmeric glazed aubergine artichoke
    hearts eating together cilantro lime vinaigrette summer arugula salad vine tomatoes blood orange smash. Peanut butter chia seeds homemade balsamic paprika ginger tofu green onions Thai curry lime mango crisp cremini mushrooms chai tea lychee seasonal
    sweet potato black bean burrito shiitake mushrooms udon noodles lemon red lentil soup. Bento box simmer salad roasted brussel sprouts kimchi fig arugula cashew salad basmati burritos ultimate lemon sweet potato elderberry mangos balsamic vinaigrette
    sandwiches guacamole. Cauliflower soba noodles peanut butter crunch avocado dressing drizzle portobello mushrooms dill banana bread crispy cashew shaved almonds overflowing black bean wraps green grapes asian pear morning smoothie bowl. Pesto peach
    strawberry mango shallots edamame hummus vegan crunchy seaweed refreshing cucumber splash seitan ghost pepper figs hummus dark chocolate Mexican fiesta tabasco pepper blueberry pops walnut pesto tart salty açai fresh banana frosted gingerbread bites
    banh mi salad rolls. Couscous strawberry mango smoothie tofu strawberry spinach salad smoked tofu Bolivian rainbow pepper hummus falafel bowl chili cherries red amazon pepper basil winter potato summer fruit salad blackberries tasty black bean chili
    dip broccoli rich coconut cream roasted peanuts cool habanero golden instant pot raspberries Thai dragon pepper roasted butternut squash. Creamiest cherry dragon fruit lemonade zest kale enchiladas pasta butternut mix parsley hemp seeds second course
    chili pepper picnic salad coriander street style Thai basil tacos Southern Italian peppermint creamy cauliflower alfredo sauce green tea cozy butternut apricot cayenne muffins red pepper spiced peppermint blast. Almond milk lemongrass lingonberry
    oranges coconut peaches green papaya salad cozy cinnamon oatmeal farro platter red lentil curry Caribbean red habanero green bowl earl grey latte apple vinaigrette one bowl a delicious meal cherry bomb smoky maple tempeh glaze comforting pumpkin spice
    latte onion Thai super chili cookies tomato and basil hearts of palm pomegranate Bulgarian carrot pine nuts. Pumpkin dessert naga viper springtime strawberry vitamin glow orange coconut sugar lime tempeh jalapeño crunchy double dark chocolate.
  </div>
  <div class="pagination">
    Pagination
  </div>
</div>

代码笔:https://codepen.io/t0nez/pen/MWBbyKo

uubf1zoe

uubf1zoe1#

.tickets上使用align-items: flex-start;

.toolbar {
  background-color: deeppink;
}

.tickets {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background-color: lime;
  font-size: 3em;
  word-break: break-word;
  overflow: auto;
}

.pagination {
  background-color: cyan;
}

.has-pagination {
  outline: 3px dotted black;
  height: 100%;
  background-color: grey;
  display: flex;
  flex-direction: column;
}

body {
  padding: 0;
  margin: 0;
  height: 100vh;
}
<div class="has-pagination">
  <div class="toolbar">
    Toolbar
  </div>
  <div class="tickets">
    Crispy iceberg lettuce cool off edamame Italian linguine puttanesca chocolate peanut butter dip Thai sun pepper blueberries cocoa kale caesar salad spiced pumpkin chili cinnamon toast Italian pepperoncini picnic Malaysian grenadillo. Salted scotch bonnet
    pepper spring chocolate cookie cinnamon quinoa flatbread creamy cauliflower alfredo plums sweet potato falafel bites strawberries main course candy cane winter chilies garlic sriracha noodles. With sleepy morning tea soup lavender lemonade Sicilian
    pistachio pesto cool cucumbers kung pao pepper citrusy coconut milk grapefruit summertime casserole sriracha pecans delightful blueberry scones fruit smash tahini drizzle almonds pineapple salsa sesame soba noodles lentils Chinese five-spice powder.
    Bruschetta dark and stormy maple orange tempeh matcha grains hot cranberry spritzer green tea lime black beans lemon tahini dressing crumbled lentils ginger carrot spiced juice leek red curry tofu noodles veggie burgers. Toasted hazelnuts mediterranean
    mushroom risotto avocado golden cayenne pepper Thai basil curry sparkling pomegranate punch red grapes four-layer overflowing berries soy milk. Entree heat lemon lime minty ginger lemongrass agave green tea fiery fruit spicy almond milk chai latte
    pinch of yum apples samosa raspberry fizz macadamia nut cookies alfalfa sprouts cumin mint blueberry chia seed jam avocado basil pesto mocha chocolate zesty tofu pad thai Thai miso dressing appetizer green pepper ultra creamy avocado pesto bite sized
    cilantro. Mediterranean vegetables Indian spiced walnut mushroom tart hazelnut shiitake chickpea crust pizza seeds chocolate mint lime taco salsa cherry bomb pepper bananas hearty mediterranean luxury bowl miso turmeric glazed aubergine artichoke
    hearts eating together cilantro lime vinaigrette summer arugula salad vine tomatoes blood orange smash. Peanut butter chia seeds homemade balsamic paprika ginger tofu green onions Thai curry lime mango crisp cremini mushrooms chai tea lychee seasonal
    sweet potato black bean burrito shiitake mushrooms udon noodles lemon red lentil soup. Bento box simmer salad roasted brussel sprouts kimchi fig arugula cashew salad basmati burritos ultimate lemon sweet potato elderberry mangos balsamic vinaigrette
    sandwiches guacamole. Cauliflower soba noodles peanut butter crunch avocado dressing drizzle portobello mushrooms dill banana bread crispy cashew shaved almonds overflowing black bean wraps green grapes asian pear morning smoothie bowl. Pesto peach
    strawberry mango shallots edamame hummus vegan crunchy seaweed refreshing cucumber splash seitan ghost pepper figs hummus dark chocolate Mexican fiesta tabasco pepper blueberry pops walnut pesto tart salty açai fresh banana frosted gingerbread bites
    banh mi salad rolls. Couscous strawberry mango smoothie tofu strawberry spinach salad smoked tofu Bolivian rainbow pepper hummus falafel bowl chili cherries red amazon pepper basil winter potato summer fruit salad blackberries tasty black bean chili
    dip broccoli rich coconut cream roasted peanuts cool habanero golden instant pot raspberries Thai dragon pepper roasted butternut squash. Creamiest cherry dragon fruit lemonade zest kale enchiladas pasta butternut mix parsley hemp seeds second course
    chili pepper picnic salad coriander street style Thai basil tacos Southern Italian peppermint creamy cauliflower alfredo sauce green tea cozy butternut apricot cayenne muffins red pepper spiced peppermint blast. Almond milk lemongrass lingonberry
    oranges coconut peaches green papaya salad cozy cinnamon oatmeal farro platter red lentil curry Caribbean red habanero green bowl earl grey latte apple vinaigrette one bowl a delicious meal cherry bomb smoky maple tempeh glaze comforting pumpkin spice
    latte onion Thai super chili cookies tomato and basil hearts of palm pomegranate Bulgarian carrot pine nuts. Pumpkin dessert naga viper springtime strawberry vitamin glow orange coconut sugar lime tempeh jalapeño crunchy double dark chocolate.
  </div>
  <div class="pagination">
    Pagination
  </div>
</div>

相关问题