Hello,

I was using tags like <h1>, <h2> etc in my content, but then I realized that they are also being used for the site headers and things like that, and using <h1> broke one template, i.e. my <h1> in content looked just like the headers that drupal uses. So I was wondering is there a standard for which tags to use and which not to. If we're not supposed to use <h1>, etc, what are we supposed to use instead?

Thanks

[Edit: Code tags added]

Comments

alanic’s picture

Hmm, lol. I should have previewed this before posting. It sucks that I can't edit it. Can some admin fix it for me?

vm’s picture

erm:

if you are going to use HTML tags in forum posts, you need to surround them with code tags, so we can see what you are using.

code tags be be seen in yoru INPUT FORMATS --- FILTERED HTML

I suspect you are using CSS in your content which is overriding drupals css style sheet ?

alanic’s picture

No css, I just used h1 and h2 tags, but I didn't realize that html was enabled and now I can't edit it. So yeah. You can look at the page source to see what I actually wrote.

vm’s picture

any HTML tags can be used.

Again, inspect yoru input formats, filtered HTML is an input format that is limited, you can add tags to it. FULL HTML allows you to use any HTML tags you wish

alanic’s picture

Of course anything can be used, but I'm asking what should be used.

To answer my own question: Drupal documentation starts from h2's for headers since h1 is already used for node titles. So I think starting headers from h2 is a safe bet.

vm’s picture

"should" is where I suppose confusion comes from as I don't believe there is a "should"

title was asking about "HTML" tags, your example is about h1 and h2 specifically.

either way, congrats on answering your own question.

alanic’s picture

If you have a template that does very fancy stuff (image background, etc) to node headings (which are h1s), you don't want your own h1s to have that same fancy stuff, you just want a heading that won't disturb the design and won't confuse the content boundaries, that's where the "should" comes into question. If you checked the source, my initial question was about h1 and h2. They are HTML tags and the title was such to see if there are other tags with the same problem.

Answering your own unanswered question is courtesy to other readers, I don't see anything requiring a congratulation.

vm’s picture

I had checked the source.

Thank you for your community spirit : )

michelle’s picture

Since page / node titles are H2, I usually start with H3 and below in content.

Michelle

PS: I fixed your post.

--------------------------------------
My site: http://shellmultimedia.com

alanic’s picture

Hi,

I found a nice solution now that I learned more about CSS. Apparently you can say CSS how to format any h1 that is enclosed by some other tag that is of class "content".

.content h2 {
blah
}

so this way I can make stuff in content totally different than the site skeleton. I think this is the way to go.

I'm really surprised that the default templates in drupal does not make use of this and the drupal documentation does the hacky way of avoiding those tags.