0

make 2 tags in the same line

hello all, how can i make those two tags in one line : in the html code, i have : <strong class="title"> Caractéristiques : </strong> <div> caractéristique1 </div> i have as a result : Caractéristiques : caractéristique1 i should have as a result : Caractéristiques : caractéristique1

26th Feb 2019, 9:42 AM
Oumaima
Oumaima - avatar
4 odpowiedzi
+ 2
Ah Zong s answer is correct. But if you want to have the div inside the code, but still having the inline effect then you have to use CSS. example styles.css div { display: inline; /*divs have the block as the default value to the display value. Changing it to inline will do your job */ }
26th Feb 2019, 12:36 PM
Seniru
Seniru - avatar
+ 1
A <div> element is what we call a block element. That is, when you include the element in your HTML code, it automatically insert a line break and the element is presented with a box. To fix this, you should use inline elements such as span: <strong class="title"> Caractéristiques : </strong> <span> caractéristique1 </span>
26th Feb 2019, 10:06 AM
Ah Zong
Ah Zong - avatar
+ 1
Ah Zong , Seniru Pasan thank you, in fact I could not change the html, so I will just add the inline property to CSS. ;)
26th Feb 2019, 12:39 PM
Oumaima
Oumaima - avatar
+ 1
Oumaima if you want to keep this in HTML tab, you can use the style attribute with the div tag.
26th Feb 2019, 12:45 PM
Seniru
Seniru - avatar