如何使椭圆形CSS响应?

时间:2018-05-07 23:04:15

标签: css responsive vuetify.js oval

我将这个椭圆形放在卡片上。该卡响应小屏幕,但椭圆不是。

Here the oval is inside on a card on large screen

Here is on small screen

我想要做的是扩展椭圆形。

这是我的CSS:

    <style scoped>
div.oval {
  position: absolute;
  right: 3.3rem;
  top: 10px;
  width: 130px;
  height: 50px;
  -moz-border-radius: 0 50% / 0 100%;
  -webkit-border-radius: 0 50% / 0 100%;
  border-radius: 150px;
  background: #5cb85c;
  border: 3px solid #555;
}
</style>

我使用Vuetify V-card:

    <v-container fluid grid-list-md>
    <v-flex xs12 sm4 md4 lg2>
   <v-card>
       <v-card-title><v-icon>ev-station</v-icon><h4>Estacion</h4></v-card-title>
       <v-divider></v-divider>
       <v-list-tile>
           <v-list-tile-content>
               <div class="oval"></div>
           </v-list-tile-content>
       </v-list-tile>
       <v-list-tile>
           <v-list-tile-content></v-list-tile-content>
       </v-list-tile>
   </v-card>
    </v-flex>
</v-container>

1 个答案:

答案 0 :(得分:0)

使用百分比宽度并保持最小宽度,使其不超过该限制

div.oval {
  position: absolute;
  right: 3.3rem;
  top: 10px;
  min-width: 70px;
  width: 20%;
  height: 50px;
  -moz-border-radius: 0 50% / 0 100%;
  -webkit-border-radius: 0 50% / 0 100%;
  border-radius: 150px;
  background: #5cb85c;
  border: 3px solid #555;
}