简体   繁体   English

DatePicker的CSS看起来不太好

[英]DatePicker's css does not look very good

I develop an application in ReactJS and I need a DatePicker component. 我在ReactJS中开发了一个应用程序,我需要一个DatePicker组件。

I inserted it, I worked a bit on the CSS side but I do not know why the background to the calendar is transparent, that is, it can be seen when selecting the date below. 我插入了它,我在CSS方面做了一些工作,但是我不知道为什么日历的背景是透明的,也就是说,在选择下面的日期时可以看到它。

In App.js file: 在App.js文件中:

         <div className="row">
            <div className="example-config col-xs-12 col-md-12 example-col">
                <p>The period selected is: <br />
                    start: {`${this.state.value.start}`}<br />
                    end: {`${this.state.value.end}`}
                </p>
            </div>
            <div className="col-xs-12 col-md-12 example-col">
                <p className="choose">Choose dates:</p>
                <DateRangePicker className="Calendar"
                    value={this.state.value}
                    onChange={this.handleChange}
                />
            </div>
        </div>

In App.css file: 在App.css文件中:

.example-col { 
    display: inline-block; 
    vertical-align: top; 
    padding-right: 20px; 
    padding-bottom: 20px;
    border-radius: 25px;
  }
  .example-config {
    margin: 0 0 20px; 
    padding: 20px; 
    background-color: rgba(0,0,0,.03);
    border: 1px solid rgba(0,0,0,.08); 
    border-radius: 25px;
  }

I want the backgound to be a fixed color, not to be transparent. 我希望背景色是固定的颜色,而不是透明的。

This is because in .example-config you are using background color as rgba and a means alpha it is used for opacity which makes it transparent, so instead of rgba use rgb . 这是因为在.example-config您将背景色用作rgba并且将alpha用作不透明性使其透明,因此使用rgb代替rgba

For example 例如

background-color: rgb(0,0,0);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM