官术网_书友最值得收藏!

Styling the footer

Eventually, we now reached the footer:

./index.html

... 
<footer class="l-app__footer footer">
<h2 class="footer__header">File Explorer</h2>
<select class="footer__select">
<option value="en-US">English</option>
<option value="de-DE">Deutsch</option>
</select>
</footer>

We arrange the application title to the left and language selector to the right. What do we use to lay this out? Obviously, Flexbox:

./assets/css/Component/footer.css

.footer { 
...
display: flex;
flex-flow: row nowrap;
justify-content: flex-end;
}

.footer__header {
margin: 0.2em auto 0 0;
font-size: 1em;
}

It's a special case. We set items to align right in general, but have reset it for the .footer__header item that snuggles against the left border driven by margin-right: auto:

While looking at the result, I think it would be nice to emphasize the functional meaning of some UI elements with icons. I personally prefer the icon font of Material Design system (https://material.io/icons/). So, as described in the Developer Guide (http://google.github.io/material-design-icons/), we include the corresponding Google Web Font to index.html:
./index.html

<link  
rel="stylesheet">

I would suggest that you dedicate a component that will represent an icon and fill it with the rule set suggested by Material Design:

./assets/css/Component/icon.css

.icon { 
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 16px;
display: inline-block;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
}

Now, we can add an icon anywhere in HTML, as simple as that:

<i class="material-icons">thumb_up</i> 

Why not then make a folder icon accompanying items in the directory list?:

<li class="dir-list__li"><i class="icon">folder</i>assets</li> 

I believe that a globe icon will get along nicely with the language selector. So we modify the HTML:

./index.html

... 
<footer class="l-app__footer footer">
<h2 class="footer__header">File Explorer</h2>
<label class="icon footer__label">language</label>
....

and we add a class in the CSS:

./assets/css/Component/footer.css

... 
.footer__label {
margin-right: 0.2em;
font-size: 1.4em;
margin-top: 0.1em;
}

As we run the application we can see an icon rendered next to the language selector control:

If something went wrong after running the application, you can always call for Developer Tools--just press F12:

主站蜘蛛池模板: 牡丹江市| 大同市| 赤壁市| 新野县| 扶风县| 公安县| 东山县| 慈溪市| 嘉禾县| 察隅县| 阜平县| 奉新县| 鄄城县| 莱芜市| 佛冈县| 莱芜市| 白朗县| 阜新| 手机| 祁连县| 手游| 清徐县| 西乌珠穆沁旗| 西宁市| 黄梅县| 徐州市| 木里| 泸西县| 藁城市| 白银市| 长武县| 南乐县| 沙田区| 布拖县| 东海县| 井研县| 建阳市| 普定县| 论坛| 三门县| 萨嘎县|