-1

Firefox and Opera seem to put articles after each other while Chrome gives a line break after each one. Which one is correct and how would you get them display the preferred style the same cross browser?

<html>
<body>

<article>
Item 1
</article>

<article>
Item 2
</article>

<article>
Item 3
</article>

<article>
Item 4
</article>

</body>
</html>

Opera 11.01 enter image description here

Chrome 9.0 enter image description here

user123444555621
  • 148,182
  • 27
  • 114
  • 126
  • 1
    They're being treated as `inline` elements in Opera, and as `block` elements in Chrome. – drudge Feb 18 '11 at 21:25
  • 2
    Question [#3277671](http://stackoverflow.com/questions/3277671/css-reset-for-html5) has some useful information for you. – drudge Feb 18 '11 at 21:26
  • 1
    @jnpcl, I believe the HTML4 spec says something about displaying unrecognized elements as inline and essentially ignoring them. Good browsers will allow you to specify styles for unrecognized elements, which is why you can set `display: block` and have the elements work the same (except for Internet Exploder, which just ignores the element all-together). – zzzzBov Feb 18 '11 at 21:32
  • +1s all round, Thanks. @jnpcl You are correct in thinking I am new these standard and practices, very useful link. – Nathan Ross Powell Feb 18 '11 at 21:33

1 Answers1

3

You should set either display: inline or display:block in CSS. (whichever one you want)

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964