Holy Grail Technique - Problem with Left Container Float

Viewed 72

The Container Left is not visible. I am using Holy Grail Technique.

How can I get it correct? How can I align them?

When I remove margin-left : -100% it the Container Left comes in display but it is not align with other Center and Right Containers.

In CSS file, (*) , I read about this, to solve when left width gets into negative and disappears, we can do this to get into visual point.

* {
  margin: 0;
  padding: 0;
}

body {
  min-width: 630px;
}

.container {
  padding-left: 200px;
  padding-right: 190px;
  overflow: hidden;
}

.container .column {
  position: relative;
  float: left;
}

.center {
  padding: 10px 20px;
  background-color: chartreuse;
  width: 100%;
}

.left {
  background-color: aqua;
  padding: 10px 10px;
  width: 180px;
  right: 240px;
  margin-left: -100%;
}

.right {
  background-color: blueviolet;
  padding: 10px 10px;
  width: 130px;
  margin-right: -190px;
}

.footer {
  clear: both;
}

* html .left {   /* (*) */
  left: 150px;
}
<header class="header">Header</header>
<div class="container">
  <div class="left column">Container Left</div>
  <div class="center column">Container Center</div>
  <div class="right column">Container Right</div>
</div>
<footer class="footer">Footer</footer>

1 Answers

According to my understanding,your let container is not visisble.Do add on your preference on the code below

* {
  margin: 0;
  padding: 0;
}

.container {
  width: 100vw;
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.column {
  flex-grow: 1;
}

.center {
  padding: 10px 20px;
  background-color: chartreuse;
}

.left {
  background-color: aqua;
  padding: 10px 10px;
}

.right {
  background-color: blueviolet;
  padding: 10px 10px;
}
<header class="header">Header</header>
<div class="container">
  <div class="left column">Container Left</div>
  <div class="center column">Container Center</div>
  <div class="right column">Container Right</div>
</div>
<footer class="footer">Footer</footer>

Related