小编Ram*_*sey的帖子

为什么 CSS Grid 的自动填充属性在列方向不起作用

我正在练习使用行自动填充属性,但是,它并没有按照我的意愿行事。我想创建高度minmax(140px, 200px)为 200 像素的行,其余为 18 像素。为什么会发生?

body,
html {
  height: 100%;
  margin: 0;
}

.wrapper {
  display: grid;
  grid-template-rows: repeat(auto-fill, minmax(140px, 200px));
}

.wrapper>div:nth-child(odd) {
  background-color: red;
}
Run Code Online (Sandbox Code Playgroud)
<div class="wrapper">
  <div class="one"> 1 </div>
  <div class="one"> 1 </div>
  <div class="one"> 1 </div>
  <div class="one"> 1 </div>
  <div class="one"> 1 </div>
</div>
Run Code Online (Sandbox Code Playgroud)

html css vertical-alignment css-grid

3
推荐指数
1
解决办法
3071
查看次数

打印字符串中唯一元音的数量,Java

我需要找到不同元音的数量.我想出了下面的代码,但它无法区分相同的元音:

public static int count_Vowels(String str) {
    str = str.toLowerCase();
    int count = 0;
    for (int i = 0; i < str.length(); i++) {
        if (str.charAt(i) == 'a' || str.charAt(i) == 'e' || str.charAt(i) == 'i'
                || str.charAt(i) == 'o' || str.charAt(i) == 'u') {
            count++;
        }
    }
    return count;
}
Run Code Online (Sandbox Code Playgroud)

java string

1
推荐指数
1
解决办法
739
查看次数

标签 统计

css ×1

css-grid ×1

html ×1

java ×1

string ×1

vertical-alignment ×1