html - Semantic ui left menu taking too much space -
i trying make dashboard structure using semantic-ui.
i have no other css semantic-ui, , don't load javascript (not semantic-ui), since use react manage lifecycle of elements.
i trying have :
- the "about" page occupies orange part of screen, , more (instead of menu taking orange part well).
- a footer sticks bottom
here structure of page (react data removed) :
<link href="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.8/semantic.min.css" rel="stylesheet"/> <div class="app-wrapper" id="app"> <div> <div> <div id="header"> <div class="header page"> <div class="container ui"> <div href="#" class="floated icon menu right text ui">user</div> <div class="menu text ui"> <a href="geodb.io/home" class="icon item"><i class="emphasized github huge icon mark"></i></a> <a class="item"> <div class="input labeled small ui user"> <div class="label ui">this project</div> <input type="text" placeholder="search"> </div> </a> <a href="#" class="item">home</a> </div> </div> </div> </div> <div id="menu"> <div class="menu pointing secondary ui vertical"> <div><a href="/" class="item">index</a><a href="/faq" class="item">faq</a><a href="/about" class="item active">about</a></div> </div> </div> <div class="container content main text ui"> <div class="dividing header ui">about</div> <div id="view"> <div>about page</div> </div> </div> <div id="footer"> <div class="footer"> <div class="divider section ui"></div> <div class="container ui"> <div class="disabled item">copyright</div> <i class="github icon large mark"></i> </div> </div> </div> </div> </div> </div>
edit sources:
- https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/
- how stick <footer> element @ bottom of page (html5 , css3)?
alright, did testing , found this.
i'm assuming code example direct child of <body>
tag,
my changes:
- removed 2 classless, idless wrapper divs between
div.app-wrapper
,div.header
- added class site app-wrapper
- added class .site-content .container.content.main
if leave 2 in place, footer won't stick @ bottom. here's css code
.site { display: flex; min-height: 100vh; flex-direction: column; } .site-content { flex: 1; } #footer { background-color: #333; width: 100%; bottom: 0; position: relative; }
that's how works in local enviroment.
feedback appreciated
.site { display: flex; min-height: 100vh; flex-direction: column; } .site-content { flex: 1; } #footer { background-color: #333; width: 100%; bottom: 0; position: relative; }
<link href="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.8/semantic.min.css" rel="stylesheet" /> <div class="app-wrapper site" id="app"> <div id="header"> <div class="header page"> <div class="container ui"> <div href="#" class="floated icon menu right text ui">user</div> <div class="menu text ui"> <a href="geodb.io/home" class="icon item"><i class="emphasized github huge icon mark"></i></a> <a class="item"> <div class="input labeled small ui user"> <div class="label ui">this project</div> <input type="text" placeholder="search"> </div> </a> <a href="#" class="item">home</a> </div> </div> </div> </div> <div id="menu"> <div class="menu pointing secondary ui vertical"> <div><a href="/" class="item">index</a><a href="/faq" class="item">faq</a><a href="/about" class="item active">about</a> </div> </div> </div> <div class="container content main text ui site-content"> <div class="dividing header ui">about</div> <div id="view"> <div>about page</div> </div> </div> <div id="footer"> <div class="footer"> <div class="divider section ui"></div> <div class="container ui"> <div class="disabled item">copyright</div> <i class="github icon large mark"></i> </div> </div> </div> </div>
Comments
Post a Comment