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

Fitting the screen size

If you keep experimenting with your application at runtime, you may notice that the editor component doesn't fit the whole application area once you start resizing the window or maximizing it. To address this, we need to add some CSS styles to tell the component it needs to fit the parent width and height.

Please note that, at the lower level, SimpleMDE wraps another great component called CodeMirror.

CodeMirror is a versatile text editor that's implemented in JavaScript for the browser. It is specialized for editing code and comes with a number of language modes and addons that implement more advanced editing functionality.

Here, we are going to add flex layout features to the whole body of the HTML base and add some styling support for the CodeMirror part, which is part of SimpleMDE. Let's get started:

  1. Update the styles in the index.html file according to the following code:
      <style>
html, body {
height: 100%;
display: flex;
flex: 1;
flex-direction: column;
}

.CodeMirror {
flex: 1;
}
</style>
  1. Run the application and try resizing the window to make it wider or taller. Notice that, now, the markdown editor area perfectly fits the entire page area:

Now, let's move on to integrating the application menu.

主站蜘蛛池模板: 金湖县| 庆云县| 合江县| 武冈市| 武城县| 祥云县| 山阳县| 大丰市| 乌海市| 外汇| 古交市| 古交市| 武强县| 平罗县| 宿州市| 汉川市| 定西市| 交城县| 珲春市| 天峻县| 尚义县| 锦州市| 五寨县| 文水县| 文安县| 资源县| 三原县| 依兰县| 安仁县| 濮阳市| 临西县| 佛坪县| 孙吴县| 阳信县| 商丘市| 安顺市| 和田市| 深泽县| 南江县| 广平县| 安庆市|