I found "equal height" classes in Semantic UI, but I can't make inner div's the same heights ("ui segment" for example).
More detail here .
http://jsfiddle.net/ozk615p6/34/
Check my below Screenshots
<div class="ui container indent border shadow">
<div class="two column stackable ui grid ">
<div class="equal height row">
<div class="column">
<h2 class="ui header center aligned ">Lorem</h2>
<div class="ui segment ">
<div class="ui list ">
<div class="item">
<i class="checkmark icon"></i>
<div class="content">
Lorem
</div>
</div>
<div class="item">
<i class="xmark icon"></i>
<div class="content">
Lorem
</div>
</div>
</div>
</div>
</div>
<div class="column">
<h2 class="ui header center aligned ">Lorem</h2>
<div class="ui segment ">
<div class="ui list">
<div class="item">
<i class="checkmark icon"></i>
<div class="content">
Lorem
</div>
</div>
<div class="item">
<i class="checkmark icon"></i>
<div class="content">Lorem</div>
</div>
<div class="item">
<i class="checkmark icon"></i>
<div class="content">Lorem</div>
</div>
<div class="item">
<i class="xmark icon"></i>
<div class="content">Lorem</div>
</div>
<div class="item">
<i class="xmark icon"></i>
<div class="content">Lorem</div>
</div>
<div class="item">
<i class="xmark icon"></i>
<div class="content">Lorem</div>
</div>
<div class="item">
<i class="xmark icon"></i>
<div class="content">Lorem</div>
</div>
</div>
</div>
</div>
</div>
One approach is to use ui cards per this documentation. In your JSFiddle attached, the version did not yet support equal hight cards which automatically used flex. If you upgrade to latest, you'll obtain support for this.
See an example here: https://jsfiddle.net/5kL2pf7q/1/
According to this post, one possible solution is to use this to match the height of your columns.
Although writing html with just the Semantic UI classes in the code below:
<div class="ui container">
<div class="ui three column doubling stackable grid container">
<% camps.forEach(function (e) { %>
<div class="column">
<h1 class="ui header"><%= e.name %> </h1>
<img src="<%= e.image %>" alt="" class="image small ui">
<p> <%= e.description %></p>
<div class="extra"><div class="ui label">
Read More
</div></div>
</div>
<% }) %>
</div>
</div>
I realized that the columns are already with the same height as you can see here.
Related
I'm struggling with a rather simple task but the lack of CSS experience is getting the better of me:
<div class="row">
<div class="col-lg-3">
<div class="ibox-content m-b-sm border-bottom">
<div class="ibox-title">
<span class="label label-info pull-right">Offline</span>
<h5>Equipment Pass</h5>
</div>
<div class="ibox-content">
<h1 class="no-margins">#Model.AirportPassEquipmentOffline.TransactionCount</h1>
<small># of Transactions</small>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="ibox-content m-b-sm border-bottom">
<div class="ibox-title">
<span class="label label-success pull-right">Online</span>
<h5>Equipment Pass</h5>
</div>
<div class="ibox-content">
<h1 class="no-margins">#Model.AirportPassEquipmentOnline.TransactionCount</h1>
<small># of Transactions</small>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="ibox-content m-b-sm border-bottom">
<div class="ibox-title">
<span class="label label-info pull-right">Offline</span>
<h5>Visitor Pass</h5>
</div>
<div class="ibox-content">
<h1 class="no-margins">#Model.AirportPassVisitorOffline.TransactionCount</h1>
<small># of Transactions</small>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="ibox-content m-b-sm border-bottom">
<div class="ibox-title">
<span class="label label-success pull-right">Online</span>
<h5>Visitor Pass</h5>
</div>
<div class="ibox-content">
<h1 class="no-margins">#Model.AirportPassVisitorOnline.TransactionCount</h1>
<small># of Transactions</small>
</div>
</div>
</div>
</div>
Above is a row on my view. There are many like it:
I want to split the smallest div to show a second Heading1. Here is base HTML:
<div class="ibox-content">
<h1 class="no-margins">#Model.AirportPassEquipmentOffline.TransactionCount</h1>
<small># of Transactions</small>
<h1 class="no-margins">#Model.AirportPassEquipmentOffline.Income</h1>
<small>Income generated</small>
</div>
Target:
I need to show more information and I see that the div card is empty on the right side. I want to split this div into two. Experimenting with bootstrap classes, the layout breaks.
Afer a bit of trial and error, i realized that the small grid class was the issue. I switched to class-md and got the desired result. So this:
<div class="ibox-content">
<h1 class="no-margins">#Model.AirportPassEquipmentOffline.TransactionCount</h1>
<small># of Transactions</small>
<h1 class="no-margins">#Model.AirportPassEquipmentOffline.Income</h1>
<small>Income generated</small>
</div>
Became this:
<div class="ibox-content">
<div class="row">
<div class="col-md-6">
<h1 class="no-margins">#Model.AirportPassEquipmentOnline.TransactionCount.ToString("N0")</h1>
<small># of Transactions</small>
</div>
<div class="col-md-6">
<h1 class="no-margins">AED #Model.AirportPassEquipmentOnline.Income.ToString("N2")</h1>
<small>Revenue generated</small>
</div>
</div>
</div>
For my project (semantic ui) I want to align 2 blocks. Both blocks should be displayed in the horizontal center of the page. Block 1's width is not important since its a small block. Blocks 2 should be 12 columns wide. How can I do this?
Block 1:
<img class="ui small circular image" src="images/large/stevie.jpg">
<h1>Stevie Wonder</h1>
<p>#stevie</p>
<p>Amsterdam, The Netherlands</p>
<button class="ui button">Edit Profile</button>
Block 2:
<div class="ui top attached tabular menu">
<div class="active item">My Bla's</div>
<div class="item">Favorite Bla's</div>
</div>
<div class="ui bottom attached tab segment">
<div class="ui divided items">
<div class="item">
<div class="image">
<img src="/images/wireframe/image.png">
</div>
<div class="content">
<a class="header">12 Years a Slave</a>
<div class="meta">
<span class="cinema">Union Square 14</span>
</div>
<div class="description">
<p></p>
</div>
</div>
</div>
</div>
</div>
</div>
Full code:
<div class="ui main container">
<div class="row">
<div class="column">
<img class="ui small circular image" src="images/large/stevie.jpg">
<h1>Stevie Wonder</h1>
<p>#stevie</p>
<p>Amsterdam, The Netherlands</p>
<button class="ui button">Edit Profile</button>
</div>
</div>
<div class="row">
<div class="column">
<div class="ui top attached tabular menu">
<div class="active item">My Bla's</div>
<div class="item">Favorite Bla's</div>
</div>
<div class="ui bottom attached tab segment">
<div class="ui divided items">
<div class="item">
<div class="image">
<img src="/images/wireframe/image.png">
</div>
<div class="content">
<a class="header">My Neighbor Totoro</a>
<div class="meta">
<span class="cinema">IFC Cinema</span>
</div>
<div class="description">
<p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
make one common div for block1 and block 2
apply css.
html:
<div class="main">
<div class="block1">---</div>
<div class="block2">---</div>
</div>
css:
.main
{
width:suitable size(block1+block2) in pixel
margin:0 auto;
}
.block1
{
width:block1's width;
float:left;
}
.block2
{
width:block2's width;
float:right;
}
I would like to put each semantic ui item into a segment. Whats the right way to do this in semantic ui / html? Should I put item inside segment, segment inside item, or neither?
Items
Items code:
<div class="ui divided items">
<div class="item">
<div class="image">
<img src="/images/wireframe/image.png">
</div>
<div class="content">
<a class="header">12 Years a Slave</a>
<div class="meta">
<span class="cinema">Union Square 14</span>
</div>
<div class="description">
<p></p>
</div>
<div class="extra">
<div class="ui label">IMAX</div>
<div class="ui label"><i class="globe icon"></i> Additional Languages</div>
</div>
</div>
</div>
<div class="item">
<div class="image">
<img src="/images/wireframe/image.png">
</div>
<div class="content">
<a class="header">My Neighbor Totoro</a>
<div class="meta">
<span class="cinema">IFC Cinema</span>
</div>
<div class="description">
<p></p>
</div>
<div class="extra">
<div class="ui right floated primary button">
Buy tickets
<i class="right chevron icon"></i>
</div>
<div class="ui label">Limited</div>
</div>
</div>
</div>
<div class="item">
<div class="image">
<img src="/images/wireframe/image.png">
</div>
<div class="content">
<a class="header">Watchmen</a>
<div class="meta">
<span class="cinema">IFC</span>
</div>
<div class="description">
<p></p>
</div>
<div class="extra">
<div class="ui right floated primary button">
Buy tickets
<i class="right chevron icon"></i>
</div>
</div>
</div>
</div>
</div>
Segment:
Segment code:
<div class="ui segment">
</div>
Semantic UI Items and Segments are not designed to work together (i just ran into this same issue) so my workaround was to add the requisite css to my stylesheet applied to a .ui.segment.item element (you could also place this into the scss templates and use scss variables for colors, spacing, etc. instead to compile this into a custom build of semantic-ui for your site).
So then you can apply both .item and .segment styles to those blocks that you want to have both styles (for any variations like piled or compact, you would have to include those variations as custom styles too of course).
I did it this way because the styles for a segment are fairly self contained, but the ones for an item are quite extensive, so they would be harder to reproduce accurately.
The built in code runner doesn't seem to display correctly, so here is a fiddle with the same code working correctly: https://jsfiddle.net/nw8nte4b/
```
.ui.segment.item {
position: relative;
background: #fff;
box-shadow: 0px 1px 2px 0 rgba(34, 36, 38, 0.15);
margin: 1rem 0;
padding: 1em;
border-radius: 0.25rem;
border: 1px solid rgba(34, 36, 38, 0.15);
}
<link href="https://oss.maxcdn.com/semantic-ui/2.2.4/semantic.min.css" rel="stylesheet" />
<div class="ui centered padded grid">
<div class="ten wide column">
<div class="ui items">
<div class="ui item segment">
<div class="image">
<img src="http://semantic-ui.com/images/wireframe/image.png">
</div>
<div class="content">
<a class="header">12 Years a Slave</a>
<div class="meta">
<span class="cinema">Union Square 14</span>
</div>
<div class="description">
<p></p>
</div>
<div class="extra">
<div class="ui label">IMAX</div>
<div class="ui label"><i class="globe icon"></i> Additional Languages</div>
</div>
</div>
</div>
<div class="ui item segment">
<div class="image">
<img src="http://semantic-ui.com/images/wireframe/image.png">
</div>
<div class="content">
<a class="header">My Neighbor Totoro</a>
<div class="meta">
<span class="cinema">IFC Cinema</span>
</div>
<div class="description">
<p></p>
</div>
<div class="extra">
<div class="ui right floated primary button">
Buy tickets
<i class="right chevron icon"></i>
</div>
<div class="ui label">Limited</div>
</div>
</div>
</div>
<div class="ui item segment">
<div class="image">
<img src="http://semantic-ui.com/images/wireframe/image.png">
</div>
<div class="content">
<a class="header">Watchmen</a>
<div class="meta">
<span class="cinema">IFC</span>
</div>
<div class="description">
<p></p>
</div>
<div class="extra">
<div class="ui right floated primary button">
Buy tickets
<i class="right chevron icon"></i>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
```
I cant seem to see why the content below is not going into the box which it's inside as defined within the HTML
This is the image because I do not have enough rep yet to add it to the formatting http://i.stack.imgur.com/A3nWx.png
This is the HTML which I am using
<div class="row">
<div class="col-md-4">
<div class="block">
<div class="block-title">
<h2>Title</h2>
</div>
<div class="box-body">
<div class="col-md-1">
<h4>Server 1</h4>
<span class="label label-success">Online <i class="fa fa-check"></i></span>
</div>
</div>
</div>
</div>
</div>
Option 1
Looking at your code, I suppose you are using Twitter Bootstrap.
From you code you have the column <div class="col-md-1"> class inside the outer column <div class="col-md-4">.
For example:
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-md-3">
<div class="row">
<div class="col-md-1">
</div>
</div>
</div>
</div>
</div>
</div>
Please note that bootstrap requires that you wrap a columns with a <div class="row"> so as to clear the float.
Option 2
You could add clear: both; in the class .box-body in your css code. It will clear the column float.
md_5 Hi there. Looks like you are wanting to have the title have it's own area from the box-body.
How about something like this example.
I use some color to show each block.
Here is the Fiddle.
<div class="container col-xs-6 block1">
<div class="row">
<div class="col-md-4">
<div class="block-title bg-primary">
<h2>Title</h2>
</div>
<div class="box-body col-md-12 bg-info">
<h4>Server 1</h4>
<span class="label label-success">Online <i class="fa fa-check"></i></span>
</div>
</div>
</div>
</div>
To fix this I added the clearfix class. Thanks for reminding me, Math4w.
Here is a link to some documentation regarding the clearfix class: http://getbootstrap.com/css/#grid-responsive-resets
So the final code looked like this,
<div class="row">
<div class="col-md-4">
<div class="block">
<div class="block-title">
<h2>Servers</h2>
</div>
<div class="clearfix">
<div class="col-md-4">
<p class="well text-center">
<strong>Server 1</strong>
</br>
<span class="label label-success"><i class="fa fa-check">Online</i></span>
</p>
</div>
</div>
</div>
</div>
</div>
I am trying to create 3 columns inside a panel but for some reason the xs viewport does not look right. The last column moves below the row. You can see it on this jsfiddle.
Any clues what I might be doing wrong?
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="panel panel-default content-parent">
<div class="panel-header content-header">
<div class="row content-header-assets">
<div class="col-xs-1">
<i class="fa fa-angle-left content-header-actions"></i>
</div>
<div class="col-xs-10">
<h1 class="content-header-title text-center">Some long text</h1>
</div>
<div class="col-xs-1">
<i class="fa fa-angle-right content-header-actions"></i>
</div>
</div>
</div>
<div class="panel-body">
<div class="content-body col-xs-12 col-sm-10 col-md-9 col-lg-7 block-center">
</div>
</div>
<div class="panel-footer content-footer text-center">
</div>
</div>
</div>
</div>
</div>
.col-*-1 is 8.33333333% of the space provided, so your content (the .fa .fa-angle-right/left) doesn't fit since it's larger than 8.333%. This is not the best solution for this type of layout, but you can try .col-xs-2 on the left and right and .col-xs-8 on the middle.