I have been fixing my codes since last night, I cannot add more height: 100% in some class names because it just messed up the output worse.
This is my codepen -> https://codepen.io/sasddd/pen/QWKPPwg
Just view this in details view so you can see the difference in spaces.
Here's my codes in PUG
.content
section.event
.container__content
.event__title-container
.title
.title__lines
h1.title__text EVENT
.content__item-container.content__item-container--event
a.content__item(href="#")
img.content__image.content__image--event(
src="https://i.picsum.photos/id/1022/6000/3376.jpg?hmac=FBA9Qbec8NfDlxj8xLhV9k3DQEKEc-3zxkQM-hmfcy0"
)
.content__wrapper.content__wrapper--event
.content__date.content__date--event
p.content__date-text 22 Jun, 2020
.content__category-wrapper.content__category-wrapper--event
p.content__title さまざまな業種や形態の体験施策に携わってきた経験値を武器に難な状...況を乗り越える さまざまな業種や形態の体験施策に携わってきた経験値を武器に難な状...況を乗り越える
.event__title-line
.event__description-container
p.content__title--event 開催日:2020年12月24日
p.content__title--event 開催場所:東京都 渋谷区
p.content__title--event カテゴリ:フリーマーケット
a.content__item(href="#")
img.content__image.content__image--event(
src="https://i.picsum.photos/id/1022/6000/3376.jpg?hmac=FBA9Qbec8NfDlxj8xLhV9k3DQEKEc-3zxkQM-hmfcy0"
)
.content__wrapper.content__wrapper--event
.content__date.content__date--event
p.content__date-text 22 Jun, 2020
.content__category-wrapper.content__category-wrapper--event
p.content__title 宮津満腹祭 うまいもん集まれ 2020年12月24日開催
.event__title-line
.event__description-container
p.content__title--event 開催日:2020年12月24日
p.content__title--event 開催場所:東京都 渋谷区
p.content__title--event カテゴリ:フリーマーケット
a.content__item(href="#")
img.content__image.content__image--event(
src="https://i.picsum.photos/id/1022/6000/3376.jpg?hmac=FBA9Qbec8NfDlxj8xLhV9k3DQEKEc-3zxkQM-hmfcy0"
)
.content__wrapper.content__wrapper--event
.content__date.content__date--event
p.content__date-text 22 Jun, 2020
.content__category-wrapper.content__category-wrapper--event
p.content__title 宮津満腹祭 うまいもん集まれ 2020年12月24日開催
.event__title-line
.event__description-container
p.content__title--event 開催日:2020年12月24日
p.content__title--event 開催場所:東京都 渋谷区
p.content__title--event カテゴリ:フリーマーケット
p.content__title--event カテゴリ:フリーマーケット
Here's my codes in SCSS
// EVENT SCSS
.event {
position: relative;
&__title-container {
margin-top: 61px;
}
&__title-line {
border-top: 1px solid black;
margin-left: 6px;
padding-left: 20px;
height: 100%;
}
&__description-container {
display: inline-block;
border-left: 1px solid black;
height: 100%;
}
}
// CONTENT.SCSS
.content {
position: relative;
&__image {
width: 380px;
height: 210px;
object-fit: cover;
object-position: center;
border: 5px solid white;
&--small {
border: 4px solid white;
width: 278px;
height: 156px;
}
&--category {
border: 4px solid white;
margin-top: 22px;
}
&--event {
border: 4px solid white;
height: 200px;
}
}
&__item {
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
width: 378px;
color: black;
margin: 0;
&--small {
width: 278px;
margin-bottom: 31px;
}
&:not(:nth-child(3n + 3)) {
margin-right: 35px;
}
&--category {
// blank
}
}
&__item-container {
width: 1220px;
display: flex;
flex-wrap: wrap;
margin-top: 27px;
height: 100%;
&--small {
width: 907px;
}
&--category {
width: 100%;
}
&--event {
width: 100%;
}
}
&__date {
position: absolute;
margin-top: 5px;
left: -5px;
top: 38px;
height: 28px;
white-space: nowrap;
transform: rotate(-90deg);
&--small {
left: -10px;
}
&--category {
left: -25px;
}
&--event {
top: 170px;
left: 25px;
}
}
&__date-text {
font-size: 12px;
&--category {
font-size: 12px;
}
}
&__wrapper {
position: relative;
display: flex;
justify-content: center;
width: 100%;
height: 100%;
padding-top: 8px;
padding-left: 50px;
&--category {
padding-left: 12px;
}
&--event {
justify-content: center;
align-items: center;
width: 100%;
// height: 100%;
}
}
&__category-wrapper {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
&--small {
//blank
}
&--sp {
//blank
}
&--event {
display: block;
width: 100%;
// height: 100%;
}
}
&__category-line {
border-left: 1px solid black;
margin-left: 6px;
margin-top: 15px;
padding-bottom: 5px;
padding-right: 8px;
&--small {
margin-left: -5px;
}
}
&__category-text {
font-size: 16px;
letter-spacing: 0.1em;
padding-left: 19px;
width: 338px;
max-width: 100%;
&--small {
width: 234px;
padding-left: 14px;
}
&--sidepanel {
width: 100%;
padding-left: 0;
line-height: 2.25em;
}
&::before {
content: " \25A0";
padding-right: 14px;
cursor: pointer;
}
&--skyblue {
color: blue;
}
&--islamicgreen {
color: green;
}
&--tawny {
color: yellow;
}
&--purple {
color: purple;
}
&--amaranth {
color: red;
}
}
&__title-line {
border-top: 1px solid black;
border-left: 1px solid black;
margin-left: 6px;
padding-right: 8px;
padding-bottom: 21px;
height: 100%;
&--small {
margin-left: -13px;
padding-bottom: 5px;
padding-right: 0;
}
&--category {
padding-bottom: 2px;
}
// &--event {
// border-left: 1px solid $border;
// margin-left: 6px;
// padding-right: 8px;
// height: 100%;
// }
}
&__title {
padding-top: 21px;
padding-left: 22px;
font-size: 24px;
font-weight: bold;
line-height: 1.5em;
width: 338px;
max-width: 100%;
height: 100%;
&--small {
padding-top: 13px;
padding-left: 15px;
padding-right: 8px;
font-size: 18px;
line-height: 1.44em;
width: 234px;
}
&--sidepanel {
font-size: 18px;
line-height: 1.5em;
padding-top: 0;
padding-left: 0;
width: 100%;
}
&--event {
padding-top: 13px;
padding-left: 15px;
padding-right: 8px;
font-size: 16px;
width: 234px;
}
}
}
Here something that you could try:
Refer to this answer, edit class content__title to make it fixed lines.
Remove justify-content: center; align-items: center; from class content__wrapper--event to make the content not in center.
I just play with my codes and I created a new container and added height: 100%;. That's it!
Related
I am working on getting my website to be fully responsive and am experiencing some trouble with getting the formatting for mobile to look correct. The page's height is too long on mobile and content is not large enough for the user to see clearly; I've attached a photo of what this looks like.
Here is the page's CSS code:
.parent-container {
display: flex;
flex-direction: column;
width: 55%;
margin-top: 5%;
margin-left: 23%;
border-style: solid;
border-color: white;
border-width: 15px;
}
.home-header {
text-align: left;
padding-top: 10%;
padding-left: 10%;
color: #ebcabc;
font-size: 40px;
line-height: 1;
}
.home-buttons {
display: flex;
flex-direction: row;
padding-left: 10%;
text-align: left
}
.button {
height: 70%;
}
.about-container {
width: 75%;
}
.main-text {
text-align: left;
padding-left: 13.5%;
line-height: 1.5;
font-weight: 500;
font-size: 18px;
color: white;
}
.tiktok {
width: 15%;
height: 70%;
padding-left: 15%;
}
.mail {
width: 50%;
height: 70%;
padding-left: 10%;
}
.calendly {
color: white;
text-decoration: none;
}
CSS code for mobile
#media only screen and (max-width: 768px) {
.home-header {
font-size: 25px;
}
.parent-container {
border-width: 10px;
}
.main-text {
font-size: 12px;
}
.home-buttons {
display: flex;
flex-direction: column;
padding-left: 10%;
text-align: center;
}
.whatever
{
width: 75%;
height: 70%;
}
.button-txt {
font-size: 8px;
}
button {
bottom: 20%;
}
.tiktok {
width: 15%;
height: 70%;
margin-left: 10%;
}
.mail {
width: 25%;
height: 70%;
margin-left: 10%;
}
.calendly {
margin-left: 60px;
}
}
How can I reduce the height of the page for mobile?
I've noticed that the lines are equal in height, I tried to add height: 100% in some specific containers but nothing happened. Any ideas would be appreciated.~
The first image is the expected output with equal lines below.
[![It should be like this][1]][1]
[![This is my output][2]][2]
This is my output. The lines are not equal below. I marked it with dots.
This is my codes in scss
.content {
position: relative;
#include max-width;
&__image {
width: 100%;
height: 202px;
object-fit: cover;
object-position: center;
border: 5px solid white;
#include sp {
width: 85.38%;
height: auto;
}
&--small {
border: 4px solid white;
height: 147px;
#include sp {
top: -10px;
width: 33.29%;
height: auto;
}
}
}
&__item {
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
width: 378px;
color: black;
margin: 0;
#include sp {
width: 100%;
height: auto;
}
&--small {
width: 278px;
#include sp {
flex-direction: row;
align-items: flex-start;
width: 100%;
}
}
&:not(:last-child) {
margin-bottom: 31px;
#include sp {
margin-bottom: getsp375(40px);
}
}
&:not(:nth-child(3n+3)) {
margin-right: 35px;
#include sp {
margin-right: 0;
}
}
}
&__item-container {
width: 1220px;
display: flex;
flex-wrap: wrap;
margin-top: 27px;
height: 100%;
#include sp {
width: 100%;
margin-top: getsp375(42px);
height: auto;
justify-content: center;
}
&--small {
width: 907px;
#include sp {
width: 100%;
}
}
}
&__date {
position: absolute;
margin-top: 5px;
left: -5px;
top: 38px;
height: 28px;
white-space: nowrap;
transform: rotate(-90deg);
#include sp {
margin-top: 0;
left: getsp375(-45px);
top: getsp375(90px);
}
&--small {
left: -10px;
#include sp {
left: 0;
top: getsp375(27px);
}
}
}
&__date-text {
font-size: 12px;
#include sp {
font-size: getsp375(18px);
}
}
&__wrapper {
position: relative;
display: flex;
justify-content: center;
width: 100%;
padding-top: 8px;
padding-left: 50px;
#include sp {
display: block;
padding-top: 0;
padding-left: getsp375(20px);
width: 92%;
height: auto;
}
}
&__category-wrapper {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
&--small {
#include sp {
margin-left: getsp375(15px);
margin-right: getsp375(30px);
}
}
}
&__category-line {
border-left: 1px solid $border;
margin-left: 6px;
margin-top: 15px;
padding-bottom: 5px;
padding-right: 8px;
#include sp {
margin-left: getsp375(18px);
margin-top: getsp375(32px);
padding-bottom: getsp375(19px);
padding-right: 0;
width: 100%;
max-width: 100%;
}
&--small {
margin-left: -5px;
#include sp {
margin-left: getsp375(50px);
margin-top: getsp375(1px);
padding-bottom: getsp375(40px);
}
}
}
&__category-text {
font-size: 16px;
letter-spacing: 0.1em;
padding-left: 19px;
width: 338px;
max-width: 100%;
#include sp {
font-size: getsp375(26px);
padding-left: getsp375(15px);
width: 100%;
max-width: 100%;
}
&--small {
width: 234px;
padding-left: 14px;
#include sp {
position: absolute;
width: 100%;
top: -4px;
}
}
&--sidepanel {
width: 100%;
padding-left: 0;
line-height: 2.25em;
}
&::before {
content: ' \25A0';
padding-right: getsp375(14px);
cursor: pointer;
#include sp {
padding-right: getsp375(10px);
}
}
&--skyblue {
color: $skyblue;
}
&--islamicgreen {
color: $islamicgreen;
}
&--tawny {
color: $tawny;
}
&--purple {
color: $purple;
}
&--amaranth {
color: $amaranth;
}
}
&__title-line {
border-top: 1px solid $border;
border-left: 1px solid $border;
margin-left: 6px;
padding-right: 8px;
padding-bottom: 21px;
#include sp {
margin-left: getsp375(18px);
padding-right: getsp375(8px);
padding-bottom: getsp375(21px);
width: 100%;
max-width: 100%;
}
&--small {
margin-left: -13px;
padding-bottom: 5px;
padding-right: 0;
#include sp {
margin-left: getsp375(50px);
padding-bottom: getsp375(20px);
}
}
}
&__title {
padding-top: 21px;
padding-left: 22px;
font-size: 24px;
font-family: $mincho;
font-weight: $medium;
line-height: 1.5em;
width: 338px;
max-width: 100%;
#include sp {
padding-left: getsp375(21px);
padding-top: getsp375(17px);
font-size: getsp375(36px);
width: 100%;
}
&--small {
padding-top: 13px;
padding-left: 15px;
padding-right: 8px;
font-size: 18px;
line-height: 1.44em;
width: 234px;
#include sp {
padding-top: getsp375(19px);
padding-left: getsp375(21px);
font-size: getsp375(32px);
line-height: 1.5em;
padding-right: 0;
width: 100%;
}
}
&--sidepanel {
font-size: 18px;
line-height: 1.5em;
padding-top: 0;
padding-left: 0;
width: 100%;
#include sp {
font-size: getsp375(27px);
}
}
}
}
This is my codes in pug
div.content
//- SECTION - PICKUP
section.pickup
div.container__content
div.title
div.title__lines
h1.title__text PICKUP
div.content__item-container
a.content__item(href="#")
img.content__image(src="./img/pickup__img1.jpg", alt="pickup1")
div.content__wrapper
div.content__date
p.content__date-text 22 Jun, 2020
div.content__category-wrapper
div.content__category-line
p.content__category-text.content__category-text--skyblue 講習会
div.content__title-line
p.content__title リアルをコアとした体験をデザインし、情報拡散や態度変容などの効果を検証
a.content__item(href="#")
img.content__image(src="./img/pickup__img2.jpg", alt="pickup2")
div.content__wrapper
div.content__date
p.content__date-text 22 Jun, 2020
div.content__category-wrapper
div.content__category-line
p.content__category-text.content__category-text--islamicgreen イベント
div.content__title-line
p.content__title リアルをコアとした体験をデザインし、情報拡散や態度
a.content__item(href="#")
img.content__image(src="./img/pickup__img3.jpg", alt="pickup3")
div.content__wrapper
div.content__date
p.content__date-text 22 Jun, 2020
div.content__category-wrapper
div.content__category-line
p.content__category-text.content__category-text--tawny お知らせ
div.content__title-line
p.content__title リアルをコアとした体験をデザインし、情報拡散や態度変容などの効果を検証リアル...を
It was too difficult to debug your code so I created a new "card" structure.
EDIT: I was able to get your code to work by adding height: 100%; to the &__title-line and &__wrapper selectors while also adjusting the width and margins of the "columns" to use % values instead of fixed values.
Fixing Existing Structure
Check out the codepen and the difference between the css.
Alternate New Structure
.card
img(src="https://via.placeholder.com/300x150")
.card__body
.card__left
| 22 Jun, 2020
.card__right
.card__category.card__category--green
| ■ イベント
.card__content
| リアルをコアとした体験をデザインし、情報拡散や態度
And then the following "card" scss
.card {
display: flex;
flex-direction: column;
flex-shrink: 0;
padding: 10px;
width: 33.3%;
img {
border: 5px solid #fff;
margin-bottom: 15px;
max-width: 100%;
}
&__body {
display: flex;
height: 100%;
}
&__left {
font-size: 10px;
padding-right: 5px;
text-align: right;
writing-mode: sideways-lr;
}
&__right {
border-left: 1px solid #000;
width: 100%;
}
&__category {
border-bottom: 1px solid #000;
font-size: 12px;
padding: 0 0 5px 10px;
&--green {
color: #1b9d00;
}
&--blue {
color: #467bde;
}
&--orange {
color: #b67606;
}
}
&__content {
padding: 10px 0 10px 10px;
}
}
Run the example below to check it out.
* {
box-sizing: border-box;
}
body {
background-color: #f1f1f1;
margin: 0;
}
.row {
display: flex;
}
.card {
display: flex;
flex-direction: column;
flex-shrink: 0;
padding: 10px;
width: 33.3%;
}
img {
border: 5px solid #fff;
margin-bottom: 15px;
max-width: 100%;
}
.card__body {
display: flex;
height: 100%;
}
.card__left {
font-size: 10px;
padding-right: 5px;
text-align: right;
writing-mode: sideways-lr;
}
.card__right {
border-left: 1px solid #000;
width: 100%;
}
.card__category {
border-bottom: 1px solid #000;
font-size: 12px;
padding: 0 0 5px 10px;
}
.card__category--blue {
color: #467bde;
}
.card__category--green {
color: #1b9d00;
}
.card__category--orange {
color: #b67606;
}
.card__content {
padding: 10px 0 10px 10px;
}
<div class="row">
<div class="card">
<img src="https://via.placeholder.com/300x150">
<div class="card__body">
<div class="card__left">
22 Jun, 2020
</div>
<div class="card__right">
<div class="card__category card__category--blue">
■ 講習会
</div>
<div class="card__content">
リアルをコアとした体験をデザインし、情報拡散や態度変容などの効果を検証
</div>
</div>
</div>
</div>
<div class="card">
<img src="https://via.placeholder.com/300x150">
<div class="card__body">
<div class="card__left">
22 Jun, 2020
</div>
<div class="card__right">
<div class="card__category card__category--green">
■ イベント
</div>
<div class="card__content">
リアルをコアとした体験をデザインし、情報拡散や態度
</div>
</div>
</div>
</div>
<div class="card">
<img src="https://via.placeholder.com/300x150">
<div class="card__body">
<div class="card__left">
22 Jun, 2020
</div>
<div class="card__right">
<div class="card__category card__category--orange">
■ お知らせ
</div>
<div class="card__content">
リアルをコアとした体験をデザインし、情報拡散や態度変容などの効果を検証リアル...を
</div>
</div>
</div>
</div>
</div>
I tried to change the color of my website. For example I changed "background-color: #3695F6;" to "background-color: #fff;". but my website background doesn't change. I tried to find a missing
semicolon but I didn't find any. I also tried to delete parts of the Css/Html code which I didn't fully understand but that changed nothing. After all that failed I tried to change a margin on the website from 40px to 100px and nothing changed. I think my Css isn't properly connected. can someone please help.
#charset "utf-8";
body {
font: 0.9em Tahoma, Verdana, Arial;
line-height:172%;
background-color: #fff;
margin: 0px;
}
.center {
display: block;
margin-left: 0px;
margin-right: 0px;
}
#containercontainer {
display: block;
margin-left: 0px;
margin-right: 0px;
padding: 30px;
}
/* bovenste kopje ========================================*/
h1.titel {
color: black;
font: Gill Sans, sans-serif;
font-size: 20px;
margin-bottom: -2px;
margin-top: 0px;
}
#titel {
display: block;
margin-left: 0px;
margin-right: 0px;
padding-left: 10px;
border-bottom: solid black 1px;
width: 5.5%;
left: 45%;
margin-top: -5px;
position: relative;
margin-bottom: 20px;
}
/* De Slideshow ========================================*/
.fling-minislide {
width:100%;
height:100%;
padding-bottom: 0%;
overflow:hidden;
position:relative;
}
.fling-minislide img{
position:absolute;
animation:fling-minislide 15s infinite;
opacity: 0;
size: 100% 100%;
}
#keyframes fling-minislide {33%{opacity:1;} 60%{opacity:0;}}
.fling-minislide img:nth-child(3){animation-delay:0s;}
.fling-minislide img:nth-child(2){animation-delay:5s;}
.fling-minislide img:nth-child(1){animation-delay:10s;}
#slideshow {
display: block;
margin-left: 0px;
margin-right: 0px;
padding: 0px;
float: center;
border: solid black 2px;
width: 55%;
margin-bottom: 20px;
height: 300px;
position: relative;
left: 21%;
}
/* Het nieuws blokje ========================================*/
img.nieuws {
margin-top: -20px;
height: 300px;
width: 400px;
position: relative;
border: solid black 2px;
margin-bottom: 20px;
}
p.nieuws {
float: right;
margin-top: -10px;
position: relative;
margin-bottom: 20px;
}
#nieuws {
display: block;
margin-left: 0px;
margin-right: 0px;
padding-left: 10px;
width: 78%;
height: 50px;
left: 10%;
position: relative;
margin-bottom: 20px;
}
/* Het vragen blokje ========================================*/
#vragen {
display: block;
margin-left: 0px;
margin-right: 0px;
padding-left: 0px;
width: 80%;
height: 1000px;
left: 10%;
position: relative;
margin-bottom: 20px;
top: 300px;
}
p.A{
margin-top: 10px;
font-size: 22px;
width: 250px;
margin-left: 20px;
font-weight: bold;
}
#pointer {
width: 20px;
height: 20px;
position: relative;
background: black;
margin-left: 30px;
}
#pointer:after {
content: "";
position: absolute;
left: 0;
bottom: 0;
width: 0;
height: 0;
border-left: 10px solid white;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
}
#pointer:before {
content: "";
position: absolute;
right: -10px;
bottom: 0;
width: 0;
height: 0;
border-left: 10px solid black;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
}
p.vragentop1 {
margin-left: 80px;
margin-top: -25px;
text-decoration: underline;
width: 600px;
}
p.vragentext1 {
margin-left: 80px;
margin-top: -10px;
position: relative;
margin-bottom: 50px;
width: 600px;
}
/* hoveren over plaatje in directie//////////////////////////////////////////////////////////////////////*/
.container::after, .row::after {
content: "";
clear: both;
display: table;
}
.column {
float: left;
width: 30%;
margin-bottom: 16px;
margin-left: 10px;
margin-top: 20px;
padding: 0 8px;
}
#media screen and (max-width: 650px) {
.column {
width: 100%;
display: block;
}
}
.columnL {
float: left;
width: 30%;
margin-left: 30px;
margin-bottom: 16px;
padding: 0 8px;
margin-top: 20px;
}
.card {
box-shadow: 6px 7px 6px 3px rgba(0,0,0,0.75);
border: solid black 2px;
padding-left: 10px;
}
/*//////////////////////////////////////////////////////////////////////////////////*/
#cbrlogo {
background: #fff;
width: 50px;
}
#container {
width: relative;
padding: relative;
background: #fff;
min-height: 500px;
}
#containercontainer2 {
display: block;
margin-left: 0px;
margin-right: 0px;
padding: 30px;
}
.afbeelding_container {
position: relative;
float: left;
margin-left: 0px;
}
.afbeelding_container .tekst_container {
position: relative;
top: 25px;
left: 50px;
color: #00f;
font-size: 36px;
}
.schoon {
clear: both;
}
#overzicht {
margin-left: 25px;
}
.links {
float: left;
width: 320px;
}
#rechts {
float: right;
}
#onder {
clear: both;
}
.breder {
width: 4000px;
}
ul {
padding-left: 35px;
padding-right: 35px;
list-style: none;
background: #00f;
}
hr {
margin: 0px 0;
height: 1px;
border: 1px solid #fff;
border-top: 10px solid #00f;
background-color: #fff;
}
a:link {
color: black;
text-decoration: none;
}
a:visited {
color: black;
text-decoration: none;
}
a:hover {
color: black;
text-decoration: none;
}
a:active {
color: blue;
text-decoration: none;
}
.menu {
display: block;
margin: 0px;
padding:0px;
position: absolute;
width: 100%;
background-color: #3695F6;
}
ul.menu {
list-style-type: none;
}
img.menu{
border: solid black 2px;
}
.menu li {
float:left;
position:relative;
width: 200px;
text-align:center;
text-decoration: none;
margin: 0px;
padding: 0;
}
.menu li a {
display: block;
padding-bottom: 20px;
padding-right: 10px;
padding-top: 10px;
padding-left: 10px;
text-decoration: none;
position: relative;
z-index: 100;
}
.menu li a span{
display: block;
padding-top: 10px;
font-weight: 700;
font-size: 20px;
color: black;
font-size: 18px;
}
.menu li:hover span{
color: #FFFFFF;
}
th {
padding: 10px 30px 10px 30px;
}
td {
padding: 0 30px 0 30px;
}
td.muteren {
padding: 0 0 0 10px;
}
tbody:before {
line-height:1em;
display:block;
}
thead {
text-align: left;
}
Body
this problem could be the caching problem try clearing your cache if that doesn't work check how you are linking your css to your HTML file if it's correct you can do the last thing which is add !important to the end of the background color like the example below:
background-color:#fff !important;
I have some Javascript pulling information from a database for various films, but the layout of the page is dreadful, I want to achieve something similar to the layout in the screenshot below:
but this is how it looks right now:
How would I go about achieving a layout similar to the one in the top image?
Here is my code (tweaked so you can see content, though the divs would actually be empty without the database usually)
#import url(https://fonts.googleapis.com/css?family=Raleway);
body {
margin: 0;
font-family: 'Raleway', georgia, arial;
background-color: #e0e0e0;
text-align: center;
}
h1 {
color: #aaaaaa;
text-align: left;
}
.sortFilms {
text-align: left;
display: inline-block;
background-color: #ff6699;
width: 80%;
padding: 20px;
}
header {
text-align: center;
display: inline-block;
border-bottom: 5px;
border-top: 0;
border-left: 0;
border-right: 0;
border-style: solid;
border-color: #aaaaaa;
width: 80%;
padding: 20px;
background-color: #e0e0e0;
}
.newFilm {
text-align: left;
display: inline-block;
background-color: #ff6699;
width: 80%;
padding: 20px;
}
label {
font-size: 1em;
padding: 6px;
color: #fff;
font-weight: 700;
display: block;
text-align: left;
}
.form {
margin: auto;
display: flex;
text-align: center;
flex-direction: column;
}
h2 {
font-weight: 700;
font-size: 2em;
width: 50%;
color: #B2365F;
}
#formTitle {
margin-top: 0;
margin-bottom: 0;
}
.row {
margin-left: -20px;
display: grid;
grid-template-columns: 1fr 1fr;
}
.col {
padding: 20px;
}
input,
textarea, select {
width: 100%;
display: block;
border-radius: 25px;
background-color: #e0e0e0;
padding: 10px;
border: none;
box-sizing:border-box; }
}
.tagline {
margin: 0;
color: #333333;
font-size: 1em;
font-weight: 700;
}
input::placeholder {
color: #000;
}
textarea::placeholder {
color: #000;
}
#modifyFilmButton {
float: right;
}
#media only screen and (max-width: 700px) {
.row {
grid-template-columns: 1fr;
}
}
#media screen and (max-width:800px) {
table {
border: 0;
}
table caption {
font-size: 1.3em;
}
table thead {
border: none;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
table tr {
border: 2px solid #e0e0e0;
background-color: #e0e0e0;
display: block;
margin-bottom: .625em;
border-radius: 20px;
}
table td {
display: block;
font-weight: bold;
font-size: 1.2em;
text-align: left;
padding: 15px;
}
table td::before {
/*
* aria-label has no advantage, it won't be read inside a table
content: attr(aria-label);
*/
content: attr(data-label);
float: left;
font-weight: bold;
text-transform: uppercase;
}
table td:last-child {
border-bottom: 0;
}
}
.oldFilm {
border-bottom-left-radius: 20px;
border-bottom-right-radius: 20px;
text-align: left;
display: inline-block;
background-color: #AAAAAA;
width: 80%;
padding: 20px;
}
#oldTitle {
margin-top: 0;
margin-bottom: 0;
color: #ff6699;
padding-bottom: 20px;
}
td {
padding: 5px;
font-weight: bold;
}
table {
border-collapse: collapse;
text-align: center;
width: 100%;
}
thead {
background: #ff6699;
}
.reviewImage {
width: 200px;
border-radius: 20px;
}
.filmRow img {
width: 300px;
height: 420px;
margin: 10px;
border-radius: 20px;
}
.filmRow {
-webkit-flex-flow: row wrap;
justify-content: space-around;
}
#filmContainer {
width: 100%;
margin-top: 10px;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-around;
}
#date {
padding: 5px;
text-align: left;
width: 30%;
}
#date input {
width: auto;
}
#date label {
display: -webkit-inline-box;
}
#oldTitle2 {
margin-top: 0;
margin-bottom: 0;
color: #ff6699;
}
.genre {
padding: 5px;
text-align: left;
width: 60%;
}
.genre input {
width:auto;
}
.genre label {
display: -webkit-inline-box;
}
/* third page */
#filmImage {
width: 300px;
height: 420px;
margin: 10px;
border-radius: 20px;
}
#filmTitle {
font-weight: 700;
margin: 0;
font-size: 3em;
width: 100%;
text-align: center;
color: #B2365F;
}
<header>
<img src="img/rv-logo.png">
<p class="tagline">Want to know whether or not it's worth paying to watch a certain film or not? See what we think first!</p>
</header>
<div class="sortFilms">
<div id="filmContainer">
<img id='filmImage'src="https://images-na.ssl-images-amazon.com/images/I/51Gh9OaWVcL.jpg">
<p id='filmTitle'>Deadpool</p>
<label>Year:</label><p id='filmYear'>2016</p>
<label>Genre:</label><p id='filmGenre'>Comedy</p>
<label>Rating:</label><p id='filmRating'>9</p>
<label>Synopsis:</label><p id='filmSynopsis'>Just Ryan Reynolds, doing Ryan Reynolds things in a tight suit.</p>
<a href='viewFilms.html'>Back to list</a>
</div>
</div>
(ignore the font on the text in the ideal layout, I just used the last one I used on Photoshop)
Any help would be greatly appreciated.
try separate the image and the text in the different div.
make two column, and adjust the width accordingly with the CSS.
<div id="filmContainer">
<div id="leftcolumn">
<img id='filmImage'src="https://images-na.ssl-images-amazon.com/images/I/51Gh9OaWVcL.jpg">
</div>
<div id="rightcolumn">
<p id='filmTitle'>Deadpool</p>
<label>Year:</label><p id='filmYear'>2016</p>
<label>Genre:</label><p id='filmGenre'>Comedy</p>
<label>Rating:</label><p id='filmRating'>9</p>
<label>Synopsis:</label><p id='filmSynopsis'>Just Ryan Reynolds, doing Ryan Reynolds things in a tight suit.</p>
<a href='viewFilms.html'>Back to list</a>
</div>
</div>
First, you should convert most, of not all your IDs to CLASS tags. You don't need to make them all ID and then it limits you from having multiple movie cards on one page.
Where's a JSfiddle I created for you, updating the html a little and mostly the CSS.
HTML:
<header>
<img src="img/rv-logo.png">
<p class="tagline">Want to know whether or not it's worth paying to watch a certain film or not? See what we think first!</p>
</header>
<div class="sortFilms">
<div id="filmContainer">
<div class="poster">
<img id='filmImage'src="https://images-na.ssl-images-amazon.com/images/I/51Gh9OaWVcL.jpg">
</div>
<div class="info">
<p id='filmTitle'>Deadpool</p>
<label>Year:</label><p id='filmYear'>2016</p>
<label>Genre:</label><p id='filmGenre'>Comedy</p>
<label>Rating:</label><p id='filmRating'>9</p>
<label>Synopsis:</label><p id='filmSynopsis'>Just Ryan Reynolds, doing Ryan Reynolds things in a tight suit.</p>
<a href='viewFilms.html'>Back to list</a>
</div>
</div>
</div>
CSS (All of your original CSS is in there too, which could be cleaned up):
#import url(https://fonts.googleapis.com/css?family=Raleway);
body {
margin: 0;
font-family: 'Raleway', georgia, arial;
background-color: #e0e0e0;
text-align: center;
}
h1 {
color: #aaaaaa;
text-align: left;
}
.sortFilms {
text-align: left;
display: inline-block;
background-color: #ff6699;
width: 80%;
padding: 20px;
}
header {
text-align: center;
display: inline-block;
border-bottom: 5px;
border-top: 0;
border-left: 0;
border-right: 0;
border-style: solid;
border-color: #aaaaaa;
width: 80%;
padding: 20px;
background-color: #e0e0e0;
}
.newFilm {
text-align: left;
display: inline-block;
background-color: #ff6699;
width: 80%;
padding: 20px;
}
label {
font-size: 1em;
padding: 6px;
color: #fff;
font-weight: 700;
display: block;
text-align: left;
}
.form {
margin: auto;
display: flex;
text-align: center;
flex-direction: column;
}
h2 {
font-weight: 700;
font-size: 2em;
width: 50%;
color: #B2365F;
}
#formTitle {
margin-top: 0;
margin-bottom: 0;
}
.row {
margin-left: -20px;
display: grid;
grid-template-columns: 1fr 1fr;
}
.col {
padding: 20px;
}
input,
textarea, select {
width: 100%;
display: block;
border-radius: 25px;
background-color: #e0e0e0;
padding: 10px;
border: none;
box-sizing:border-box; }
}
.tagline {
margin: 0;
color: #333333;
font-size: 1em;
font-weight: 700;
}
input::placeholder {
color: #000;
}
textarea::placeholder {
color: #000;
}
#modifyFilmButton {
float: right;
}
#media only screen and (max-width: 700px) {
.row {
grid-template-columns: 1fr;
}
}
#media screen and (max-width:800px) {
table {
border: 0;
}
table caption {
font-size: 1.3em;
}
table thead {
border: none;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
table tr {
border: 2px solid #e0e0e0;
background-color: #e0e0e0;
display: block;
margin-bottom: .625em;
border-radius: 20px;
}
table td {
display: block;
font-weight: bold;
font-size: 1.2em;
text-align: left;
padding: 15px;
}
table td::before {
/*
* aria-label has no advantage, it won't be read inside a table
content: attr(aria-label);
*/
content: attr(data-label);
float: left;
font-weight: bold;
text-transform: uppercase;
}
table td:last-child {
border-bottom: 0;
}
}
.oldFilm {
border-bottom-left-radius: 20px;
border-bottom-right-radius: 20px;
text-align: left;
display: inline-block;
background-color: #AAAAAA;
width: 80%;
padding: 20px;
}
#oldTitle {
width:100%;
margin-top: 0;
margin-bottom: 0;
color: #ff6699;
padding-bottom: 20px;
}
td {
padding: 5px;
font-weight: bold;
}
table {
border-collapse: collapse;
text-align: center;
width: 100%;
}
thead {
background: #ff6699;
}
.reviewImage {
width: 200px;
border-radius: 20px;
}
.filmRow img {
width: 300px;
height: 420px;
margin: 10px;
border-radius: 20px;
}
.filmRow {
-webkit-flex-flow: row wrap;
justify-content: space-around;
}
#filmContainer {
width: 100%;
margin-top: 10px;
display: block;
position: relative;
flex-wrap: wrap;
align-items: center;
justify-content: space-around;
}
#filmContainer .poster {
width:45%;
float:left;
}
#filmContainer .info {
width:50%;
float: right;
}
#filmContainer .info label {
float:left;
width: 25%;
padding:0;
margin: 5px 0;
}
#filmContainer .info p {
float:left;
width: 75%;
margin: 5px 0;
}
#filmContainer .info a {
display:block;
padding: 25px 0;
clear:both;
}
#filmContainer .info p#filmTitle {
width:100%;
clear:both;
margin-top: 0;
margin-bottom: 0;
padding-bottom: 20px;
float: unset;
text-align:left;
}
#date {
padding: 5px;
text-align: left;
width: 30%;
}
#date input {
width: auto;
}
#date label {
display: -webkit-inline-box;
}
#oldTitle2 {
margin-top: 0;
margin-bottom: 0;
color: #ff6699;
}
.genre {
padding: 5px;
text-align: left;
width: 60%;
}
.genre input {
width:auto;
}
.genre label {
display: -webkit-inline-box;
}
/* third page */
#filmImage {
width: 95%;
height: auto;
margin: 10px;
border-radius: 20px;
}
#filmTitle {
font-weight: 700;
margin: 0;
font-size: 3em;
width: 100%;
text-align: center;
color: #B2365F;
}
http://jsfiddle.net/sstracy/vaq60zyp/
I am trying to put a footer at the bottom of the page.
I am unable to make this page's footer correct.
I tried a lot tips and trick that I found but nothing helped me.
I do not want the position fixed, I want the footer under the content.
Add this too your footer style:
position: fixed;
bottom: 0;
z-index: 10;
Entire style sheet:
/*!
* Start Bootstrap - Half Slider (http://startbootstrap.com/template-overviews/half-slider)
* Copyright 2013-2017 Start Bootstrap
* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap-half-slider/blob/master/LICENSE)
*/
html, body { height: 100%; width: 100%; margin: 0;
}
footer{display: block;color: white;width: 100%;background-color: rgb(28,28,28);text-align: center;padding: 10px;position: fixed;bottom: 0;z-index: 10;}
.cock {
}
.telicko {
height: 95.5%;
}
.sicko {
width: 100%;
height: 80%;
position: absolute;
top: 5%;
}
.snavik{
float: left;
margin-top:8vh;
}
.nav {
list-style-type: none;
text-decoration:none;
}
.jednicka a.active{
background-color: rgb(50,134,171);
color: white;
border-radius: 3px;
}
.dvojka a.active{
background-color: rgb(202,76,77);
color: white;
border-radius: 3px;
}
.trojka a.active{
background-color: rgb(219,162,10);
color: white;
border-radius: 3px;
}
.stvorka a.active{
background-color: rgb(132,177,58);
color: white;
border-radius: 3px;
}
.patka a.active{
background-color: black;
color: white;
border-radius: 3px;
}
.jednicka a {
color: black;
}
.dvojka a {
color: black;
}
.trojka a {
color: black;
}
.stvorka a {
color: black;
}
.patka a {
color: black;
}
.jednicka:hover a {
background-color: rgb(50,134,171);
color: white;
border-radius: 3px;
}
.dvojka:hover a{
background-color: rgb(202,76,77);
color: white;
border-radius: 3px;
}
.trojka:hover a{
background-color: rgb(219,162,10);
color: white;
border-radius: 3px;
}
.stvorka:hover a{
background-color: rgb(132,177,58);
color: white;
border-radius: 3px;
}
.patka:hover a{
background-color: black;
color: white;
border-radius: 3px;
}
.objb{
margin-bottom: 2%;
margin-top: 2%;
}
.sobrazky {
margin-top: 4%;
margin-bottom: 7vh;
}
.objbb {
margin-top: 2%;
margin-bottom: 1%;
}
.odpovede {
margin-top:8vh;
margin-left: 20vw;
height: 100%;
width: 70%;
}
.ulicko {
margin-left: -26px;
}
.carousel-item {
height: 50vh;
min-height: 150px;
width: 100%;
background: no-repeat center center scroll;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
margin: 0 auto;
}
#PART1{
padding: 0;
margin: 0;
width: 80%;
height: 25%;
margin: 0 auto;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
align-items: center;
justify-content: center;
-webkit-box-align: center;
}
#PART2a{
padding: 0;
margin: 0;
width: 100%;
height: 25%;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
align-items: center;
justify-content: center;
-webkit-box-align: center;
position: absolute;
top: 45%;
left: 25%;
transform: translate(-50%, -50%);
}
#PART2b{
padding: 0;
margin: 0;
width: 100%;
height: 25%;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
align-items: center;
justify-content: center;
-webkit-box-align: center;
position: absolute;
top: 70%;
left: 50%;
transform: translate(-50%, -50%);
}
.smenu{
position: absolute;
top: 15%;
left: 3%;
}
.snav {
list-style-type: none;
}
.nav-item a:hoover{
color: rgb(236,212,146);
}
.uo {
width: 40%;
display: block;
margin-top: 40%;
}
.medzera {
height: 5vh;
width: 100%;
}
.tretiavec {
width: 35%;
padding-left: 5%;
}
.krok1{
display: flex;
align-items: center;
justify-content: center;
font-size: 150%;
color: black;
border:2px solid rgb(216,192,126);
width: 60px;
height: 60px;
border-radius: 100%;
margin: 0 auto;
background-color: rgb(236,212,146);
}
.krok2{
display: flex;
align-items: center;
justify-content: center;
font-size: 150%;
color: black;
border:2px solid rgb(216,192,126);
width: 60px;
height: 60px;
border-radius: 100%;
margin: 0 auto;
background-color: rgb(236,212,146);
}
.krok3{
display: flex;
align-items: center;
justify-content: center;
font-size: 150%;
color: black;
border:2px solid rgb(216,192,126);
width: 60px;
height: 60px;
border-radius: 100%;
margin: 0 auto;
background-color: rgb(236,212,146);
}
.txta {
width: 20vw;
height: 15vh;
}
.formularo {
position: absolute;
top: 10%;
left:10%;
margin-top: 2%;
padding-bottom: 7%;
width: 80vw;
display: flex;
}
.idd{
text-align: center;
}
.contactformularo{
border-right: 2px solid black;
width: 33%;
padding-right: 5%;
}
.objto {
margin: 0 auto;
margin-top: 10vh;
}
.lolo {
text-align: center;
}
.containerch {
display: block;
position: relative;
padding-left: 35px;
margin-bottom: 12px;
cursor: pointer;
font-size: 22px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
width:100%;
}
.chbox1, .chbox2, .chbox3, .chbox4, .chbox5 {
position: absolute;
opacity: 0;
}
.checkmark {
position: absolute;
top: 0;
left: 0;
height: 25px;
width: 25px;
background-color: #eee;
border-radius: 3px;
}
#checkmark1{
border: 1px solid rgb(50,134,171);
}
#checkmark2{
border: 1px solid rgb(202,76,77);
}
#checkmark3{
border: 1px solid rgb(219,162,10);
}
#checkmark4{
border: 1px solid rgb(132,177,58);
}
#checkmark5{
border: 1px solid black;
}
.containerch:hover input ~ .checkmark {
background-color: #ccc;
}
.containerch input:checked ~ #checkmark1 {
background-color: rgb(50,134,171);
}
.containerch input:checked ~ #checkmark2 {
background-color: rgb(202,76,77);
}
.containerch input:checked ~ #checkmark3 {
background-color: rgb(219,162,10);
}
.containerch input:checked ~ #checkmark4 {
background-color: rgb(132,177,58);
}
.containerch input:checked ~ #checkmark5 {
background-color: black;
}
.checkmark:after {
content: "";
position: absolute;
display: none;
}
.containerch input:checked ~ .checkmark:after {
display: block;
}
.containerch .checkmark:after {
left: 7px;
top: 3px;
width: 40%;
height: 65%;
border: solid white;
border-width: 0 3px 3px 0;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
.answerhos {
}
.modind {
overflow: inherit;
}
.iu {
cursor:pointer
}
.iui {
width: 18vh;
height: 18vh;
border-radius: 100px;
top: 5vh;
display:flex;
justify-content:center;
align-items:center;
margin-left: auto;
margin-right:auto;
}
.modind .hosind .promind .kompind {
width: 100%;
}
.ciarka {
margin-top: 10%;
}
.iuii {
width: 115px;
height:115px;
border-radius: 100px;
top: 5vh;
display: flex;
justify-content:center;
align-items:center;
margin-left: auto;
margin-right:auto;
}
.objednavkaformularo{
float: right;
padding: 5%;
border-right: 2px solid black;
vertical-align: middle;
}
.iui img{
vertical-align:middle;
display:inline-block;
}
.iuii img {
}
.idd {
font-size: 20px;
font-weight: bold;
}
.textik {
font-size: 16px;
width: 60%;
height: 1vh;
margin: 0 auto;
}
.resized {
display: none;
}
.penisnadpis {
margin-left: 1%;
color: rgb(236,212,146);
}
/* pokus o responsivitu */
#media only screen and (max-width: 700px) {
body {
}
#PART1 {
display: none;
}
footer {
position: fixed;
bottom: 0;
}
.uo{
margin-top: 0%;
}
.penisnadpis {
margin-left: 0%;
}
.iui {
float: left;
margin-left: 10vw;
}
.iuii {
float: left;
margin-left: 10vw;
}
.uo {
display: none;
}
.resized {
display: block;
margin-top: 5%;
margin-bottom: 20%;
width: 100%;
}
.texticek {
font-size: 17px;
}
.ibutton {
margin-top:5vh;
}
}
#media only screen and (max-width: 1100px) {
body {
}
#PART1 {
width: 100%;
}
}
#media only screen and (max-width: 1550px) {
body {
background-color:
}
.textik {
width: 85%;
}
#PART1{
width: 90%;
}
}
#media only screen and (max-width: 1000px) {
body {
background-color:
}
#PART1{
width:100%;
}
.textik {
width:95%;
font-size: 13px;
}
.uo {
margin-top: 40%;
}
}
#media only screen and (max-height: 600px) {
body {
}
.telicko {
height:100%;
}
footer {
margin-top: 3%;
}
}