Search
 
SCRIPT & CODE EXAMPLE
 

HTML

responsive html

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Add this in between your <head></head> tags -->
Comment

Responsive Website Code

body {
  font-size: 15px;
}

button {
  background: #ffc600;
  border: 0;
  padding: 10px 20px;
}

img {
  max-width: 100%;
}

/* .wrapper */

.wrapper {
  display: grid;
  grid-gap: 20px;
}

.top {
  display: grid;
  grid-gap: 20px;
  grid-template-areas:
    "hero hero cta1"
    "hero hero cta2"
}

.hero {
  grid-area: hero;
  min-height: 400px;
  background: white url(images/taco.jpg);
  background-size: cover;
  background-position: bottom right;
  padding: 50px;
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: center;
}

.hero > * {
  background: var(--yellow);
  padding: 5px;
}

.cta {
  background: var(--yellow);
  display: grid;
  align-items: center;
  justify-items: center;
  align-content: center;
}

.cta p {
  margin: 0;
}

.cta1 {
  grid-area: cta1;
}

.cta2 {
  grid-area: cta2;
}

.price {
  font-size: 60px;
  font-weight: 300;
}

/* Navigation */

.menu ul {
  display: grid;
  grid-gap: 10px;
  padding: 0;
  list-style: none;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
}

.menu a {
  background: var(--yellow);
  display: block;
  text-decoration: none;
  padding: 10px;
  text-align: center;
  color: var(--black);
  text-transform: uppercase;
  font-size: 20px;
}

[aria-controls="menu-list"] {
  display: none;
}

/* Features! */

.features {
  display: grid;
  grid-gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.feature {
  background: white;
  padding: 10px;
  border: 1px solid white;
  text-align: center;
  box-shadow: 0 0 4px  rgba(0,0,0,0.1);
}

.feature .icon {
  font-size: 50px;
}
.feature p {
  color: rgba(0,0,0,0.5);
}

/* About Section */

.about {
  background: white;
  padding:50px;
  display: grid;
  grid-template-columns: 400px 1fr;
  align-items: center;
}

/* Gallery! */

.gallery {
  display: grid;
  grid-gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.gallery img {
  width: 100%;
}

.gallery h2 {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-gap: 20px;
  align-items: center;
}

.gallery h2:before, .gallery h2:after {
  display: block;
  content: '';
  height: 10px;
  background: linear-gradient(to var(--direction, left), var(--yellow), transparent);
}

.gallery h2:after {
  --direction: right;
}

@media (max-width: 1000px) {
  .menu {
    perspective: 800px;
  }
  [aria-controls="menu-list"] {
    display: block;
    margin-bottom: 10px;
  }

  .menu ul {
    max-height: 0;
    overflow: hidden;
    transform: rotateX(90deg);
    transition: all 0.5s;
  }

  [aria-expanded="true"] ~ ul {
    display: grid;
    max-height: 500px;
    transform: rotateX(0);
  }

  [aria-expanded="false"] .close {
    display: none;
  }

  [aria-expanded="true"] .close {
    display: inline-block;
  }

  [aria-expanded="true"] .open {
    display: none;
  }

}

@media (max-width: 700px) {
  .top {
    grid-template-areas:
      "hero hero"
      "cta1 cta2"
  }
  /* About */
  .about {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  .top {
    grid-template-areas:
      "hero"
      "cta1"
      "cta2"
  }
}
Comment

PREVIOUS NEXT
Code Example
Html :: how to make a html tag in html 
Html :: html one page template free 
Html :: how to add a paragraph in html 
Html :: how to add map in html 
Html :: html. strong 
Html :: simple landing page html 
Html :: html multi page website 
Html :: sndl stock 
Html :: education html templates 
Html :: h1 tag is used for 
Html :: engine html 
Css :: css image to white 
Css :: how to make image not draggable in html 
Css :: center div in middle of page 
Css :: rainbow linear gradient css 
Css :: last second css 
Css :: filter for css white color 
Css :: styling scrollbar css 
Css :: how to remove background color in css 
Css :: center position fixed element 
Css :: how to slow down hover effect css 
Css :: change the color of a checkbox css 
Css :: how to create a strikethrough in css 
Css :: css select last character 
Css :: css remove blue outline button 
Css :: how to create a semi circle in css 
Css :: jquery css multiple line 
Css :: bring element to front css 
Css :: website make text not highlightable 
Css :: move button to right css 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =