+ 3
Help! Add an Image!
I really donât know how to add an image on this app. I used different kinds of things like img and link and whatever. The link is correct. I also donât know how to put in in the center. Align, margin-right:auto; text-align.. nothing works!! The img is at 20 in HTML and 23 in CSS. Please help! Thank you all! https://code.sololearn.com/W1GNudM64TXH/?ref=app
12 RĂ©ponses
+ 6
To center elements the use of <center> is currently not recommended, since it is not part of HTML 5. One solution would be to do the following:
HTML:
<div>
    <img src = "http://www.laurakroon.nl/lauraa.jpg" width = "150px" height = "150px" />
</ div>
CSS:
div {
    text-align: center;
}
+ 4
well. it worked for here..
i know i shouldnât use it for ârealâ websites. but other ways didnât work until monique said i could use <center>
next time i try out divs! :) wondering if the floats etc work here..
+ 3
Thank you so beep much!!! I donât know what <center> is or was, but it worked!!!!
is it an older html?
+ 2
In the HTML it should be âsrcâ, not âscrâ.
+ 2
center its deprecated in HTML5... Remove it and use pure CSS like:
img{
display:block;
margin:0 auto;
}
+ 1
I changed the type error, but the picture still doesnât show! :( thank you for helping me though!
edit 22:23 :
apparently I had to add http:// into it!? but ohh well! it shows now!
now my other q: how to put it in the center? probably something simple too I just donât see or forgot!