简体   繁体   English

如何更改图像的宽度和高度?

[英]How to change the width and height of an image?

So I'm trying to change the width and height of my circles that have images inside them, to make it responsive. 因此,我尝试更改内部有图像的圆圈的widthheight ,以使其具有响应性。 On the query for responsiveness I did this: 在响应性查询中,我这样做:

@media screen and (max-width: 580px) {

  #Equipe .equipe img{
   width: 50px;
   height: 50px;
  }
  ...
.Equipe{
  margin: 0;
  padding: 1px;
  background-color: #ffffff;
  width: 100%;
  height: 100vh;
  overflow-y:hidden;
}

.equipe{
  width: 20%;
  float: left;
  margin: 10px;
  padding: 15px;
  color: #676767;
  border-radius: 15px;
}

.equipe img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  margin: 80px 20px 30px 0;
  border: 5px solid #46664d;
}
...

The reason why i'm writing #Equipe .equipe img is because equipe it's inside the div Equipe. 我编写#Equipe .equipe img的原因是因为equipe在div Equipe内部。

<div id="nossa-equipe">
      <div class="Equipe">
          <h8>Equipe</h8>
          <div class="equipe">
            <img src="./img/rodrigo.jpeg">
            <h7>Rodrigo Ferreira/Developer
            </h7>
          </div>
...

But the width and height of my circles aren't changing. 但是我的圈子的宽度和高度没有改变。 Help? 救命?

You have to insert the media query after the regular styles in your CSS stylesheet. 您必须在CSS样式表中的常规样式之后插入媒体查询。 If you have them in the order you posted them in your question, the "regular" styles will overwrite the mobile styles (since they follow after the mobile styles and are valid for all sizes). 如果您在您发布他们在你的问题的顺序有他们,在“常规”样式将覆盖移动样式(因为他们遵循的是手机的款式适用于所有尺寸)。 Just turn the order around... 只是把订单转过来...

In the HTML code posted by you, I see that <div class="Equipe"> => Equipe is a class, not an ID. 在您发布的HTML代码中,我看到<div class="Equipe"> => Equipe是一个类,而不是ID。 So it should be referenced with a . 因此,应使用引用. in CSS. 在CSS中。 Selector #Equipe .equipe img{ in the media query should be .Equipe .equipe img{ . 媒体查询中的选择器#Equipe .equipe img{应该是.Equipe .equipe img{

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

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