html - Why isn't my 2-column Pure CSS layout working? -
i'm trying create simple meteor web application, struggling produce working 2 column layout defined via pure responsive grid. problem demonstrated in below screenshot; heading should 2 columns on 1 line, not 2 (lines) , "sidebar content" should in column left of "ace editor demo":
you may visit live version of application see problem yourself. additionally, i've published project on github.
it'd make me happy if point out why intended 2 column layout isn't working intended. i've tested chromium 28.0.1500.71 , firefox 23.0.
code
styling
this application's style sheet (written in stylus):
menu-background = #272f32 menu-color = #daeaef padding-horizontal = 3em padding-vertical = 1em padding-top = 35px .content border-radius: 10px margin-top 39px background-color white padding-left 0px padding-right 0px // padding-top padding-vertical padding-bottom padding-vertical .content-ribbon background-color white //padding-left padding-horizontal //padding-right padding-horizontal #sidebar padding-left: 20px padding-top: padding-top #editor-container padding-top: padding-top border-left: 1px solid padding-left: padding-horizontal height: 600px & > h1 margin-top: 0 .ace_editor width: 700px height: 500px #menu background-color menu-background .pure-menu-heading //padding-left: 40px //padding-right: 7px // width: 170px color white li color menu-color &:hover background-color rgb(51, 51, 51) &.pure-menu-selected -webkit-box-shadow inset 0 3px 8px rgba(0, 0, 0, 0.125) -moz-box-shadow inset 0 3px 8px rgba(0, 0, 0, 0.125) box-shadow inset 0 3px 8px rgba(0, 0, 0, 0.125) background-color: #111111 color rgb(220, 220, 220) footer //margin-top 5em margin-top 0px border-top 1px solid menu-background padding 1em color black text-align center font-size 80%
html
the application's html, angular template (angular.html) , partial (partials/home.html); may notice root div defines pure responsive grid (class pure-g-r
), columns defined through classes pure-u-1-5
(left column) , pure-u-4-5
(right column):
angular.html
<div class="content pure-g-r" data-ng-controller="meteorctrl"> <header class="pure-u-1"> <nav id="menu" class="pure-menu pure-menu-open pure-menu-fixed pure-menu-horizontal"> <div class="pure-u-1-5"> <div class="pure-menu-heading">meteor-ace</div> </div> <ul class="pure-u-4-5"> <li data-ng-repeat="menuitem in menuitems"> <a href="{{menuitem.address}}">{{menuitem.name}}</a> </li> </ul> </nav> </header> <article id="content" class="pure-u-1"> <div class="pure-g-r content-ribbon"> <div class="pure-u-1"> <div data-ng-view></div> </div> </div> <footer class="pure-u-1"> made excellent <a href="http://meteor.com/">meteor</a> framework , <a href="http://meteor.com/">angularjs</a>. © 2013 arve knudsen </footer> </article> </div>
partials/home.html
<div class="pure-u-1-5"> <div id="sidebar">sidebar content</div> </div> <div class="pure-u-4-5"> <div id="editor-container"> <h1><a href="http://ace.c9.io/">ace</a> editor demo</h1> <!--<div data-ui-ace></div>--> </div> </div>
as turns out, problem nested grid columns within columns (oops). following html rectified , doesn't exhibit layout problems:
angular.html
<div class="content pure-g-r" data-ng-controller="meteorctrl"> <header> <nav id="menu" class="pure-menu pure-menu-open pure-menu-fixed pure-menu-horizontal"> <div class="pure-u-1-5"> <div class="pure-menu-heading">meteor-ace</div> </div> <ul class="pure-u-4-5"> <li data-ng-repeat="menuitem in menuitems"> <a href="{{menuitem.address}}">{{menuitem.name}}</a> </li> </ul> </nav> </header> <article id="content"> <div class="content-ribbon"> <div data-ng-view></div> </div> <footer class="pure-u-1"> made excellent <a href="http://meteor.com/">meteor</a> framework , <a href="http://meteor.com/">angularjs</a>. © 2013 arve knudsen </footer> </article> </div>
partials/home.html
<div class="pure-u-1-5"> <div id="sidebar">sidebar content</div> </div> <div class="pure-u-4-5"> <div id="editor-container"> <h1><a href="http://ace.c9.io/">ace</a> editor demo</h1> <div data-ui-ace></div> </div> </div>
Comments
Post a Comment