html-heading

Difference between heading inside section or before it in HTML5

跟風遠走 提交于 2019-12-06 15:19:37
In HTML5, what is the difference between a section with a h eading as child element and a section which is the next sibling of a h eading element? Does the same difference hold for div elements instead of section ? <section> <h1>First section</h1> <!-- other content --> </section> <!-- vs. --> <h1>Second section</h1> <section> <!-- other content --> </section> The answers will highly depend upon logical view. <section> <h1>....</h1> </section> On the above case <h1> denotes the heading of the section. Now lets look at another example: <div id="info"> <h1>Sections:</h1> <section> <h1> Section:

H1, H2, H3, H4, H5, H6 inside table TH tags? - HTML

感情迁移 提交于 2019-12-04 15:38:41
问题 Can i use H1, H2, H3, H4, H5, H6 inside the table TH tags? - HTML I tryed to validate with the w3 validator, but it doesn't validate. I get this: The element h4 must not appear as a descendant of the th element. <th><h4>Orange</h4></th> I use HTML5, so i think that the best idea is to use <div> to make a table and then put the <H4> tags in it. Or is this a bad idea too? Because then it looks something like this: <h4>first title</h4> <h4>second title</h4> <h4>third title</h4> <p>first

Escaping h outline

烂漫一生 提交于 2019-12-02 03:41:30
问题 So I’ve been trying to figure out what is the best way to add content after a being hooked to a lower level title. <section> <h1>Title of Section</h1> <h2>Related 1</h2> <h2>Related 2</h2> <p>I NEED THIS TO BE PART OF H1</p> </section> This is how it will come up on the outline: any content after the h2 will be related to that specific section. However, I would like it to escape that h2 and have it become part of the h1 . 回答1: Use sectioning content elements ( section , article , aside , nav

Using a H1 logo in HTML5

青春壹個敷衍的年華 提交于 2019-12-02 02:02:58
问题 The "h1 tag with an image" debate seems as old as time itself, but with HTML5 explicitly allowing multiple H1 tags as part of its spec, all the previous questions on this subject seem out of date. As I understand it, the following works perfectly with the HTML OA: <body> <header> <h1> <a href="http://www.example.com"> <img src="logo.png" alt="Ernie's Restaurant - Great Italian food"> </a> </h1> </header> <nav><!-- the site-wide navigation --></nav> <article> <h1>About us</h1> <p>…</p> <

Using a H1 logo in HTML5

亡梦爱人 提交于 2019-12-01 23:16:57
The "h1 tag with an image" debate seems as old as time itself, but with HTML5 explicitly allowing multiple H1 tags as part of its spec , all the previous questions on this subject seem out of date. As I understand it, the following works perfectly with the HTML OA : <body> <header> <h1> <a href="http://www.example.com"> <img src="logo.png" alt="Ernie's Restaurant - Great Italian food"> </a> </h1> </header> <nav><!-- the site-wide navigation --></nav> <article> <h1>About us</h1> <p>…</p> </article> </body> But I'm working with an SEO company on a website and they've told me: "The logo link CAN

Style is not being applied to H1 element in CSS

大憨熊 提交于 2019-12-01 18:18:22
问题 I'm facing a strange problem, the style is not being applied to the H1 element. Code: p h1 { color: red; } <p> <h1>This is a header</h1> </p> 回答1: You can't have a heading ( H1 to H6 ) as a child of a p , that's invalid HTML. It's not working because your browser is automatically closing the p element before the h1 element starts, leaving you with this generated DOM (code) below: <p> </p> <h1>This is a header</h1> <p> </p> Using either the F12 to acess your browser's developer tools or using

p tag in h1 for seo

你说的曾经没有我的故事 提交于 2019-12-01 10:50:00
I was wondering if using <p> tags nested in a <h1> tag would be bad for SEO purposes. <h1> <p>some title</p> <p>some subtitle</p> </h1> This would make my life a bit easier, dealing with dynamic page titles. Search engines may ignore p markup inside h1 . Or they might dislike it, doing something nasty. In any case, there is nothing to be gained by using such markup. Instead, you can use <h1> some title<br> <small>some subtitle</small> </h1> You can then tune the relative sizes by setting font-size on h1 small . You can also set padding-top on it, if you wish to have more spacing between the

p tag in h1 for seo

会有一股神秘感。 提交于 2019-12-01 09:57:19
问题 I was wondering if using <p> tags nested in a <h1> tag would be bad for SEO purposes. <h1> <p>some title</p> <p>some subtitle</p> </h1> This would make my life a bit easier, dealing with dynamic page titles. 回答1: Search engines may ignore p markup inside h1 . Or they might dislike it, doing something nasty. In any case, there is nothing to be gained by using such markup. Instead, you can use <h1> some title<br> <small>some subtitle</small> </h1> You can then tune the relative sizes by setting

Removing space between h1 and h2

*爱你&永不变心* 提交于 2019-12-01 04:42:16
I have stumbled across a problem that I can not seem to solve in any way, maybe I am using div s in a wrong way? .greeting h1 { font-family: 'Raleway', sans-serif; font-weight: lighter; font-size: 100px; text-align: center } .greeting h2 { font-family: 'Raleway', sans-serif; font-weight: lighter; font-size: 35px; line-height: 0px; text-align: center } <div class="greeting"> <h1>Hi.</h1> <h2>Select a group</h2> </div> This is the outcome: I want to decrease the space between my <h1> and <h2> , and I found out that the way to do that was to set line-height in h1 to 0px . But as I do that my

HTML 5 Document Outlining Algorithm

≡放荡痞女 提交于 2019-11-30 22:29:38
I am building a new site and I have recently started looking at the Document Outlining Algorithm. It states that all sections should have a header, sections include section , nav , article and body (There are probably some more too). So, I have a couple of navigation areas and my question is; would it be wise to have a heading but just hide it from the browser? unor Every sectioning content element "longs" for a heading element ( h1 - h6 ). But you are not required to provide one. If you don’t provide a heading element for a section, this section will have an implied heading . HTML5 outline