+ 1
How do you place an image at the center or at the left side of a page ?
I tried using the align attribute ( < p align=""> ) but it works only for text I guess , so what should we do to place an image at center or anywhere else ?
6 Antworten
+ 2
first you have to add viewport meta tag in head like this
<meta name="viewport" content="width=device-width, initial-scale=1">
then add this attribute to you container like this
<div style="text-align: center" >
<img src="path" ></img>
</div>
and if you comfortable with flexbox then use flexbox box in container like this
display: flex;
justify-content: center // for horizontal alignment
align-items: center; // for vertical alignment
+ 1
you will learn this in css part
+ 1
if you are in learning phase plz plz only use chrome as your learning browser.
0
thanks ! it worked :) and btw at which part of the programming do I learn it ? right now I'm learning the images part of HTML
0
ohk got it , thanks !
0
yeahh , I'm using chrome as my learning browser