Rough image sizing / positioning.

This commit is contained in:
Robert McGovern 2020-10-01 14:53:16 +01:00
parent 83cfde6bda
commit be1504139d
2 changed files with 45 additions and 12 deletions

View File

@ -1,8 +1,11 @@
/* /*
* Challenge resolutions: * Challenge resolutions:
* 375x667 & 1440x800 * 375x667 & 1440x800
* 327x512 - 730x280
*/ */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;700&display=swap');
:root { :root {
/* font stuff */ /* font stuff */
font-size: 20px; font-size: 20px;
@ -19,6 +22,7 @@
/* Base styling */ /* Base styling */
body { body {
font-family: 'Manrope', sans-serif;
background-color: var(--lightGrayishBlue); background-color: var(--lightGrayishBlue);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -35,18 +39,32 @@ body {
border-radius: var(--cornerRadius); border-radius: var(--cornerRadius);
background-color: white; background-color: white;
width: 85%; width: 87%;
margin: 0 auto; margin: 0 auto;
} }
.previewImage { .previewImage {
width: 100%; flex: 1 45%;
object-fit: fill; overflow: hidden;
border-radius: var(--cornerRadius) var(--cornerRadius) 0 0; border-radius: var(--cornerRadius) var(--cornerRadius) 0 0;
} }
.previewBody {
margin-top: 1.5rem; /*
padding: 1rem 1rem; * image size is: 660x528
* sketch: 327x200
* currently: 326.25x200.5
*/
.previewImage > img {
width: 100%;
margin:-4% 0 -15% 0% ;
} }
.previewBody {
flex: 1 60%;
margin-top: 1.5rem;
padding: 1rem 1.5rem;
}
.articleSummary { .articleSummary {
} }
.articleTitle { .articleTitle {
@ -72,18 +90,22 @@ body {
width: 2.5rem; width: 2.5rem;
height: 2.5rem; height: 2.5rem;
} }
.nameAndDate { .nameAndDate {
margin-left: 0.5rem; margin-left: 0.5rem;
margin-top: auto; margin-top: auto;
margin-bottom: auto; margin-bottom: auto;
} }
.authorName { .authorName {
color: var(--veryDarkGrayishBlue) color: var(--veryDarkGrayishBlue)
} }
.articleDate { .articleDate {
margin-top: 0.3rem; margin-top: 0.3rem;
color: var(--desaturatedDarkBlue); color: var(--desaturatedDarkBlue);
} }
.articleShareIcon { .articleShareIcon {
width: 20px; width: 20px;
height: 20px; height: 20px;
@ -99,7 +121,6 @@ body {
@media screen and (min-width: 500px) { @media screen and (min-width: 500px) {
body { body {
/* flex-direction: row; */
align-content: center; align-content: center;
align-items: center; align-items: center;
} }
@ -107,12 +128,22 @@ body {
.articlePreview { .articlePreview {
flex-direction: row; flex-direction: row;
width: 50%; width: 50%;
} }
.previewImage { .previewImage {
width: 40%; width: 100%;
object-fit: cover;
border-radius: var(--cornerRadius) 0 0 var(--cornerRadius); border-radius: var(--cornerRadius) 0 0 var(--cornerRadius);
} }
/*
* sketch: 285x280
* at present: 237x269
* 201x290 using it as a background image
*/
.previewImage > img {
height: 105%;
object-fit: cover;
object-position: left;
/* margin-bottom: 10%; */
}
} }

View File

@ -20,7 +20,9 @@
<div class="container"> <div class="container">
<div class="articlePreview"> <div class="articlePreview">
<img src="./images/drawers.jpg" alt="Green drawers with a vase and pictures" class="previewImage"> <div class="previewImage">
<img src="./images/drawers.jpg" alt="Green drawers with a vase and pictures" class="">
</div>
<div class="previewBody"> <div class="previewBody">
<div class="articleSummary"> <div class="articleSummary">
<h1 class="articleTitle"> <h1 class="articleTitle">