Note that there are some explanatory texts on larger screens.

plurals
  1. POHeight inheritance and vertical alignment ( inline-block )
    primarykey
    data
    text
    <p>I have the hardest time getting how those thing work and I'd love it if someone could explain it to me.</p> <p><a href="http://d.pr/i/6TgE+" rel="nofollow noreferrer">1 http://d.pr/i/6TgE+</a></p> <p><a href="http://d.pr/i/UAZn+" rel="nofollow noreferrer">why http://d.pr/i/UAZn+</a></p> <p>*it's actually 9.</p> <p>I have this code:</p> <pre><code>&lt;header&gt; &lt;div class="container"&gt; &lt;div class="grid"&gt; &lt;div class="grid__item one-half"&gt; &lt;a href="index.html" class="logo-site"&gt; &lt;img src="http://aurelieremia.be/img/logo-aurelie.svg" alt="logo-ar"&gt; &lt;/a&gt; &lt;/div&gt;&lt;!-- --&gt;&lt;div class="grid__item one-half"&gt; &lt;nav&gt; &lt;ul class="nav main-nav"&gt; &lt;li&gt; &lt;a href="#" class='active'&gt;work&lt;/a&gt; &lt;a href="#"&gt;about&lt;/a&gt; &lt;a href="#"&gt;process&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/nav&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/header&gt; </code></pre> <p>and this CSS : </p> <pre><code>.container { max-width: 1140px; height: 40px; margin: 0 auto; } header { background: #4f4348; height: 40px; position: relative; } .logo-site { height: 82%; background: #938b88; display: inline-block; } .logo-site img { height: 28px; vertical-align: middle; display: inline-block; line-height: 40px; } .main-nav a { font-size: 14px; text-transform: uppercase; color: #f5f3e2; line-height: 40px; margin-right: 10px; font-family: "Brandon Grotesque Medium"; } .main-nav a.active, .main-nav a:hover { background: #f5f3e2; color: #4f4348; } </code></pre> <p>in case you're not familiar with inuit.css, here's the code that I used from this framework:</p> <pre><code>.grid{ margin-left:-$base-spacing-unit; list-style:none; margin-bottom:0; } .grid__item{ display:inline-block; width:100%; padding-left:$base-spacing-unit; vertical-align:top; @if $global-border-box == false{ @include vendor(box-sizing, border-box); } one-half { width:50%; } </code></pre> <p>My first grid__item doesn't take up 100% of the height from their parent, the grid and container. I tried with height, and a bunch of things, doesn't work. Only way I found to make it work was to make my logo larger.</p> <p>The second grid__item works, but it's because I applied a line-height with the value of the header on it to center it. However, I want to add border for the active state (5px from the text), so it doesn't help that the links take up all the height. But the problem would be to center it.</p> <p>What I'd like:</p> <p><a href="http://d.pr/i/6Ggm+" rel="nofollow noreferrer">dream http://d.pr/i/6Ggm+</a></p> <p><a href="http://jsfiddle.net/a9wnG/" rel="nofollow noreferrer">Link to fiddle</a></p> <p>Please. Help.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload