Img height attribute not working

Img height attribute not working
0

hi, sorry for my English

Normaly when I write in CSS

.image {
  width: 6%;
  height: 30%;
}

it works, but now not…how write the Tag

 <p>
  <img class="image" src="photo/image.jpg" alt="" />
</p>

Also, change the format with GIMP nothing to change…only works the width attribute, but not the height attribute …
but when write height with px change it…

.image {
  width: 6%;
  height: 30px;
}

What tag are you talking about excatly?
The div id?

You said you changed the format with GIMP? but i see no GIMP anywhere in your code?
Is this a lesson do you have a link to it?

I suggest you take a look at the links bellow for more about positioning:
https://www.w3schools.com/css/css_howto.asp
https://www.w3schools.com/css/css_dimension.asp

Very Thanks for your answer!

What tag are you talking about excatly?
The div id?

not, I to try to build a nav Element with images,

<nav>

 <p><img class="image" src="Photo/canannno2.jpg" alt="display my network connection" /></p>

</nav>

I build my website Grid Layout,

I to connect this File with a .css file, how have built it,

@media only screen and (min-width: 71em) and (max-width: 80em) {


  
   body {
       display: grid;
       display: -ms-grid; 
       background-color: #eaf6e5;
       grid-row-gap: 0.3125rem;
       grid-template:
       
        "nav nav nav" auto
        "main main main" auto
        "main main main" auto
        "footer footer footer" auto 
       
       -ms-grid-columns: 8% 64% 28%;
       -ms-grid-row:  7.5rem 5rem 6.4375rem; 
       -ms-grid-gap: 0.3125rem;
    
    }

  
nav {
	grid-area: nav;
    display: block;
	-ms-grid-column-span: 3;
	-ms-grid-column: 1;
    -ms-grid-row: 1;
    
   background-color: #d2f5c4;
   margin: 2rem;
  

}


main {
    
    grid-area: main;
    display: block; 
    -ms-grid-column-span: 3; 
    -ms-grid-column: 1;
    -ms-grid-row-span: 2;
    -ms-grid-row: 3;
   
    
   
    background-color: #e1f2d9;
    margin: 0.125rem;
    margin-right: 0.125rem;
    margin-left: 1.4rem;
    
   
   
} 




footer {
    grid-area: footer;
    -ms-grid-column-span: 3;
    -ms-grid-column: 1;
    -ms-grid-row: 4;
   background-color: #99ee7a;

}

}

You said you changed the format with GIMP? but i see no GIMP anywhere in your code?

with GIMP change the image format, jpg, png, webp, but the height not change…

Is this a lesson do you have a link to it?

yes, I to connect my php file with the css file…also, when write internal css nothing to change…
but when write height with px, change it…

.image {

  width: 40%;
  height: 8px;
}

In this case, defining a height as a percentage assumes that the parent has a defined height himself.