JohnDole
JohnDole

Reputation: 565

Hide text when resize a div vertically

Currently I have this:

m

When I resize this container, the text is out of my box.

enter image description here

How my card is made:

<div class="container selfsizing nobackground">
    <div class="row selfsizing">
        <div class="col-sm nopadding">
            <div class="d-flex justify-content-between">
                <span style="font-weight: bold;">{{dashboard_card['card_title']}}</span>
                <form method="post">
                    <button name="deleteCard" class="delete" type="submit" value="{{dashboard_card['id']}}">x</button>
                </form>
            </div>
            <div class="d-flex justify-content-between card-text">
                <span style="font-weight: bold;">{{dashboard_card['card_text']}}</span>
            </div>
        </div>
    </div>
</div>

How can I hide the text, when I resize the div vertically?

Upvotes: 2

Views: 1352

Answers (1)

Hemant Parashar
Hemant Parashar

Reputation: 3774

You can use overflow:hidden; css property on the container.

.container{
   overflow:hidden;
}

example

.container {
  width: 300px;
  background: orange;
  padding: 10px;
  margin: 20px auto;
}

.container.overflow-h {
  width: 300px;
  height: 50px;
  background: orange;
  overflow: hidden;
  padding: 10px;
  margin: 20px auto;
}
<div class="container overflow-h">
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
    in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>

<div class="container">
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
    in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>

Hope this helps!

Upvotes: 2

Related Questions