markdown 如何改变背景颜色的位置

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 如何改变背景颜色的位置相关的知识,希望对你有一定的参考价值。

# How to Change Position of background-color

[SOURCE](https://stackoverflow.com/a/22081061/1602807), [SOURCE](https://stackoverflow.com/a/39629075/1602807), [SOURCE](https://stackoverflow.com/a/16886425/1602807)

Actually you can't change the position of a `background-color`, instead we need to use a trick to create a `background-image` with solid gradient and position that instead.

Here is the example of a div that have color background fill up and leave around 100px at the bottom unfilled.

```html
<div class="jio-block">
    ...
</div>
<img id="background-bottom" src="{{cdn_url}}assets/images/meet-doctors-background-bottom.svg"/>
```

```css
.jio-block {
    background-image: linear-gradient(#F3F8FF, #F3F8FF);
    background-position: 0 -100px;
    background-repeat: no-repeat;
}

// Extra, use another div with image to cover for that 100px space
#background-bottom {
    width: 100%;
    height: 150px;
    margin-top: -100px;
    position: relative;
    z-index: -1;
}
```

以上是关于markdown 如何改变背景颜色的位置的主要内容,如果未能解决你的问题,请参考以下文章

java 编程 背景颜色的改变

如何改变Linux Shell中的字体和背景颜色

Markdown 编辑器语法——文字颜色、大小、位置、字体与背景色的设置

如何更改myecelipseeclipse的Project Explorer的背景颜色

更改pycharm注释颜色为黑背景下醒目的绿色

Markdown改变字体颜色