My <img> tag does not respond to my css settings

Asked

Viewed 48 times

-1

I was trying to learn HTML, until my image didn’t respond with my CSS:

img#imagens1{
    height: 19.92;
    width: 19.92; 
}

The image was responding until about five minutes ago:

<img src="IconTwiter.png"id="imagens1">

Someone knows how to fix this?

  • 1

    unit 19.92 missing what?

  • I don’t understand what you mean

  • a css measurement unit can be 19.92px

  • All right, let me see if it works that way

  • but I believe that for these numbers are other CSS units: in, px, pt, cm, in...

  • the px deal made it work,

  • Modern CSS units: rem, vh, vw, vmin, Vmax, ex, ch ...

  • I’ve never heard of such measures,

  • http://desenvolvimentoparaweb.com/css/unidades-css-rem-vh-vw-vmin-vmax-ex-ch/

  • 1

    A tip don’t put img#imagens1 since the id reference only to a single element in the document.

  • 1

    yeah, just #imagens1

  • Okay, I’ll consider it :)

  • will save 3 letters, lighter code hahaha

Show 8 more comments

2 answers

1


When you want to pass a size in the CSS you need to indicate in which measure you want to use, as the friend said in the answer above, we have the measure "px" which means pixel. We can use others like, "cm", "mm", "pt" etc... some responsive (change size according to screen size) as "%" and "fr".

How you are learning, try using each one and see how they behave on your page.

Ex:

#imagens1{
    height: 10%;
    width: 10%; 
}

0

I believe that it is not just a lack of measure, try to put it this way

#imagens1{
    height: 19.92px;
    width: 19.92px; 
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.