Javascript Does not recognize the dimensions

Asked

Viewed 26 times

-1

This was to generate a green square on the screen, but nothing appears... if I put some word inside the span it appears with the green background, but not in the size I set in the script. Somebody give me a hand??

inserir a descrição da imagem aqui

1 answer

1

span ė an element of the type inline.

Elements inline has the size defined by its content, even if you assign a size manually.

Many attributes of CSS shall apply only under the right conditions.

To give a size to the span, give him the property display: inline-block.

  • I think that’s not the problem, because I tried the same thing using a div and the result was the same.

Browser other questions tagged

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