b0ss
b0ss

Reputation: 119

Semantic UI Grid Column not adapting height

Im trying out semantic UI. I want to make some admin Panel cards with stats but I have the problem, that if I change the font size of the number inside the column, it overflows the segment... Same with cards.

This is my html:

<div class="ui grid container">
  <div class="four wide column">
    <div class="ui segment">
      <div class="ui container stat-number">12</div>
    </div>
  </div>
</div>

The Css which belongs to the html:

.stat-number {
  font-size: 50px;
  float: left;
}

.stat-icon {
  float: left;
}

And this is the result: enter image description here

Upvotes: 1

Views: 276

Answers (1)

showdev
showdev

Reputation: 29168

One solution might be to use the "clearing" class.

.stat-number {
  font-size: 50px;
  float: left;
}

.stat-icon {
  float: left;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css" rel="stylesheet" />

<div class="ui grid container">
  <div class="four wide column">
    <div class="ui segment clearing">
      <div class="stat-number">12</div>
      <div class="stat-icon">*</div>
    </div>
  </div>
</div>

I am no expert in Semantic UI.
There might be a more appropriate way to float elements with classes.

Upvotes: 0

Related Questions