Title and subtitle

S

shapper

Hello,

I want to create a title with a short phrase under it ...

Should I use and style this as follows:

<h2>Title<span>This is my title</span></h2>

I believe I need to add display:block to span so it gets on another
line ...

or something like:

<h2>Title</h2>

<p>This is my title</p>

Where p is outside of title.

Thanks,
Miguel
 
J

Jonathan N. Little

shapper said:
Hello,

I want to create a title with a short phrase under it ...

Should I use and style this as follows:

<h2>Title<span>This is my title</span></h2>

I believe I need to add display:block to span so it gets on another
line ...

or something like:

<h2>Title</h2>

<p>This is my title</p>

Where p is outside of title.

Thanks,
Miguel

Depends on the contents. Is it part of the title or another paragraph
under that topic?

h1 span { display: block; }

<h1>How to rule the world
<span>10 easy steps to lead the Axis of Evil</span>
</h1>

or

<h1>How to rule the world</h1>
<h2>Getting started on your evilness</h2>
<p>Blah, blah ...</p>
<h2>Implementing your plan</h2>
<p>Blah, blah ...</p>

or

<h1>How to rule the world</h1>
<p>Just the info to start your reign of terror...</p>
 
S

shapper

Depends on the contents. Is it part of the title or another paragraph
under that topic?

h1 span { display: block; }

<h1>How to rule the world
<span>10 easy steps to lead the Axis of Evil</span>
</h1>

or

<h1>How to rule the world</h1>
<h2>Getting started on your evilness</h2>
<p>Blah, blah ...</p>
<h2>Implementing your plan</h2>
<p>Blah, blah ...</p>

or

<h1>How to rule the world</h1>
<p>Just the info to start your reign of terror...</p>

I think it is the first one ... I don't see much difference between
the first and third maybe because my first language is not English ...

But it is something like:

<h1>Contact<span>Send us your comments and suggestions</span></h1>

or

<h1>Documents<span>Find help on various subjects</span></h1>
 
C

C A Upsdell

But it is something like:
<h1>Contact<span>Send us your comments and suggestions</span></h1>

or

<h1>Documents<span>Find help on various subjects</span></h1>

I would suggest that the subtitle be a separate paragraph, using CSS to
produce the desired appearance.
 
N

nice.guy.nige

While the city slept, richard feverishly typed:
I would use the tags to control the respective content seperately, not
both.
<h1>title</h1>
<span>subtitle</span>
<p>blah blah blah</p>

But that doesn't give any meaning to "subtitle". "title" is a heading, "blah
blah blah" is a paragraph, but "subtitle" is given no meaning whatsoever. If
it is a part of the main title, put it in the heading. If it is a subtitle,
make it a second level heading. If it is a paragraph, make it a paragraph.
Span acts as a "mini division". [...]

Span is often a lazy construct. I'm not saying that it doesn't have uses,
but it is more often misused, as you are about to demonstrate...
<div><h1>This is <span>MY</span>title</h1></div>

"MY" can now be bigger than the rest if desired, colored, or displayed
in various ways outside of the other settings.

If the intention is to emphasise it (making it bigger, a different colour
etc, all of which are emphasising), then make it so.

h1 em {
color: #ff0000;
background-color: blue;
}
....
<h1>This is <em>my</em> title</h1>

Cheers,
Nige
 
R

rf

richard said:
I would use the tags to control the respective content seperately, not
both.
<h1>title</h1>
<span>subtitle</span>
<p>blah blah blah</p>

which is invalid with the strict DTD.
Span acts as a "mini division".

Span is not a division of any kind. Span is the generic inline element
whereas div is the generic block element. Nothing more.
Where span begins is where the mini
divisions and where the span ends, so does the mini division.

Er, what?
Regardless of the container it's in.

<div><h1>This is <span>MY</span>title</h1></div>

"MY" can now be bigger than the rest if desired, colored, or displayed
in various ways outside of the other settings.

Why indulge in divitus by wrapping that H1 element in a div element? Just
because you can?
 

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,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top