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

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:

主站蜘蛛池模板: 改则县| 武清区| 云南省| 米林县| 甘洛县| 滦平县| 左权县| 慈溪市| 仙居县| 阜新市| 和田县| 邛崃市| 汉阴县| 周口市| 宣化县| 视频| 定日县| 乌拉特后旗| 普兰县| 高淳县| 陆良县| 屏东县| 漳平市| 乐亭县| 清丰县| 曲松县| 洪泽县| 新干县| 溆浦县| 永安市| 余江县| 潼南县| 文登市| 武陟县| 丽水市| 射洪县| 墨脱县| 昆明市| 泌阳县| 广饶县| 灵石县|