Why the image not aligne to center 👇👇👇 | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 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 Antworten
+ 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