1

As we know if we take h1 tag or like that, It has its own style(some bold font weight and larger size). Also there are specific built in styles for p,center,h1,h2... so on. What is difference between styling div with css(same as h1) and using h1 tag for the same Or how html work for those tags.

Ignazio
  • 10,504
  • 1
  • 14
  • 25
Rajaram Shelar
  • 7,537
  • 24
  • 66
  • 107
  • HTML - Content CSS - Looks.Also bear in mind some out the population relays on screen readers – Ed Heal Dec 25 '13 at 10:25
  • So on what should i rely with built in tags or css – Rajaram Shelar Dec 25 '13 at 10:28
  • This question can be useful for you. http://stackoverflow.com/questions/11529495/importance-of-css-stylesheet-hierarchy – Gaslan Dec 25 '13 at 10:30
  • use CSS for styling. Can achieve larger fonts etc. for those that require it. How about printing? How about enabling it easier for a screen reader? – Ed Heal Dec 25 '13 at 10:39

3 Answers3

3

Apart of the obvious, default browser styles for specific HTML tags, the difference is that in HTML5 tags mark the type of data that it holds. <author>, <aside>, <address> etc.(although nothing stops you from using different type of data for those tags)

Also search engines rely heavily on the data that each html tag holds, so the data in H1 is most certainly of higher value than in a simple div which is a kind of a generic block html element that usually doesn't have any styles applied.

Slavenko Miljic
  • 3,836
  • 2
  • 23
  • 36
2

styling div with css(same as h1) and using h1 tag(difference)

My Answer for the above line:

H1 is the Most Important Phrase or Sentence on Your Page

If you think of a Web page as an outline, the H1, H2, etc. heading tags serve to divide the page into sections. Your most important headline is your H1 headline. This generally indicates the topic for the entire Web page and is where most people look first when they're trying to figure out what the page is about. Since search engines first priority is to provide search results that people want, they try to use the same techniques to determine what a page is about. So content in the H1 tag will be considered most important and given a slightly higher rank than other content on the page...

Source: ABOUT.com (for more information)

Zword
  • 6,605
  • 3
  • 27
  • 52
2

What is difference between styling div with css(same as h1) and using h1 tag for the same?

HTML is not just about the 'look and feel' of a web-page, it is also about semantics.

An h1 (or the new header tag) is expressing the 'headerness' of the content, while a div (even with appropriate style) does not.

You can read more on Wikipedia: http://en.wikipedia.org/wiki/Semantic_HTML

haim770
  • 48,394
  • 7
  • 105
  • 133