I just can't figure out why this grid I've set extends below the viewport.
Besides the logo-cell, the other two cells in the vertical grid are fractional. Basically, independent of viewport size, the footer section extends below the bottom of the viewport. I'd like the page to size itself so you don't have to scroll on desktop.
#import url('https://use.typekit.net/vlv0duo.css');
html {
overflow: hidden;
height: 100%;
}
body {
font-family: objektiv-mk1, sans-serif;
font-style: normal;
background-color: #141414;
color: #e5e5e5;
height: 100%;
overflow: auto;
margin: 0;
}
section {
display: grid;
grid-template-rows: calc(60px + 8vh) 1fr 1fr;
grid-template-columns: 1fr;
grid-gap: 0px 0px;
position: relative;
height: 100%;
margin: 2.6vw;
}
.nav {
margin-bottom: 8vh;
}
.icon-logo {
background: url(sub_logo-01.svg) no-repeat;
width: 150px;
height: 60px;
display: inline-block;
position: relative;
color: #e5e5e5;
}
h1 {
font-size: 34px;
font-weight: 200;
line-height: 49px;
text-align: Left;
max-width: 85%;
margin: 0 0 25px 0;
padding: 0;
}
h2 {
font-size: 18px;
font-weight: 300;
line-height: 26px;
text-align: Left;
max-width: 60%;
margin: 0 0 25px 0;
padding: 0;
}
h3 {
font-family: objektiv-mk1, sans-serif;
font-size: 12px;
line-height: 22px;
font-weight: 500;
margin: 0;
padding: 0;
}
a {
color: #e5e5e5;
text-decoration: none;
font-family: objektiv-mk1, sans-serif;
font-weight: 500;
}
a.body-link {
color: #e5e5e5;
text-decoration: none;
font-family: objektiv-mk1, sans-serif;
font-weight: 200;
}
a#header-link {
white-space: nowrap;
}
div.cell {
grid-column: span 1;
grid-row: span 1;
position: relative;
}
div.cell#text {
font-weight: 200;
font-size: 12px;
line-height: 18px;
}
div.cell {
grid-column: span 1;
grid-row: span 1;
position: relative;
}
div.cell#footer {
position: relative;
align-self: end;
}
div.footer {
display: grid;
grid-template-rows: auto;
grid-template-columns: 1fr 1fr 1fr 1fr;
grid-gap: 0px 50px;
}
div.mark {
font-weight: 200;
font-size: 12px;
line-height: 18px;
align-items: end;
grid-column: span 2;
grid-row: span 1;
}
div#social {
position: relative;
bottom: 0;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
}
li {
white-space: nowrap;
}
<section>
<div class="nav">
<a class="navlogo" href="www.relicstudio.co">
<div class="icon-logo"></div>
</a>
</div>
<div class="cell">
<h1>
An independent design studio.
<br><br> We use the past to inform the present, leveraging creative and strategic solutions to projects of all types and sizes.
</h1>
<h2>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed finibus sollicitudin velit, sed porta lectus accumsan nec. Sed nec diam quis neque pretium tristique. Request Advance Work Samples
</h2>
</div>
<div class="cell" id="footer">
<div class="footer">
<div class="cell" id="text">
<h3 id="heading">
Capabilities
</h3>
<br>
<ul>
<li>Naming</li>
<li>Editorial</li>
<li>Packaging</li>
<li>Tone & Voice</li>
<li>Art Direction</li>
<li>Brand Strategy</li>
<li>Identity System</li>
<li>Interface Design</li>
<li>Experience Design</li>
<li>Environmental Design</li>
</ul>
</div>
<div class="cell" id="text">
<h3 id="heading">
New Business
</h3><br>
telegram#relicstudio.co
<div id="social">
<h3 id="heading">
Follow For The Latest
</h3><br>
<ul>
<li>twitter</li>
<li>instagram</li>
</ul>
</div>
</div>
</div>
</div>
</section>
Reworked/simplified your HTML/CSS to fix height issues. Demo:
#import url('https://use.typekit.net/vlv0duo.css');
/* to include padding and border in height */
* {
box-sizing: border-box;
}
body {
font-family: objektiv-mk1, sans-serif;
font-style: normal;
background-color: #141414;
color: #e5e5e5;
margin: 0;
/* set min-height to screen height */
min-height: 100vh;
/* now body is grid container instead of section */
display: grid;
/* set min-content for footer to be placed at the very bottom */
grid-template-rows: calc(60px + 8vh) 1fr min-content;
/* replace margin for section with padding for body */
padding: 2.6vw;
}
.nav {
margin-bottom: 8vh;
}
.icon-logo {
background: url(sub_logo-01.svg) no-repeat;
width: 150px;
height: 60px;
display: inline-block;
position: relative;
color: #e5e5e5;
}
h1 {
font-size: 34px;
font-weight: 200;
line-height: 49px;
text-align: left;
max-width: 85%;
margin: 0 0 25px 0;
padding: 0;
}
h2 {
font-size: 18px;
font-weight: 300;
line-height: 26px;
text-align: left;
max-width: 60%;
margin: 0 0 25px 0;
padding: 0;
}
h3 {
font-family: objektiv-mk1, sans-serif;
font-size: 12px;
line-height: 22px;
font-weight: 500;
margin: 0;
padding: 0;
}
a {
color: #e5e5e5;
text-decoration: none;
font-family: objektiv-mk1, sans-serif;
font-weight: 500;
}
a.body-link {
color: #e5e5e5;
text-decoration: none;
font-family: objektiv-mk1, sans-serif;
font-weight: 200;
}
a#header-link {
white-space: nowrap;
}
div.cell {
position: relative;
}
div.cell#text {
font-weight: 200;
font-size: 12px;
line-height: 18px;
}
div.cell {
position: relative;
}
div.cell#footer {
position: relative;
}
div.footer {
display: grid;
grid-template-rows: auto;
grid-template-columns: 1fr 1fr 1fr 1fr;
grid-gap: 0px 50px;
}
div.mark {
font-weight: 200;
font-size: 12px;
line-height: 18px;
align-items: end;
grid-column: span 2;
grid-row: span 1;
}
div#social {
position: relative;
bottom: 0;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
}
li {
white-space: nowrap;
}
<div class="nav">
<a class="navlogo" href="www.relicstudio.co">
<div class="icon-logo"></div>
</a>
</div>
<div class="cell">
<h1>
An independent design studio.
<br><br> We use the past to inform the present, leveraging creative and strategic solutions to projects of all types and sizes.
</h1>
<h2>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed finibus sollicitudin velit, sed porta lectus accumsan nec. Sed nec diam quis neque pretium tristique. Request Advance Work Samples
</h2>
</div>
<div class="cell" id="footer">
<div class="footer">
<div class="cell" id="text">
<h3 id="heading">
Capabilities
</h3>
<br>
<ul>
<li>Naming</li>
<li>Editorial</li>
<li>Packaging</li>
<li>Tone & Voice</li>
<li>Art Direction</li>
<li>Brand Strategy</li>
<li>Identity System</li>
<li>Interface Design</li>
<li>Experience Design</li>
<li>Environmental Design</li>
</ul>
</div>
<div class="cell" id="text">
<h3 id="heading">
New Business
</h3><br>
telegram#relicstudio.co
<div id="social">
<h3 id="heading">
Follow For The Latest
</h3><br>
<ul>
<li>twitter</li>
<li>instagram</li>
</ul>
</div>
</div>
</div>
</div>
Related
I designed a website mobile-first and used a media query to make two columns sit next to each other once the screen expands. Instead it made a grid on my mobile version and I have whitespace on the bottom of my tablet version
If I switch the min to max it just goes to my mobile-first design ignores the media query CSS Grid altogether (as expected) for the tablet and desktop version
#media (min-width: 600px) {
.authentic {
display: grid;
grid-template-columns: repeat(2, 50%);
grid-template-areas: 'bowl content';
height: 100%;
margin: 0px;
}
.right-col {
grid-area: content;
padding: 0 10%;
text-align: left;
align-self: center;
}
}
Here's the HTML if it helps
<section class="authentic">
<div class="right-col">
<h2>Authentic. Awesome.</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Itaque aliquam id ullam vel quia voluptatem nobis nisi error nihil saepe!</p>
</div>
<img src="images/dumpling.jpeg" alt="Dumplings in a bowl" />
</section>
Here is the full HTML and CSS code for full reference:
HTML
<!doctype html>
<!-- Fun project to help me learn responsive layout design -->
<html lang="en">
<head>
<meta charset="utf-8">
<title>Yummy Eats</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="hero-bg">
<section class="top">
<header>
yummy.eats
</header>
<h1><span>The Healthy </span> Eating Experience</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Mollitia eius impedit porro similique officiis
eligendi, asperiores maxime est praesentium libero.</p>
<div class="form-container">
<form action="">
<div class="form-left">
<label for="city">Enter your city:</label>
<input type="text" name="city" id="city">
<p>Example: "San Diego"</p>
</div>
<input type="button" value="Find Food Now">
</form>
</div>
</section>
</div>
<section class="authentic">
<div class="right-col">
<h2> Authentic. Awesome.</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Itaque aliquam id ullam vel quia voluptatem
nobis nisi error nihil saepe!</p>
</div>
<img src="images/dumpling.jpeg" alt="Dumplings in a bowl" />
</section>
</body>
</html>
CSS
#import url('https://fonts.googleapis.com/css?family=Montserrat:400,700&display=swap');
/*Margin affects outside. Padding affects inside */
/*Custom Properties */
:root {
--leading: 2em;
}
body {
font-family: 'Montserrat', sans-serif;
margin: 0;
}
.hero-bg {
background: #307D99 url('images/bg.jpg');
color: white;
text-align: center;
padding-bottom: 4em;
padding-top: 1em;
/* for margin and padding its good to use em */
}
header {
padding: 1em 5em 3em 10em;
}
.hero-bg a {
color: white;
text-decoration: none;
/* ^^this removes url underlining */
font-weight: bold;
font-size: 1.2rem;
/*for text we use rem */
}
section {
margin: 0 1em;
}
h1 {
font-size: 2.5rem;
margin: 2em 0 1.2em;
}
h1 span {
text-transform: uppercase;
display: block;
/* display:block puts things on their own line, nothing is on the right or left to it */
font-size: 1.4rem;
position: relative;
z-index: 1;
}
h1 span::before {
content: ' ';
position: absolute;
width: 3em;
background: #00BFFF;
height: .4em;
bottom: 0;
z-index: -1;
margin-left: -.3em;
}
.hero-bg p {
font-weight: bold;
margin: 0 1em 3em;
/* font-size: .759rem; */
}
.form-container {
background-color: white;
margin: 2em -1em 0;
padding: 2em;
}
label {
color: #2D7D98;
font-weight: bold;
display: block;
margin-bottom: 1em;
font-size: 1.2em;
}
input[type=text] {
border: 1px solid #707070;
width: 100%;
padding: 1em;
border-radius: .5em;
margin-top: 1.2em;
box-sizing: border-box;
}
.form-container p {
color: gray;
margin-bottom: 1.5em;
font-weight: normal;
font-size: .9em;
margin-top: .3em;
}
input[type=button] {
background-color: #F89104;
border: none;
width: 100%;
color: white;
font-weight: bold;
padding: 1em 0;
border-radius: .5em;
font-size: 1.3em;
cursor: pointer;
}
input[type=button]:hover {
background-color: #bb690a;
}
.authentic {
margin: 0;
}
.right-col {
text-align: center;
margin: 3em 1em;
}
h2 {
text-transform: uppercase;
position: relative;
}
h2::before {
content: ' ';
position: absolute;
width: 8em;
background: #00BFFF;
height: .4em;
bottom: 0;
z-index: -1;
margin-left: -.3em;
}
img {
width: 100%;
/* this is super important if you are using images to get your website to fit the entire page */
}
p {
line-height: var(--leading);
}
/* Media query put in place to change the width for the section (form) when the user enlarges the screen into desktop format */
#media (min-width: 730px) {
section {
margin: 0 4em;
}
.form-container {
margin: 2em 4em 0;
}
}
#media (min-width: 600px) {
.hero-bg {
text-align: left;
}
.hero-bg p {
margin: 0 0 3em;
}
.hero-bg section {
width: 65%;
}
.form-container {
margin: 2em 0 0;
padding: 2em;
border-radius: .5em;
box-shadow: 10px 10px 10px rgba(0, 0, 0, .3);
}
form {
display: flex;
}
.form-left {
width: 70%;
}
label {
margin: 0;
}
input[type="button"] {
height: fit-content;
font-size: 1.1em;
margin-left: 1em;
margin-top: 2.2em;
padding: .7em 0;
width: 30%;
}
/* CSS Grid Usage: put the text and bowl next to each other and then changed the order by putting the bowl on the left
since it came before content in grid-template-areas */
.hero-bg p {
margin-bottom: 0px;
}
.authentic {
display: grid;
grid-template-columns: repeat(2, 50%);
grid-template-areas: "bowl content";
height: 100%;
margin: 0px;
}
.right-col {
grid-area: content;
padding: 0 10%;
text-align: left;
align-self: center;
}
img {
grid-area: bowl;
}
h2 {
margin: 0;
}
}
/* A fadeIn effect for the top section */
.top {
animation: fadeIn 4s forwards;
}
#keyframes fadeIn {
from {
opacity: 0;
transform: translateY(-2em);
}
to {
opacity: 1;
transform: translateY(-2em);
}
#keyframes overlay {
0% {
opacity: 0;
}
30% {
1;
}
70% {
1;
}
100% {
0;
}
}
}
Concerning the height / whitespace at the bottom, you should add
html, body {
height: 100%;
}
Otherwise the .authentic element`s 100% height has no height to refer to.
Concerning the other details, you have to add more details (i.e. code) to your question (i.e. the full relevant CSS and HTML code, not only the media query and part of the HTML)
I am trying to make the search bar expand on device size < 768px. GIF Image.
How to fixed button when I click expand?
#media (max-width: 768px) {
.header-search {
margin-left: 1em;
.search-bar {
max-width: 3em;
margin-left: auto;
&:focus-within {
max-width: 100%;
.search-bar__input {
width: auto;
padding: 0 1em;
}
}
}
.search-bar__input {
width: 0;
padding: 0;
}
}
}
Here is my codepen:
https://codepen.io/phamtien990819/pen/PoqGwEv
I suggest remove the line width:auto in &:focus-within .search-bar__input.
Moreover, you can add padding transition to .search-bar__input to make the transition smoother
#media (max-width: 768px) {
.header-search {
margin-left: 1em;
.search-bar {
max-width: 3em;
margin-left: auto;
&:focus-within {
max-width: 100%;
.search-bar__input {
/*Remove width: auto*/
padding: 0 1em;
}
}
}
.search-bar__input {
width: 0;
padding: 0;
/*Add padding transition*/
transition: padding 3s
}
.search-bar__btn { }
}
}
This CSS code I updated. I used position: absolute; to place button on right of the bar. So even after input is opened button stays on right without moving.
#media (max-width: 768px) {
.header-search {
margin-left: 1em;
position: relative;
.search-bar__input {
margin-left: 10px;
background: transparent;
overflow: hidden;
}
.search-bar__btn {
width: 40px;
position: absolute;
right: 1px;
height: 29px;
}
body {
display: flex;
flex-direction: column;
margin: 0;
min-height: 100vh;
font-size: 14px;
}
ol,
ul {
padding: 0;
margin: 0;
list-style: none;
}
main {
flex: 1;
}
.material-icons {
font-size: 24px;
vertical-align: middle;
}
.material-icons::before {
content: attr(icon);
}
.site-header {
position: sticky;
top: -40px;
width: 100%;
z-index: 99;
background: #fff;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.top-nav {
background: rgba(0, 0, 0, 0.03);
}
.top-nav .container {
display: flex;
justify-content: space-between;
align-items: center;
height: 40px;
}
.top-nav ul {
display: flex;
font-size: 12px;
list-style: none;
}
.top-nav ul>li+li {
margin-left: 1.5em;
}
.top-nav ul a {
color: currentColor;
}
.main-nav .container {
display: flex;
justify-content: space-between;
align-items: center;
height: 5em;
}
.header-brand {
display: flex;
align-items: center;
justify-content: space-between;
}
.header-brand .logo {
text-decoration: none;
color: currentColor;
}
.header-brand .menu-toggle {
display: none;
border: 0;
outline: 0;
background: transparent;
margin-left: 1em;
padding: 6px;
}
/* BEGIN SEARCH BAR */
.header-search {
flex: auto;
margin-left: 4em;
}
.header-search .search-bar {
display: flex;
align-items: center;
border: 1px solid rgba(0, 0, 0, 0.1);
max-width: 25em;
height: 2.5em;
transition: all 3s;
}
.header-search .search-bar__input {
flex: auto;
height: 100%;
border: 0;
padding: 0 1em;
outline: 0;
}
.header-search .search-bar__btn {
width: 3em;
height: 100%;
border: 0;
outline: 0;
text-align: center;
}
#media (max-width: 768px) {
.header-search {
margin-left: 1em;
position: relative;
}
.header-search .search-bar__input {
margin-left: 10px;
background: transparent;
overflow: hidden;
}
.header-search .search-bar__btn {
width: 40px;
position: absolute;
right: 1px;
height: 29px;
}
.header-search .search-bar {
max-width: 3em;
margin-left: auto;
}
.header-search .search-bar:focus-within {
max-width: 100%;
}
.header-search .search-bar:focus-within .search-bar__input {
width: auto;
}
.header-search .search-bar__input {
width: 0;
padding: 0;
}
}
/* END SEARCH BAR */
.header-user {
display: flex;
align-items: center;
}
.header-user .item {
position: relative;
flex-shrink: 0;
display: inline-flex;
}
.header-user .item .user-link {
font-weight: 500;
color: currentColor;
padding: 6px;
border-radius: 4px;
margin-left: 8px;
}
.header-user .item .user-link:hover {
text-decoration: none;
background-color: rgba(0, 0, 0, 0.03);
}
#media (max-width: 768px) {
.s-header {
top: 0;
}
.top-nav {
display: none;
}
.main-nav .container {
height: 4em;
}
.header-brand .menu-toggle {
display: inline-block;
margin-left: 0;
}
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/material-design-icons/3.0.1/iconfont/material-icons.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" />
<body>
<header class="site-header">
<div class="top-nav">
<div class="container">
<ul>
<li>Top menu item</li>
<li>Top menu item</li>
<li>Top menu item</li>
<li>Top menu item</li>
<li>Top menu item</li>
</ul>
</div>
</div>
<nav class="main-nav">
<div class="container">
<div class="header-brand">
<a class="logo d-none d-md-inline-block" href="#">LOGO HERE</a>
<button class="menu-toggle">
<i class="material-icons" icon="menu"></i>
</button>
</div>
<div class="header-search">
<form action="#" class="search-bar">
<input class="search-bar__input" type="search" placeholder="Search..." />
<button class="search-bar__btn" type="button">
<i class="material-icons" icon="search"></i>
</button>
</form>
</div>
<ul class="header-user">
<li class="item">
<a class="user-link" href="#">
<i class="material-icons" icon="person_add"></i>
<span class="d-none d-md-inline">Login / Register</span>
</a>
</li>
</ul>
</div>
</nav>
</header>
<main>
<div class="container" style="height: 1000px">
<p class="mt-4">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
</main>
<footer>
<div class="container">
<p>Footer content</p>
</div>
</footer>
</body>
I want to create chat component in such a way that if I display all its elements it will look like the following:
and if I remove most of the elements, the message will be shown in this way:
However my code has 4 problems:
the picture and the bubble element are not next to each other
the speech bubble do not get shorter with less text;
the text in the bubble doesn't centre vertically on its parent div, rather on the upper parent container;
the day-time element stay fix on the right, rather than being aligned to the right side of the speech-bubble.
I tried many options, but the more I touch the CSS, the more issues I create.
Any suggestion on how to achieve the desired result?
This is my code:
.container {
position: relative;
margin-left: 5%;
max-width: 90%;
height: auto;
}
.upper-text {
width: 100%;
color: black;
font-size: 12px;
line-height: 120%;
}
.message-container {
width: auto;
}
.character-picture {
width: 30px;
height: 30px;
background-color: aqua;
display: inline-block;
}
.buble-wrapper {
max-width: 75%;
height: auto;
}
.speech-bubble {
background-color: #f0f0f0;
border-radius: 0 20px 20px 20px;
width: auto;
min-height: 40px;
}
.message {
color: black;
font-size: 16px;
padding-left: 4%;
padding-right: 4%;
top: 50%;
transform: translateY(-50%);
}
.lower-tex {
color: black;
font-size: 12px;
line-height: 120%;
text-align: right;
}
<div class="container">
<div class="upper-text">Name</div>
<div class="message-container">
<div class="character-picture"></div>
<div class="buble-wrapper">
<div class="speech-bubble">
<div class="message">text message</div>
</div>
</div>
</div>
<div class="lower-tex">Monday: 20:38</div>
</div>
This should do what you're looking for. There is a lot of room for improvement, but this will get you started.
I've removed some of the html you had that I thought unnecessary and changed how you size and place some elements.
I suggest you take a look at CSS Flexbox and Grid, they allow you to do complex layouts like this in a breeze.
.container {
width: auto;
max-width: 250px;
display: inline-flex;
flex-direction: column;
justify-content: flex-start;
align-items: flex-start;
}
.upper-text {
color: black;
font-size: 12px;
align-self: flex-start;
line-height: 1.5;
}
.message-container {
display: flex;
justify-content: flex-start;
align-items: flex-start;
}
.character-picture {
width: 30px;
height: 30px;
background-color: aqua;
margin-right: 10px;
border-radius: 15px;
flex-shrink: 0;
}
.message {
color: black;
font-size: 16px;
word-wrap: break-word;
padding: 5px 10px;
border-radius: 15px;
background-color: #ccc;
display: flex;
align-items: center;
}
.lower-tex {
color: black;
font-size: 12px;
align-self: flex-end;
line-height: 2.5;
}
<div class="container">
<div class="upper-text">Name</div>
<div class="message-container">
<div class="character-picture"></div>
<div class="message">text message example wow this text wraps very well</div>
</div>
<div class="lower-tex">Monday: 20:38</div>
</div>
As mentioned by DoHn, you can achieve this using flex or grid.
Below is the solution using grid.
Read more here complete-guide-grid
For browser support, checkout https://caniuse.com/#search=grid
.container {
display: grid;
grid-template-columns: 30px auto;
grid-gap: 2px 4px;
width: 360px;
}
.upper-text {
color: black;
font-size: 12px;
line-height: 120%;
grid-column: 1 / 3;
grid-row: 1;
}
.message-container {
width: auto;
}
.character-picture {
width: 30px;
height: 30px;
background-color: aqua;
border-radius: 50%;
grid-row: 2;
}
.speech-bubble {
background-color: #f0f0f0;
border-radius: 0 20px 20px 20px;
grid-column: 2 / 3;
grid-row: 2;
justify-self: stretch;
display: grid;
padding: 10px;
}
.message {
margin: auto 0;
}
.lower-text {
color: black;
font-size: 12px;
line-height: 120%;
justify-self: end;
grid-column: 2 / 3;
grid-row: 3;
}
<div class="container">
<div class="upper-text">Name</div>
<div class="character-picture"></div>
<div class="speech-bubble">
<div class="message">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley o</div>
</div>
<div class="lower-text">Monday: 20:38</div>
</div>
.container {
width: 500px;
height: 100px;
padding: 10px;
}
.container .chat-log {
width: 500px;
height: 100px;
margin-top: 20px;
}
.left-side {
width: 20%;
height: auto;
float: left;
}
.right-side {
width: 80%;
height: auto;
position: relative;
left: -15px;
float: right;
}
.text {
font-size: 14px;
text-align: center;
}
.thumbnail {
width: 50px;
height: 50px;
background: #000;
border-radius: 50%;
clear: both;
margin: 0 auto;
position: relative;
}
.thumbnail span.caption {
color: #fff;
text-align: center;
position: relative;
margin: 0;
padding: 0;
top: 30%;
left: 10%;
}
.msg {
position: relative;
width: auto;
height: auto;
text-align: justify;
padding: 20px;
background-color: #f0f0f0;
border-radius: 0px 20px 20px;
}
.msg::before {
content: " ";
position: absolute;
bottom: 79%;
transform: rotate(90deg);
left: -20px;
border-width: 10px;
border-style: solid;
border-color: #f0f0f0 transparent transparent transparent;
}
.time{
float: right;
margin-right:10px;
font-size: 12px;
}
<div class="container">
<div class="chat-log">
<div class="left-side">
<div class="text">
Name
</div>
<div class="thumbnail">
<span class="caption">image</span>
</div>
</div>
<div class="right-side">
<div class="msg">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eum tempore inventore architecto a voluptatum ratione, sunt doloribus nobis iure debitis? Veniam.
</div>
<div class="time">Monday 5:13 PM</div>
</div>
</div>
</div>
I hope this will help you. I do not use flexbox or grid I have made it simple.
how can I add a space between those 2 images and dont allow the text to break on the center of the page? It's for a college project and I've never programmed before.
i actually dont know whats going on on this template i have to edit.. i just need to add a photo of a person in the image circle (which i know how to) and a text of their review, but the images keep going off position and text breaks in the middle..
/*
Horizons by TEMPLATED
templated.co #templatedco
Released for free under the Creative Commons Attribution 3.0 license (templated.co/license)
*/
#import url("font-awesome.min.css");
#import url("http://fonts.googleapis.com/css?family=Raleway:100,200,300,400,500,600,700,800,900");
/* Basic */
}
body {
background: #222833;
}
body,
input,
select,
textarea {
color: #555555;
font-family: 'Raleway', sans-serif;
font-size: 13pt;
font-weight: 300;
line-height: 1.75em;
}
a {
color: #3ac984;
text-decoration: underline;
}
a:hover {
text-decoration: none;
}
strong,
b {
font-weight: 700;
}
em,
i {
font-style: italic;
}
p,
ul,
ol,
dl,
table,
blockquote {
margin: 0 0 2em 0;
}
h1,
h2,
h3,
h4,
h5,
h6 {
color: inherit;
font-weight: 700;
line-height: 1.75em;
margin-bottom: 1em;
}
h1 a,
h2 a,
h3 a,
h4 a,
h5 a,
h6 a {
color: inherit;
text-decoration: none;
}
h2 {
font-size: 1.5em;
}
h3 {
font-size: 1.25em;
}
sub {
font-size: 0.8em;
position: relative;
top: 0.5em;
}
sup {
font-size: 0.8em;
position: relative;
top: -0.5em;
}
hr {
border-top: solid 1px #888888;
border: 0;
margin-bottom: 1.5em;
}
blockquote {
border-left: solid 0.5em #888888;
font-style: italic;
padding: 1em 0 1em 2em;
}
section.special,
article.special {
text-align: center;
}
header.major {
padding-bottom: 4em;
}
header h2 {
margin: 0;
padding: 0;
font-size: 3em;
font-weight: 600;
}
header .byline {
font-size: 1.6em;
}
footer> :last-child {
margin-bottom: 0;
}
footer.major {
padding-top: 3em;
}
/* Form */
input[type="text"],
input[type="password"],
input[type="email"],
textarea {
-moz-appearance: none;
-webkit-appearance: none;
-o-appearance: none;
-ms-appearance: none;
appearance: none;
background: none;
border: solid 1px #888888;
color: inherit;
display: block;
outline: 0;
padding: 0.75em;
text-decoration: none;
width: 100%;
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
textarea:focus {
border-color: #3ac984;
}
input[type="text"],
input[type="password"],
input[type="email"] {
line-height: 1em;
}
::-webkit-input-placeholder {
color: inherit;
opacity: 0.5;
position: relative;
top: 3px;
}
:-moz-placeholder {
color: inherit;
opacity: 0.5;
}
::-moz-placeholder {
color: inherit;
opacity: 0.5;
}
:-ms-input-placeholder {
color: inherit;
opacity: 0.5;
}
.formerize-placeholder {
color: rgba(85, 85, 85, 0.5) !important;
}
/* Image */
.image {
border: 0;
position: relative;
}
.image.fit {
display: block;
}
.image.fit img {
display: block;
width: 100%;
}
.image.feature {
display: block;
margin: 0 0 2em 0;
}
.image.feature img {
display: block;
width: 100%;
}
.image.feature2 {
display: block;
margin: 0 0 5em 0;
}
.image.feature2 img {
display: block;
width: 100%;
border-radius: 50%;
width: 200px;
height: 200px;
float: left margin 40px;
}
/* Icon */
.icon {
position: relative;
}
.icon:before {
content: "";
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-family: FontAwesome;
font-style: normal;
font-weight: normal;
text-transform: none !important;
}
.icon>.label {
display: none;
}
/* Lists */
ol.default {
list-style: decimal;
padding-left: 1.25em;
}
ol.default li {
padding-left: 0.25em;
}
ul {
margin: 0;
padding: 0;
}
ul.default {
list-style: none;
}
ul.default li {
display: block;
padding: 0.60em 0;
border-top: 1px solid;
border-color: rgba(192, 192, 192, 0.15);
}
ul.default> :first-child {
padding-top: 0;
border-top: none;
}
ul.icons {
cursor: default;
}
ul.icons li {
display: inline-block;
line-height: 1em;
padding-left: 0.5em;
}
ul.icons li:first-child {
padding-left: 0;
}
ul.actions {
cursor: default;
}
ul.actions:last-child {
margin-bottom: 0;
}
ul.actions li {
display: inline-block;
padding: 0 0 0 1.5em;
}
ul.actions li:first-child {
padding: 0;
}
ul.actions.vertical li {
display: block;
padding: 1.5em 0 0 0;
}
ul.actions.vertical li:first-child {
padding: 0;
}
ul.contact li {
padding: 1.05em 0;
border-top: 1px solid;
border-color: rgba(192, 192, 192, 0.15);
}
ul.contact li>span {
display: inline-block;
}
ul.contact li .address,
ul.contact li .mail,
ul.contact li .phone {
float: left;
width: 100px;
font-weight: 600;
}
ul.contact> :first-child {
padding-top: 0;
border-top: none;
}
ul.style li {
clear: both;
display: block;
padding-top: 3em;
}
ul.style> :first-child {
padding-top: 0;
}
ul.style h3 {
display: block;
margin: 0;
padding-bottom: 0.50em;
font-size: 1.1em;
font-weight: 700;
color: #404040;
}
ul.style .fa {
float: left;
display: inline-block;
width: 80px;
height: 80px;
margin-right: 1em;
background: #3ac984;
line-height: 80px;
text-align: center;
border-radius: 10px;
font-size: 2em;
color: white;
}
ul.list {
list-style: none;
}
ul.list li {
display: block;
padding: 0.60em 0;
border-top: 1px solid;
border-color: red;
}
ul.list> :first-child {
padding-top: 0;
border-top: none;
}
/* Tables */
table {
width: 100%;
}
table.default {
width: 100%;
}
table.default tbody tr {
border-bottom: solid 1px #888888;
}
table.default td {
padding: 0.5em 1em 0.5em 1em;
}
table.default th {
font-weight: 700;
padding: 0.5em 1em 0.5em 1em;
text-align: left;
}
table.default thead {
background: #555555;
color: #fff;
}
/* Button */
input[type="submit"],
input[type="reset"],
input[type="button"],
.button {
-moz-appearance: none;
-webkit-appearance: none;
-o-appearance: none;
-ms-appearance: none;
appearance: none;
-moz-transition: background-color 0.2s ease-in-out;
-webkit-transition: background-color 0.2s ease-in-out;
-o-transition: background-color 0.2s ease-in-out;
-ms-transition: background-color 0.2s ease-in-out;
transition: background-color 0.2s ease-in-out;
background: #3ac984;
border-radius: 40px;
border: 0;
color: white;
cursor: pointer;
display: inline-block;
padding: 0.80em 2em;
text-align: center;
text-decoration: none;
font-size: 1.4em;
font-weight: 600;
min-width: 10em;
}
input[type="submit"]:hover,
input[type="reset"]:hover,
input[type="button"]:hover,
.button:hover {
background-color: #32b777;
}
input[type="submit"].fit,
input[type="reset"].fit,
input[type="button"].fit,
.button.fit {
width: 100%;
}
input[type="submit"].small,
input[type="reset"].small,
input[type="button"].small,
.button.small {
font-size: 0.8em;
}
/* Wrapper */
.wrapper.style1 {
background: #fff;
}
.wrapper.style2 {
background: #ececec;
padding: 6em 0;
text-align: center;
}
.wrapper.style4 {
background: #ececec;
padding: 1em 0;
text-align: center;
}
.wrapper.style3 {
padding: 2em 0 3.5em 0;
background: #ececec;
}
.wrapper.style3 span {
display: inline-block;
padding-top: 0.80em;
font-size: 2em;
font-weight: 600;
}
.wrapper.style3 .button {
float: right;
}
/* Header */
#header {
background: #333333 url("../images/pic01.jpg") no-repeat;
background-size: cover;
color: #fff;
padding: 6em 0;
text-align: center;
background-position: 0% 65%;
position: relative;
}
#header:before {
content: '';
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(16, 32, 48, 0.25);
}
#header>* {
position: relative;
z-index: 1;
}
.homepage #header {
padding: 8em 0;
background-position: center;
}
#logo {
font-size: 2em;
}
#nav>ul {
margin: 0;
}
#nav>ul>li {
border-radius: 10px 10px 0 0;
display: inline-block;
margin-left: 0.5em;
padding: 0.5em 1.5em;
}
#nav>ul>li a {
color: #FFF;
text-decoration: none;
font-size: 1.2em;
}
#nav>ul>li:first-child {
margin-left: 0;
}
#nav>ul>li:hover a {
color: #fff;
}
#nav>ul>li.active {
background: #3ac984;
}
#nav>ul>li.active a {
color: white;
}
#nav>ul>li>ul {
display: none;
}
/* Dropotron */
.dropotron {
margin-top: -2px;
background: #3ac984;
border-radius: 10px;
color: white;
min-width: 12em;
padding: 1em 0;
}
.dropotron>li {
line-height: 2em;
padding: 0 1em;
}
.dropotron>li>a {
color: #FFF;
text-decoration: none;
}
.dropotron>li.active>a,
.dropotron>li:hover>a {
color: #FFF;
}
.dropotron.level-0 {
border-radius: 0 10px 10px 10px;
font-size: 1em;
}
/* Banner */
#banner {
text-align: center;
padding: 4em 0 0 0;
}
#banner .major h2 {
font-size: 3.5em;
}
#banner .major .byline {
display: block;
margin: 0em 2em;
line-height: 1.6em;
font-size: 1.5em;
}
#banner a {
color: inherit;
}
/* Main */
.no-sidebar #main .major,
.left-sidebar #main .major,
.right-sidebar #main .major {
text-align: left;
}
.homepage #main .major {
text-align: center;
}
#main {
padding: 6em 0;
}
#main .sidebar .major {
padding-bottom: 2em;
}
#main .sidebar .major h2 {
font-size: 1.8em;
}
#main .sidebar .default li {
border-color: #cdcdcd;
}
#main .sidebar .default a {
color: #464646;
}
#main .sidebar> :first-child {
margin-bottom: 3em;
}
/* Footer */
#footer {
padding: 4em 0;
color: #fff;
}
#footer .major h2 {
font-size: 2em;
color: #FFF;
}
#footer .major .byline {
font-size: 1.1em;
}
#footer .copyright {
margin-top: 3em;
padding-top: 3em;
border-top: 1px solid;
border-color: rgba(192, 192, 192, 0.15);
text-align: center;
color: inherit;
}
#footer a {
color: inherit;
}
#middle {
height: 600px;
width: 300px;
background: green;
}
<!DOCTYPE HTML>
<!--
Horizons by TEMPLATED
templated.co #templatedco
Released for free under the Creative Commons Attribution 3.0 license (templated.co/license)
-->
<html>
<head>
<title>Horizons by TEMPLATED</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<!--[if lte IE 8]><script src="css/ie/html5shiv.js"></script><![endif]-->
<script src="js/jquery.min.js"></script>
<script src="js/jquery.dropotron.min.js"></script>
<script src="js/skel.min.js"></script>
<script src="js/skel-layers.min.js"></script>
<script src="js/init.js"></script>
<noscript>
<link rel="stylesheet" href="css/skel.css" />
<link rel="stylesheet" href="css/style.css" />
</noscript>
<!--[if lte IE 8]><link rel="stylesheet" href="css/ie/v8.css" /><![endif]-->
</head>
<body class="homepage">
<!-- Header -->
<div id="header">
<div class="container">
<!-- Logo -->
<h1>Vista 702</h1>
<!-- Nav -->
<nav id="nav">
<ul>
<li>Fotos</li>
<li>Depoimentos</li>
<li>Planos</li>
</nav>
<!-- Banner -->
<div id="banner">
<div class="container">
<section>
<header class="major">
<h2>Vista 702</h2>
<span class="byline">… a melhor vista de Juiz de Fora para se passar o feriado, réveillon e comemorações em geral.</span>
</header>
Sign Up
</section>
</div>
</div>
</div>
</div>
<!-- Featured -->
<div class="wrapper style2">
<section class="container">
<header class="major">
<a id="fotos"></a>
<h2>Fotos</h2>
<span class="byline">Sua visita começa aqui.</span>
</header>
<div class="row no-collapse-1">
<section class="4u">
<a class="image feature"><img src="images/pic02.jpg" alt=""></a>
<p>Nam in massa. Sed vel tellus. Curabitur sem urna, consequat vel, suscipit in, mattis placerat.</p>
</section>
<section class="4u">
<a class="image feature"><img src="images/pic03.jpg" alt=""></a>
<p>Donec ornare neque ac sem. Mauris aliquet. Aliquam sem leo, vulputate sed, convallis. Donec magna.</p>
</section>
<section class="4u">
<a class="image feature"><img src="images/pic04.jpg" alt=""></a>
<p>Curabitur sem urna, consequat vel, suscipit convallis sem leo, mattis placerat, nulla. Sed ac leo.</p>
</section>
</div>
</section>
</div>
<div class="wrapper style2">
<section class="container">
<header class="major">
<a id="depoimentos"></a>
<h2>Depoimentos</h2>
<span class="byline">Os viajantes recomendam.</span>
</header>
<div class="row no-collapse-1">
<section class="">
<a class="image feature2"><img src="https://abrilexame.files.wordpress.com/2016/09/size_960_16_9_google-robert-bunsen.jpg" align="left"=""></a>
<p>Nam in massa. Sed vel tellus. Curabitur sem urna, consequat vel, suscipit in, mattis placerat.</p>
</section>
<section class="">
<a class="image feature2"><img src="https://eduardhosp-alemao.com.br/wp-content/uploads/2018/05/Hashtag-Google-Alem%C3%A3o-Sem-Complica%C3%A7%C3%A3o.jpg" align="left"></a>
<p>Curabitur sem urna, consequat vel, suscipit convallis sem leo, mattis placerat, nulla. Sed ac leo.</p>
</section>
</div>
</section>
</div>
<!-- Main -->
<div id="main" class="wrapper style1">
<section class="container">
<header class="major">
<a id="planos"></a>
<h2>Uma janelas, diversas</h2>
<span class="byline">Um plano para todos os bolsos.</span>
</header>
<div class="row">
<!-- Content -->
<div class="6u">
<section>
<ul class="style">
<li>
<span class="fa fa-wrench"></span>
<h3>Integer ultrices</h3>
<span>In posuere eleifend odio. Quisque semper augue mattis wisi. Maecenas ligula. Pellentesque viverra vulputate enim.</span>
</li>
<li>
<span class="fa fa-cloud"></span>
<h3>Aliquam luctus</h3>
<span>Pellentesque viverra vulputate enim. Aliquam erat volutpat. Maecenas condimentum enim tincidunt risus accumsan.</span>
</li>
</ul>
</section>
</div>
<div class="6u">
<section>
<ul class="style">
<li>
<span class="fa fa-cogs"></span>
<h3>Integer ultrices</h3>
<span>In posuere eleifend odio. Quisque semper augue mattis wisi. Maecenas ligula. Pellentesque viverra vulputate enim.</span>
</li>
<li>
<span class="fa fa-leaf"></span>
<h3>Aliquam luctus</h3>
<span>Pellentesque viverra vulputate enim. Aliquam erat volutpat. Maecenas condimentum enim tincidunt risus accumsan.</span>
</li>
</ul>
</section>
</div>
</div>
</section>
</div>
<!-- Footer -->
<div id="footer">
<div class="container">
<!-- Lists -->
<div class="row">
<div class="8u">
<section>
<header class="major">
<h2>Donec dictum metus</h2>
<span class="byline">Quisque semper augue mattis wisi maecenas ligula</span>
</header>
<div class="row">
<section class="6u">
<ul class="default">
<li>Pellentesque elit non gravida blandit.</li>
<li>Lorem ipsum dolor consectetuer elit.</li>
<li>Phasellus nibh pellentesque congue.</li>
<li>Cras vitae metus aliquam pharetra.</li>
</ul>
</section>
<section class="6u">
<ul class="default">
<li>Pellentesque elit non gravida blandit.</li>
<li>Lorem ipsum dolor consectetuer elit.</li>
<li>Phasellus nibh pellentesque congue.</li>
<li>Cras vitae metus aliquam pharetra.</li>
</ul>
</section>
</div>
</section>
</div>
<div class="4u">
<section>
<header class="major">
<h2>Donec dictum metus</h2>
<span class="byline">Mattis wisi maecenas ligula</span>
</header>
<ul class="contact">
<li>
<span class="address">Address</span>
<span>1234 Somewhere Road #4285 <br />Nashville, TN 00000</span>
</li>
<li>
<span class="mail">Mail</span>
<span>someone#untitled.tld</span>
</li>
<li>
<span class="phone">Phone</span>
<span>(000) 000-0000</span>
</li>
</ul>
</section>
</div>
</div>
<!-- Copyright -->
<div class="copyright">
Design: TEMPLATED Images: Unsplash (CC0)
</div>
</div>
</div>
<a id="middle"></a>
</body>
</html>
thanks
Just use white-space: nowrap on the text element to make the text stay on the same line regardless of the parents size.
And for the images, you need to either add margin or padding on the parent container.
i.e,
.4u p {
white-space: nowrap;
}
and
.4u{
padding: 0.23em;
}
or
.4u{
margin: 0.23em;
}
apparently the footer background went missing too
Edited:
This is the changes I made to your code
.flex {
display: flex;
flex-direction: column;
justify-content: space-between;
}
.flex-item + .flex-item {
margin-top: 30px;
}
.image.feature2 {
display: block;
margin: 0 0 7em 0;
}
<div class="row no-collapse-1">
<div class="flex">
<section class="flex-item">
<a class="image feature2"><img
src="https://abrilexame.files.wordpress.com/2016/09/size_960_16_9_google-robert-bunsen.jpg" align="left" =""></a>
<p>Nam in massa. Sed vel tellus. Curabitur sem urna, consequat vel, suscipit in, mattis placerat.</p>
</section>
<section class="flex-item">
<a class="image feature2"><img src="https://eduardhosp-alemao.com.br/wp-content/uploads/2018/05/Hashtag-Google-Alem%C3%A3o-Sem-Complica%C3%A7%C3%A3o.jpg" align="left"></a>
<p>Curabitur sem urna, consequat vel, suscipit convallis sem leo, mattis placerat, nulla. Sed ac leo.</p>
</section>
I'm currently trying to add some simple padding to the bottom of my testimonial element, so that it doesn't end right after the text.
It seems that no matter what value I enter in padding or padding-bottom, the bottom padding expands a set amount. I'm wondering how to fix this so it displays padding that is specific to the value I set.
/****
GENERAL
****/
* {
margin: 0;
padding: 0;
font-family: sans-serif;
color: black;
}
html {
position: relative;
min-height: 100%;
}
body {
margin: 0 0 120px;
}
li {
list-style: none;
}
a, a:visited {
text-decoration: none;
color: black;
cursor: pointer;
}
a:hover {
color: #009999;
}
.divide {
width: 75%;
border: 1px solid grey;
margin: 20px auto;
}
/****
NAVIGATION
****/
.navigation {
display: flex;
flex-direction: row;
justify-content: center;
z-index: 1000;
}
.navigation li {
display: inline-block;
padding: 5px;
}
.navigation li a {
padding: 8px 10px;
display: block;
}
.submenu {
position: relative
}
.sub-hover {
position: absolute;
width: 106.42px;
display: none;
}
.sub-hover a {
font-size: 1em;
}
.submenu:hover ~ .sub-hover,
.sub-hover:hover {
display: block;
background-color: rgba(38, 12, 12, 0.04);
border-bottom-left-radius: 5%;
border-bottom-right-radius: 5%;
}
/****
LOGO
****/
.circle {
border: 1px solid gray;
border-radius: 100%;
height: 90px;
width: 90px;
margin-left: auto;
margin-right: auto;
margin-bottom: 30px;
clear: both;
}
/****
IMAGE SLIDER
****/
.main-gallery {
background-color: rgba(38, 12, 12, 0.03);
border-radius: 5px;
height: 450px;
clear: both;
margin-bottom: 25px;
}
/****
TESTIMONIAL
****/
.testimonial {
clear: both;
display: block;
margin: 10px 0;
padding: 0 5%;
background-color: rgba(50, 173, 140, 0.82);
}
/****
SOCIAL
****/
.insta {
height: 50px;
width: 90%;
background-color: blue;
margin: 10px auto;
}
/****
FOOTER
****/
.footer {
background-color: grey;
height: 100px;
clear: both;
bottom: 0;
position: absolute;
}
.footer p {
text-align: center;
padding: 20px;
}
<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="css/normalize.css">
<link type="text/css" rel="stylesheet" href="css/skeleton.css">
<link type="text/css" rel="stylesheet" href="css/main.css">
</head>
<body>
<ul class="navigation six columns offset-by-three">
<li>HOME</li>
<li>PORTFOLIO
<div class="sub-hover">
Photos
Physical
Write
Studies
</div>
</li>
<li>ABOUT</li>
<li>CONTACT</li>
</ul>
<div id="logo">
<div class="circle">
</div>
</div>
<div class="main-gallery eleven columns offset-by-half">
<div id="main-images">
<img src=""/>
<img src=""/>
<img src=""/>
<img src=""/>
</div>
</div>
<div class="testimonial">
<div class="test-text">
<p><b>Joe Blogs</b></p>
<p>Distinguished Person</p>
<p><i>"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas et orci sit amet nibh aliquam auctor eu eget turpis. Quisque quis leo lacus. Etiam vitae magna eu arcu gravida tincidunt. Ut consectetur mi id enim."</i></p>
</div>
</div>
<div class="divide"></div>
<div class="insta">
</div>
<div class="footer twelve columns">
<p>Jacob Riman Design</p>
</div>
</body>
</html>
How padding shorthand works....
default declaration of padding looks like this:
padding-top: 10px;
padding-right: 10px;
padding-bottom: 10px;
padding-left: 10px;
You can abbreviate that and apply padding to all sides equally:
padding: 10px;
You can abbreviate a little less and apply different values to top and bottom, and right and left.
This equates to padding: top/bottom right/left;
padding: 10px 20px;
You can use full abbreviations to apply different values to each of the 4 sides independently:
This equates to padding: top right bottom left; or:
padding: 10px 20px 5px 20px;
In your CSS you have no top or bottom padding applied to the testimonial class, you only have right/left padding applied:
.testimonial {
padding: 0 5%;
}
You basically have (pseudo code as example):
.testimonial {
padding: top=0 right=5% bottom=0 left=5%;
}
If you want a the same padding all the way around, remove the first 0 in the property:
.testimonial {
padding: 5%;
}
If you want a similar top/bottom padding, then merely adjust the padding property to add top/bottom values:
.testimonial {
padding: 10% 5%;
}
If you want different padding on the top and bottom, then adjust the padding property to add all the values:
.testimonial {
padding: 0 5% 10% 5%;
}
You don't have any bottom padding. Changing to padding: 10px 5% adds 10px padding to the top and bottom, 5% to the left and right.
/****
GENERAL
****/
* {
margin: 0;
padding: 0;
font-family: sans-serif;
color: black;
}
html {
position: relative;
min-height: 100%;
}
body {
margin: 0 0 120px;
}
li {
list-style: none;
}
a, a:visited {
text-decoration: none;
color: black;
cursor: pointer;
}
a:hover {
color: #009999;
}
.divide {
width: 75%;
border: 1px solid grey;
margin: 20px auto;
}
/****
NAVIGATION
****/
.navigation {
display: flex;
flex-direction: row;
justify-content: center;
z-index: 1000;
}
.navigation li {
display: inline-block;
padding: 5px;
}
.navigation li a {
padding: 8px 10px;
display: block;
}
.submenu {
position: relative
}
.sub-hover {
position: absolute;
width: 106.42px;
display: none;
}
.sub-hover a {
font-size: 1em;
}
.submenu:hover ~ .sub-hover,
.sub-hover:hover {
display: block;
background-color: rgba(38, 12, 12, 0.04);
border-bottom-left-radius: 5%;
border-bottom-right-radius: 5%;
}
/****
LOGO
****/
.circle {
border: 1px solid gray;
border-radius: 100%;
height: 90px;
width: 90px;
margin-left: auto;
margin-right: auto;
margin-bottom: 30px;
clear: both;
}
/****
IMAGE SLIDER
****/
.main-gallery {
background-color: rgba(38, 12, 12, 0.03);
border-radius: 5px;
height: 450px;
clear: both;
margin-bottom: 25px;
}
/****
TESTIMONIAL
****/
.testimonial {
clear: both;
display: block;
margin: 10px 0;
padding: 10px 5%;
background-color: rgba(50, 173, 140, 0.82);
}
/****
SOCIAL
****/
.insta {
height: 50px;
width: 90%;
background-color: blue;
margin: 10px auto;
}
/****
FOOTER
****/
.footer {
background-color: grey;
height: 100px;
clear: both;
bottom: 0;
position: absolute;
}
.footer p {
text-align: center;
padding: 20px;
}
<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="css/normalize.css">
<link type="text/css" rel="stylesheet" href="css/skeleton.css">
<link type="text/css" rel="stylesheet" href="css/main.css">
</head>
<body>
<ul class="navigation six columns offset-by-three">
<li>HOME</li>
<li>PORTFOLIO
<div class="sub-hover">
Photos
Physical
Write
Studies
</div>
</li>
<li>ABOUT</li>
<li>CONTACT</li>
</ul>
<div id="logo">
<div class="circle">
</div>
</div>
<div class="main-gallery eleven columns offset-by-half">
<div id="main-images">
<img src=""/>
<img src=""/>
<img src=""/>
<img src=""/>
</div>
</div>
<div class="testimonial">
<div class="test-text">
<p><b>Joe Blogs</b></p>
<p>Distinguished Person</p>
<p><i>"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas et orci sit amet nibh aliquam auctor eu eget turpis. Quisque quis leo lacus. Etiam vitae magna eu arcu gravida tincidunt. Ut consectetur mi id enim."</i></p>
</div>
</div>
<div class="divide"></div>
<div class="insta">
</div>
<div class="footer twelve columns">
<p>Jacob Riman Design</p>
</div>
</body>
</html>
.testimonial {
clear: both;
display: block;
margin: 10px 0;
padding: 0 5% 5% 0;
background-color: rgba(50, 173, 140, 0.82);
}
Adding all of the values ( even if 0 ) solved the problem right away.
Also, I am aware that if only two values are given the 1st represents top and bottom.
You don't currently have padding on the bottom of the testimonial div.
.testimonial {
clear: both;
display: block;
margin: 10px 0;
padding: 1% 5%;
background-color: rgba(50, 173, 140, 0.82);
}
Change the padding to the above ... padding: 1% 5%; or to target specifically the bottom ... padding 0 5% 1%; ... do that and you should be good to go, unless I'm misunderstanding your question. Good luck!
Found that having the last set of text in .testimonial in a paragraph tag, it was inserting a line break. So simply took that away and now it seems to be working fine.