Vender Aeloth
Vender Aeloth

Reputation: 788

HTML title no multiline

I'm facing a problem in HTML, I have something like this:

<td title="line1
    line2
    line3
    line4">

But I don't want my web web browser displays it like this. I want a one line pop up like this

"line1 line2 line3 line4"

In google there is only subject with people want to display a multi line pop up... Is there an HTML option? Is it possible to do that?

BR

Upvotes: 0

Views: 234

Answers (3)

akaBase
akaBase

Reputation: 2250

You have several ways of doing this

white-space:nowrap will make sure it doesn't break to a second line

<p class="nowrap">line1 line2 line3 line4</p>

.nowrap{
    white-space:nowrap;
}

display:inline will put ul lis on a single row

<div class="inline">
    <ul>
        <li>line1</li>
        <li>line2</li> 
        <li>line3</li>    
        <li>line4</li>               
    </ul>
</div>

.inline ul li{
    display:inline;
}

display:inline-block can be used to put divs on a single row

<div class="inline-block">line1</div>
<div class="inline-block">line2</div>
<div class="inline-block">line3</div>
<div class="inline-block">line4</div>

.inline-block{
    display:inline-block;
}

and you could also use <span>Text</span> within an element

<p><span>line1</span><span>line2</span><span>line3</span><span>line4</span></p>

hope this helps in giving you a few ideas and be able to see which one will work best for you.

Upvotes: 0

MIvanIsten
MIvanIsten

Reputation: 490

<td title="line1 line2 line3 line4">

Upvotes: 2

Louis
Louis

Reputation: 583

You dont have any control on how the popup is rendered when using an attribute title. It is up to the browser. If you want in all on a single line you would have to change the way the title attribute is generated to strip all the newlines/linefeeds. Its the only way to have it all one one line.

Upvotes: 0

Related Questions