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

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:

主站蜘蛛池模板: 大田县| 措美县| 南京市| 禹城市| 临沂市| 博野县| 叶城县| 米易县| 文登市| 肇州县| 阿图什市| 乐至县| 阿巴嘎旗| 贺州市| 西峡县| 顺义区| 黄梅县| 宁河县| 牡丹江市| 广元市| 怀安县| 突泉县| 黑山县| 胶南市| 陆丰市| 台中市| 瓦房店市| 天长市| 兴业县| 葵青区| 溧阳市| 利辛县| 濉溪县| 湖州市| 婺源县| 嘉禾县| 曲阜市| 佛山市| 德庆县| 修武县| 高安市|