1
Is there any way to pass CSS code to HTML tag? Example, I have the tag below:
<img src="../img/cS-1.jpg" alt="Smiley face">
any css code I put for this image to appear inside the img tag when I go in the browser and inspect element? Example stand this way
I actually only need the original photo size inside the tag
With JS you can put the style directly in the tag, or in the same hand ,putting <img style="width:100px; height:100px;"...>. In Developer Tools of Chrome vc tb you can refer to the height and width of the image (shortcut F12 on the keyboard)
– hugocsl
It can’t be in the hand, it is to index in google the moment user upload the image in CMS the size has to go to tag, as I do in JS has some example?
– Henrique
you want to put inside a tag
<i>conteudo</i>
where content would be the height and width of an image ?– Vinicius Shiguemori
It’s a little confusing there...haha. In short, if the original size of my photo is 100x100 inside my <img> tag it needs to look like this <img src=".. /img/Cs-1.jpg" alt="Smiley face" width:100px; height:100px> must appear inside the tag understand?
– Henrique
Possible duplicate of Get original image dimension with Javascript
– Laércio Lopes