+ 9
☑️SOLVED☑️How do you place text beside an image in HTML?☑️SOLVED☑️
I haven't learnt CSS yet. And how can I write the text beside (right or left to) the image
15 ответов
+ 1
Please try my last :-
https://code.sololearn.com/W1gTUL384V77/?ref=app
+ 6
Thanks ŚĄŃ [Exams]
+ 6
Thanks ŚĄŃ [Exams] 😊, but I asked BESIDE an image, not ON TOP of the image
+ 5
You can place text next to the image like this :
<label for="img">text here</label>
<img id="img" width="100" height="100">
+ 5
Mohammed Alotaibi I tried doing that but it didn't work....
+ 5
Thank you so much San!!!! I'm so sorry for bothering you😅😅
+ 5
Ok, thank you Mohammed Alotaibi !
+ 4
Thank you Mohammed Alotaibi and Ярослав Вернигора(Yaroslav Vernigora)
I'll try and see if it works
😊
+ 2
Hi! try to learn all the same
+ 1
+ 1
Hi
There is more than one way to line up the text next to the image or any element you want .
by using CSS code we create <div> element and assign ID's to it
then write the code between <style> tag inside <head> tag ..
see the following example
* I added
#myP
#myImg
For you to try it
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
#myDiv{
display: flex;
}
#myP {
margin: auto;
}
#myImg {
margin: auto;
}
</style>
</head>
<body>
<div id="myDiv">
<div id="myImg">
<img width="100" height="100">
</div>
<div id="myP">
<p>my text here</p>
</div>
</div>
</body>
</html>
I recommend that you read some of the explanations of the CSS, to get more information about it
+ 1
Use figure and figcaption :
<figure>
<img "" />
<figcaption> some text </figcaption>
</figure>
0
it worked soo cool
0
Not clear