-1

After searching a lot I cannot find the answer I am looking for. I am a TABLE user currently editing my old site to new tech but I have a question:

    <div style="background:#6666; 
here: we go; 
display:block; position:relative;> test </div>

Does I must set always to all divs the display and position attributes ?

If I don't set default attributes what will then be their default attributes for display and position?

Yeah it is a nice question, many tell you how to use those attributes but nobody tell you if you have to or not...

Any div guy

Cardinale
  • 97
  • 3
  • 10

1 Answers1

2

No they are not required. If you don't specify them, div tags will have the following default values for those CSS properties:

display: block
position: static

http://www.w3.org/TR/CSS2/sample.html

https://developer.mozilla.org/en-US/docs/Web/CSS/position

Alex W
  • 37,233
  • 13
  • 109
  • 109