I
I
Igor2015-09-23 11:32:21
css
Igor, 2015-09-23 11:32:21

How to make a div width full screen?

ZqQ7eIm.png
welovepavel.esy.es/Kivi/HTML.html
width:100%;
somehow it doesn't work like that,
you need the blue background to stretch to the entire width of the screen, and the content to be fixed as it is now.
09/23/15 15:30
jsfiddle.net/x28fLrpn
it is important that the content is centered...not blurry...

Thank you!

Answer the question

In order to leave comments, you need to log in

4 answer(s)
H
Harold, 2015-09-23
@IgorBee

<section>
    <div class="container">
      Контент
    </div>
  </section>

section {
 background-color:blue;
} /* Синий фон на всю ширину */
.container {
 margin: 0 auto;
 max-width: 980px;
}  /* Фиксированный контейнер с контентом */

As Vyacheslav wrote, remove max-width inbody

S
Stalker_darkway, 2015-09-23
@hronik87

body{
max-width: 1300px; // Remove
}

G
Gregory, 2015-09-23
@grigruss

You have position:absolute. With this parameter, the div is minimized. The only simple and normal way is through JS or jQuery to determine the width of the window and apply min-width
PS: Vyacheslav correctly noted. remove max-width.

P
Pavel Volintsev, 2015-09-23
@copist

.hea {
   position: absolute;
   width: 100%;
   left: 0px;
}

codepen.io/copist/pen/wKzGeq

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question