Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > How to render a heading as two lines?

Reply
Thread Tools

How to render a heading as two lines?

 
 
dorayme@optusnet.com.au
Guest
Posts: n/a
 
      03-22-2006

dorayme wrote:
> In article <1notl74t9u3xq$(E-Mail Removed)>,
> Mark Parnell <(E-Mail Removed)> wrote:
>
> > Deciding to do something for the good of humanity, "Greg N."
> > <(E-Mail Removed)> declared in alt.html:
> >
> > > Huddersfield
> > > Canal Society
> > >
> > > It can be fudged by marking it up as
> > >
> > > <h1>Huddersfield<br>Canal Society</h1>

> >
> > Why is that a fudge? You want a line break, so you put one in.
> >

>
> .... OP surely means to
> be drawing attention here to the ideal of separating style from
> content and <br> is being used for presentational purposes.



Perhaps I am wrong on this, after all, considering later posts. One
<br> would be pc, two or more consequutive <br>s would be frowned on
even in the context of <h1></h1>

I need to know the details so that when i go around in a pickup truck
with fellow HTML/CSS police to round up the politically incorrect, i do
not overdo things...

 
Reply With Quote
 
 
 
 
Jim Moe
Guest
Posts: n/a
 
      03-23-2006
Toby Inkster wrote:
>
>> <h1><p>Huddersfield</p><p>Canal Society</p></h1>

>
> Invalid. See:
>

Arrrgghh!

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
 
Reply With Quote
 
 
 
 
BootNic
Guest
Posts: n/a
 
      03-23-2006
> "Greg N." <(E-Mail Removed)> wrote:
> news:dvq74m$161$(E-Mail Removed)....
>
> Suppose you need a heading <h1>Huddersfield Canal Society</h1> to be
> rendered as two lines. The result you want to see is:
>
> Huddersfield
> Canal Society
>
> It can be fudged by marking it up as
>
> <h1>Huddersfield<br>Canal Society</h1>
>
> or
>
> <h1>Huddersfield</h1>
> <h1>Canal Society</h1>
>
> But what would you suggest, that complies with HTML 4.01 strict,
> and is politically correct with respect to style/content separation?


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
</head>
<body>
<h1 style="white-spacere;">Huddersfield
Canal Society</h1>
</body>
</html>

--
BootNic Wednesday, March 22, 2006 9:23 PM

Humor is just another defense against the universe.
*Mel Brooks*

 
Reply With Quote
 
Greg N.
Guest
Posts: n/a
 
      03-23-2006
BootNic wrote:

>><h1>Huddersfield<br>Canal Society</h1>
>>
>>But what would you suggest, that complies with HTML 4.01 strict,
>>and is politically correct with respect to style/content separation?

>
> <h1 style="white-spacere;">Huddersfield
> Canal Society</h1>


I like it! Seems to fit the bill exactly.

--
Gregor mit dem Motorrad auf Reisen:
http://hothaus.de/greg-tour/
 
Reply With Quote
 
Martin Clark
Guest
Posts: n/a
 
      03-24-2006
Jim Moe wrote...
>Greg N. wrote:
>> Suppose you need a heading <h1>Huddersfield Canal Society</h1> to be
>> rendered as two lines. The result you want to see is:
>> Huddersfield
>> Canal Society
>> It can be fudged by marking it up as
>> <h1>Huddersfield<br>Canal Society</h1>
>>

[snip]
>
> Is it the two line appearance you actually want? The <br> is best for that.
> Or are you just avoiding some messy text wrapping as the viewport width
>narrows? Then you could put a &nbsp; in between Canal and Society. That
>whole line of text would wrap as a unit.
>

Sorry folks - I hadn't noticed that the discussion of this had moved to
a new thread!

Initially, the white text stayed on one line, so that at 800x600 it
overlapped the right-hand banner photo. Not the end of the world, but
not what I wanted. Several of the suggestions that were put forward
resulted in solutions where, at some widths, text jumped down below the
images or formed 3 lines, changing the appearance of the header area
detrimentally.

The <h1>Huddersfield</h1><h1>Canal Society</h1> solution produced the
best result up to that point, where the text stayed within the original
height of the header area and only overlapped the photo at about 700px
width, which few people would see in the normal course of events.

I didn't understand quite why Spartanicus was so angry at the
"butchering" of his code by whoever suggested that solution, but having
read this thread I now do understand that it is regarded as incorrect to
turn it into what is in effect two headings.

However, <h1>Huddersfield<br>Canal Society</h1> produces exactly the
same effect and that is what I am going with:
http://www.tamevalley.freeserve.co.uk/hcs/index.htm
I am pleased with the way the page works and hope it does not offend the
purists!

What does style="white-spacere;" do please, as suggested by BootNic?
--
Martin Clark
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing rails render method outside of view / Decorating render Glenn Gillen Ruby 0 11-17-2006 02:30 PM
Can 2 columns of a DataGrid have a single heading OR can I have two controls in 1 column? mark4asp ASP .Net 2 11-11-2006 02:13 AM
Heading to Vegas tomorrow.... and I want to pick up a HD DVD title or two... Allan DVD Video 0 04-23-2006 12:54 AM
DataGrid Heading =?Utf-8?B?SmltIEhlYXZleQ==?= ASP .Net 3 12-10-2004 08:23 PM
Page.Render do not render complete page Lau Lei Cheong ASP .Net 1 05-15-2004 04:10 AM



Advertisments