Why the image not aligne to center šŸ‘‡šŸ‘‡šŸ‘‡ | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Why the image not aligne to center šŸ‘‡šŸ‘‡šŸ‘‡

<img src='a.png' align="center">

2nd Aug 2021, 1:55 PM
RD:programmer
RD:programmer - avatar
4 Respostas
+ 4
Because align is not an attribute of img tag. You can put inside another tag then apply center using CSS.
2nd Aug 2021, 2:02 PM
AĶ¢J
AĶ¢J - avatar
+ 4
<img> tag can't be directly placed in center you have do eigther by writing this <div align="center"> <img src="panda.png" /> </div> or use can use <p> An <img> element is an inline element (display value of inline-block ). It can be easily centered by adding the text-align: center; CSS property to the parent element that contains it. To center an image using text-align: center; you must place the <img> inside of a block-level element such as a div [ By freeCodeCamp ]
2nd Aug 2021, 2:05 PM
Abhiyantā
Abhiyantā - avatar
+ 2
Use <center> Tags: <center><img src='a.png'></center>
2nd Aug 2021, 4:09 PM
Sancho Godinho
Sancho Godinho - avatar
+ 1
If you play html challenge you will find your answers there img tag can't be used without any parent tag link p div or something
4th Aug 2021, 6:42 AM
Jano cĢ½Ķ“oĢ½Ķ“dĢ½Ķ“eĢ½Ķ“rĢ½Ķ“
Jano cĢ½Ķ“oĢ½Ķ“dĢ½Ķ“eĢ½Ķ“rĢ½Ķ“ - avatar