Why can't I make these things show on the same line?
<div id="demo" style="display: inline;">
<div style="color:#DD4814; 开发者_JAVA技巧font-weight:bold; font-size:25px;">Buscá tu colegio:</div>
<img src="Imagenes/info.png" title="Escribí el nombre <u>completo</u>. Si es un colegio no escribás 'colegio' o 'escuela' a menos que sea 'Escuela Normal', 'Escuela 1' o similar."/>
</div>
I tried display:inline I thought that was the way to do it. I couldn't anyway I'm sure it's easy. Thanks
You only put inline on the first div. The other is a block element by default, which ensures that it will have a linebreak before and after it.
Oh, I just noticed that the second div is nested in the first. display: inline
is not inherited. If you want the things inside the outer div to be inline, you'll need to make them inline.
Try setting display: inline
on each individual element you want to appear on the same line, not the outer/containing element
Also, consider using a span
for your text. You may also want to look into float
for the image.
精彩评论