Small micro-channel program (iii) - WXSS

1. Style Import

Use @importstatement outreach stylesheet may be introduced, @importfollowed by the relative path to be imported stylesheet outreach, with ;the end of the statement represented.

First create a file in the page file to style, and write a style file box.wxss;

box.wxss:

.box{
    height: 100px;
    width: 100px;
    color: blueviolet;
    font-size: 50px;
}

Then create a new file, write the contents of a file in its wxml inside;

wxml:

<view class="box">box</view>

 Here we need to import wxss file inside;

@import "../style/box.wxss";

Note here that the directory hierarchy problem, because the style file is a file with the Index is juxtaposed, so to return to the previous file directory;

running result:

 

 

Guess you like

Origin blog.csdn.net/qq_37084904/article/details/91542584