-2

I want to automatically resize the header using css but without using repeat-x - because the header contains picture and I don't want it to repeat when a user resizes the page (CTRL with +scroll ).

I tried width: 100%; but it did not work

Vitalii Zurian
  • 17,586
  • 4
  • 63
  • 80
Heq Dz
  • 3
  • 1
  • 4

2 Answers2

0

Use the background-size style:

header {
    background-size: 100%;
}

JSFiddle

George
  • 35,662
  • 8
  • 61
  • 98
0

Try to use background-size: cover

edonbajrami
  • 2,156
  • 23
  • 34