Remove linebreak before header

T

Tim Johansson

I've the following code in a div positioned on the top of the page. (Ignore
xmp-tags)
<xmp>
<img src='logo.jpg' alt='Logo'>
<h1>Title</h1>
</xmp>
I want "Title" to show up right after the logo, though it's printed on the
next line. How do I remove the linebreak that is inserted before <h1>?
Should I use <span> instead?

Thanks in advance.
 
R

Robert Frost-Bridges

Tim said:
I've the following code in a div positioned on the top of the page.
(Ignore xmp-tags)
<xmp>
<img src='logo.jpg' alt='Logo'>
<h1>Title</h1>
</xmp>
I want "Title" to show up right after the logo, though it's printed on
the next line. How do I remove the linebreak that is inserted before
<h1>? Should I use <span> instead?

<h1><img src='logo.jpg' alt='Logo'>Title</h1>
 
J

Jukka K. Korpela

Robert Frost-Bridges said:
<h1><img src='logo.jpg' alt='Logo'>Title</h1>

Maybe rather with alt='', since the text LogoTitle is probably not what
you want rendered when the image is not shown. If the logo contains, say,
"ACME" in styled letters and the Title is "Revolutionary new products",
then alt='ACME: ' might be in order. It all depends on the nature and
purpose of the logo and its context. But mere 'Logo', if you meant that
literally, is most probably unsuitable.
 
R

Robert Frost-Bridges

Jukka said:
Maybe rather with alt='', since the text LogoTitle is probably not
what you want rendered when the image is not shown.

[snip]

You are right of course. I merely copy/pasted the OP's code for a quick
answer, but the 'alt' text needs careful consideration here or we could
end up with '[My Page]My Page' or something similar, as you say.
 
R

Robert Frost-Bridges

Robert Frost-Bridges wrote:

we could end up with '[My Page]My Page' or something similar, as you
say.

Although thinking more about it this would be acceptable if 'My Page' is
appropriate for the image.

Just not 'Logo'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top