Border-Radius & Overflow: Hidden - css

I seem to be having a weird problem when using border-radius and overflow: hidden together, please see the picture for my problem.
As you can see in the bottom right the image doesn't expand to the very edge of the div and a little curve is visible, any help will be much appreciated.
I also have a live version here, problem can be seen near the bottom of the page: http://hasky.infinityfreeapp.com/
Image
.content__card {
position: relative;
margin: 1em 0;
width: 80em;
max-width: 80%;
min-height: 35em;
border-radius: 0.8em;
display: flex;
flex-flow: row wrap;
justify-content: space-between;
align-items: center;
overflow: hidden;
border: none;
}
.content__card .info {
text-align: left;
margin: 1.5em 3em;
height: auto;
}
.content__card .info h2 {
font-family: "DemiBold", sans-serif;
}
.content__card .info p {
font-size: clamp(1rem, 2vw, 1.4rem);
font-family: "Medium", sans-serif;
margin: 1.5em 0;
}
.content__card a {
position: absolute;
bottom: 2em;
border-radius: 0.8em;
background: #fff;
color: #111;
text-decoration: none;
font-weight: 700;
z-index: 3;
padding: 0.6em 1.8em;
font-size: clamp(1rem, 3vw, 1.4rem);
font-family: "Medium", sans-serif;
}
.content__card img {
position: absolute;
right: 0;
bottom: 0;
width: 30em;
}
.content__card__three {
background: #7D44FD;
color: #fff;
}
<div class="content__card content__card__three span-2">
<div class="info">
<h2>Sekite mūsu</h2>
<h2>Youtube kanalą!</h2>
Youtube
</div>
<img src="https://i.imgur.com/5ZXj6fP.png">
</div>

I'm not sure what your problem is exactly, but this is the solution I can provide depending on what I understood.
added the basic styling and also remove some unnecessary code.
*,
*::before,
*::after {
padding: 0;
margin: 0;
box-sizing: border-box;
}
body {
background: #000;
}
.content__card {
position: relative;
margin: 1em 0;
max-width: 90%;
min-height: 35em;
border-radius: 0.8em;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
overflow: hidden;
}
.content__card .info {
text-align: left;
margin: 1.5em 3em;
width: 20rem;
}
.content__card .info h2 {
font-family: "DemiBold", sans-serif;
}
.content__card .info p {
font-size: clamp(1rem, 2vw, 1.4rem);
font-family: "Medium", sans-serif;
margin: 1.5em 0;
}
.content__card a {
position: absolute;
bottom: 2em;
border-radius: 0.8em;
background: #fff;
color: #111;
text-decoration: none;
font-weight: 700;
z-index: 3;
padding: 0.6em 1.8em;
font-size: clamp(1rem, 3vw, 1.4rem);
font-family: "Medium", sans-serif;
}
.content__card img {
position: absolute;
right: 0;
bottom: 0;
width: 30em;
}
.content__card__three {
background: #7d44fd;
color: #fff;
}
<div class="content__card content__card__three span-2">
<div class="info">
<h2>Sekite mūsu</h2>
<h2>Youtube kanalą!</h2>
Youtube
</div>
<img src="https://i.imgur.com/5ZXj6fP.png">
</div>

Related

Make SVG Mobile Responsive

I came across this amazing looking 404 error page https://codepen.io/dsenneff/pen/mjZgmN
I followed the tutorial here to make the SVG mobile responsive but I couldn't get it to work.
Any hint you can provide would highly be appreciated.
Thanks
CSS
#import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,900");
body,
html {
margin: 0;
padding: 0;
font-size: 16px;
-webkit-font-smoothing: antialiased;
background-color: #09334f;
position: relative;
}
#yetiSVG {
position: absolute;
top: 0;
left: 0;
overflow: hidden;
display: inline-block;
}
#lightSVG {
position: absolute;
top: -24rem;
left: 0;
overflow: visible;
display: inline-block;
}
.content {
padding: 5rem 3rem 0 25rem;
position: relative;
z-index: 10;
font-family: "Source Sans Pro", sans-serif;
color: #fff;
}
.content h3 {
margin: 0 0 0.8rem;
font-size: 2.625rem;
font-weight: 900;
line-height: 120%;
}
.content p {
font-size: 1.25rem;
font-weight: normal;
line-height: 150%;
color: #d1e2ed;
}
.content p span {
text-decoration: line-through;
}
svg {
max-width: 100%;
}
.svg-container {
display: inline-block;
position: relative;
width: 100%;
height: 100%;
padding-bottom: 100%;
/* vertical-align: middle; */
/* overflow: hidden; */
}

LESS Parse Error, but I can't find the issue

I need a 2nd pair of eyes. LESS keeps giving me a parse error, but I can't find it. I've broken the code down in sections and have removed/added things line-by-line with no luck. I've inherited this code from another teamj.
I suspect that they were using an older version of LESS, but they gave me no docs.
Any and all help is appreciated!
.panel-cards {
overflow-y: visible;
overflow-x: hidden;
.deck {
display: flex;
overflow: visible;
overflow-x: scroll;
//-webkit-overflow-scrolling: touch; //conflict with modal popups (and unnecessary?)
&:after {
content: '';
width: 1px;
height: 100px;
display: block;
flex-shrink: 0;
}
}
article {
flex-shrink: 0;
display: flex;
flex-direction: column;
width: unit(294/4.14,vw);
margin: 0 unit(15/4.14,vw) unit(30/4.14,vw) unit(15/4.14,vw);
.image {
background-position: center center;
background-size: cover;
background-repeat: no-repeat;
.box-sizing(border-box);
padding-top: 71%;
overflow: hidden;
max-width: 100%;
&.contain {
background-size: contain;
}
}
.copy {
.box-sizing(border-box);
.copy {
span {
width: 100%;
float: left;
p{
margin: 0px 0px 8px 0px;
line-height: 120%;
font-family: 'Roboto', Helvetica, Arial, sans-serif;
font-weight: 600;
text-align: left;
vertical-align: baseline;
}
}
h3 + p {
margin-top: 0;
}
p {
margin: unit(18/4.14,vw) 0;
font-weight: #medium;
line-height: 117%;
}
a:not(.btn) {
color: #green;
font-weight: #bold;
&:hover {
color: #green;
}
}
}
}
} //end panel-cards
Correct these: font-weight: #medium;
color: #green;
font-weight: #bold;
color: #green; and also, "}" has a mismatch between open and closes.
Is this what you're looking for?
.panel-cards {
overflow-y: visible;
overflow-x: hidden;
}
.panel-cards .deck {
display: flex;
overflow: visible;
overflow-x: scroll;
}
.panel-cards .deck:after {
content: '';
width: 1px;
height: 100px;
display: block;
flex-shrink: 0;
}
.panel-cards article {
flex-shrink: 0;
display: flex;
flex-direction: column;
width: 71.01449275vw;
margin: 0 3.62318841vw 7.24637681vw 3.62318841vw;
}
.panel-cards article .image {
background-position: center center;
background-size: cover;
background-repeat: no-repeat;
box-sizing: border-box;
padding-top: 71%;
overflow: hidden;
max-width: 100%;
}
.panel-cards article .image.contain {
background-size: contain;
}
.panel-cards article .copy {
box-sizing: border-box;
}
.panel-cards article .copy .copy span {
width: 100%;
float: left;
}
.panel-cards article .copy .copy span p {
margin: 0px 0px 8px 0px;
line-height: 120%;
font-family: 'Roboto', Helvetica, Arial, sans-serif;
font-weight: 600;
text-align: left;
vertical-align: baseline;
}
.panel-cards article .copy .copy h3 + p {
margin-top: 0;
}
.panel-cards article .copy .copy p {
margin: 4.34782609vw 0;
font-weight: medium;
line-height: 117%;
}
.panel-cards article .copy .copy a:not(.btn) {
color: green;
font-weight: bold;
}
.panel-cards article .copy .copy a:not(.btn):hover {
color: green;
}

Why these CSS rules are not applied

I was trying to make this parallax-website. In the CSS I am defining properties for .image1 . So I wrote down properties and then just below it I again wrote some properties for the same class .image1. But only the ~ opacity, position (from 1st) and other properties defined (from 2 time) were applied. I checked the it using Inspect Element and all other properties were cut down. I am not able to understand why this is happening. Please help me.
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html,
body {
height: 100%;
font-family: 'Lato', sans-serif;
font-weight: 400;
line-height: 1.8em;
color: #666;
}
.image1 {
position: relative;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-attachment: fixed;
opacity: 0.70;
}
.image1 {
background: url('https://jolly-kalam-23776e.netlify.app/parallaxsite/img/image1.jpg');
min-height: 100%;
}
.text-box-image1 {
position: absolute;
/* To bring that box in center */
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.text-image1 {
font-size: 27px;
letter-spacing: 8px;
color: white;
background-color: #111;
padding: 20px;
}
.section-one {
padding: 50px 80px;
}
.section-one .heading {
text-align: center;
letter-spacing: 1px;
margin: 20px;
}
p {
text-align: center;
font-size: 17px;
}
<div class="image1">
<div class="text-box-image1">
<span class="text-image1">PARALLAX WEBSITE</span>
</div>
</div>
I think you need to mention background image as "background-image". You are declaring background property individually. or you can write like that way :
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html,
body {
height: 100%;
font-family: 'Lato', sans-serif;
font-weight: 400;
line-height: 1.8em;
color: #666;
}
.image1 {
background: url('https://jolly-kalam-23776e.netlify.app/parallaxsite/img/image1.jpg') no-repeat fixed center center;
background-size: cover;
min-height: 100%;
opacity: 0.70;
position: relative;
}
.text-box-image1 {
position: absolute;
/* To bring that box in center */
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.text-image1 {
font-size: 27px;
letter-spacing: 8px;
color: white;
background-color: #111;
padding: 20px;
}
.section-one {
padding: 50px 80px;
}
.section-one .heading {
text-align: center;
letter-spacing: 1px;
margin: 20px;
}
p {
text-align: center;
font-size: 17px;
}
<div class="image1">
<div class="text-box-image1">
<span class="text-image1">PARALLAX WEBSITE</span>
</div>
</div>

Container applies properties preferentially to sections

I have the following code:
#import url('https://fonts.googleapis.com/css2?family=Raleway:wght#300;400;700;900&display=swap" rel="stylesheet');
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: 'Raleway', sans-serif;
text-align: center;
}
img {
max-width: 100%;
height: auto;
}
.container {
width: 95%;
max-width: 70em;
margin: 0 auto;
}
/* typography
================== */
h1 {
font-weight: 300;
font-size: 1.7rem;
margin-top: 0;
}
p {
margin-top: 0;
line-height: 1.5;
}
p:last-of-type {
margin-bottom: 0;
}
.title {
font-size: 2.5em;
margin-top: 1em;
margin-bottom: 1.5em;
font-weight: 900;
}
.title span {
font-weight: 300;
display: block;
font-size: .9em;
}
#media(min-width:60rem) {
p {
font-size: 1.2rem;
line-height: 1.6;
}
.title {
font-size: 3.7em;
margin-bottom: 1em;
margin-top: 0;
font-weight: 900;
}
}
/* buttons */
.button {
display: inline-block;
font-size: 1.15em;
text-decoration: none;
text-transform: uppercase;
border-width: 2px;
border-style: solid;
padding: .5em 1.75em;
color: #00ff6c;
border-color: #00ff6c;
}
#media (min-width: 60rem) {
.button {
font-size: 1.5rem;
}
.button-small {
font-size: .7rem;
font-weight: 700;
}
.button-accent {
color: #00ff6c;
border-color: #00ff6c;
}
.button-accent:hover,
.button-accent:focus {
background: #00ff6c;
color: #232323;
}
}
/* header
================== */
header {
position: absolute;
margin-top: 1em;
left: 0;
right: 0;
margin: 1em;
}
nav ul {
margin: 0;
padding: 0;
list-style: none;
}
nav li {
display: inline-block;
margin: 1em;
}
nav a {
font-weight: 900;
text-decoration: none;
padding: .5em;
text-transform: uppercase;
color: #FFF;
font-size: .8rem;
}
nav a: hover,
nav a: focus {
color: #DDD;
}
#media(min-width:60rem) {
.logo {
float: left;
}
nav {
float: right;
}
}
/* home-hero
================== */
.home-hero {
background-image: url(https://i.postimg.cc/XY54RwQY/hero-bg.jpg);
background-size: cover;
background-position: center;
padding: 10em 0;
color: #FFF;
}
#media (min-width: 60rem) {
.home-hero {
height: 100vh;
padding-top: 35vh;
}
}
/* hero-home
======================== */
.home-about-textbox {
background-color: #232323;
padding: 4em;
margin: 0 -2.5vw;
outline: 2px solid #00ff6c;
outline-offset: -2.5em;
color: #FFF;
position: relative;
}
.home-about-textbox h1 {
color: #00ff6c;
position: absolute;
left: 50%;
transform: translateX(-50%);
top: .75em;
background: #232323;
padding: 0 .145em;
white-space: nowrap;
}
.container {
width: 95%;
max-width: 70em;
margin: 0 auto;
background-color: mediumvioletred;
color: magenta;
}
#media (min-width: 25rem) {
h1 {
font-size: 2 rem;
}
.home-about-textbox h1 {
top: .6em;
padding: 0 .325em;
}
}
#media (min-width: 60rem) {
h1 {
font-size: 2.5rem;
}
.home-about {
background-image: url();
background-repeat: no-repeat;
padding-bottom: 10em;
}
.home-about-textbox {
width: 50%;
padding: 7em;
outline-offset: -3.75em;
margin-left: -2.5%;
top: -5em;
text-align: left;
box-shadow: 0 0 4em 0 rgba(0, 0, 0, .3);
}
.home-about-textbox h1 {
top: .75em;
left: 6rem;
position: absolute;
left: 50%;
transform: translateX(-50%);
top: .75em;
background: #232323;
padding: 0 .145em;
}
}
.container {
width: 95%;
max-width: 70em;
margin: 0 auto;
background-color: coral;
font-weight: 100;
color: blue;
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Creative Inc.</title>
<link rel="stylesheet" href="styles.css" type="text/css">
</head>
<body>
<header>
<img src="https://i.postimg.cc/NFtwcdYg/logo.png" alt="Creative inc. logo" class="logo">
<nav>
<ul>
<li>Home</li>
<li>About</li>
<li>Contact</li>
</ul>
</nav>
</header>
<section class="home-hero">
<div class="container">
<h1 class="title">Making things looks great
<span>for companies who make great stuff</span>
</h1>
See Our Work
</div>
</section>
<div class="container">
<section class="home-about">
<div class="home-about-textbox">
<h1>Who we are</h1>
<p>Sit by the fire drink water out of the faucet hide head under banket so no one can see cat is love, cat is life.Knock dish off table eating always hungry so favor packaging over toy.</p>
<p>
<srong>Rub face on owner.</srong>Peer out window, chatter at birds, lure then to mouth. Chase ball of string eat a plant, kill a hand, i am the best have secret plans.
</p>
</div>
</section>
</div>
</body>
</html>
There is a code snippet: https://codepen.io/danamaria5/pen/gOPZRPa .
Here the "container" class selector in css should select both sections "home-hero" & "home-about". As you can see in the snippet the colors apply just to the home-hero although the background of the home-about becomes coral in the pc media query. I can't figure out why is still black in the mobile format.
And the font-weight is applied just to the home-about. In home-hero, font weight property should be applied just to the bolder top part of the title as the lower one is selected with the .title span which is more specific than the .container. However, this is not the case because the "Making things looks great" text is still bold instead of font-weight: 100; from the container which is selected at the end of the style sheet so nothing else overrides it. Could someone, please explain?

Responsive Text Sizing Issues within container

I am having the hardest time here...I have searched for a while now and can't quite figure out how to properly get my text to properly re-size in my parent container.
Here is the code:
html,
body,
box,
thumbnail_image,
overlay,
h1,
h3,
h6,
p,
body {
width: 100%;
padding-bottom: 25px;
font-size: 100%;
}
input {
font-family: "Roboto";
position: absolute;
top;
25.5px;
font-weight: 700;
font-size: 14px;
color: #fff;
background-color: transparent;
text-align: right;
border-width: 0;
width: 100%;
margin: 0 0 .1em 0;
}
.heart_button {
position: absolute;
top: 25.5px;
right: 55px;
}
.heart_button:hover,
.heart_button:active,
.heart_button:focus {
color: #dd0239;
}
.heart_background {
position: absolute;
top: 20px;
right: 20px;
background-color: #000000;
opacity: .1;
width: 65px;
height: 30px;
border-radius: 15px;
}
.box {
margin: 50px auto;
position: relative;
max-width: 90%;
height: 490px;
width: 700px;
background-color: #18a0ff;
box-shadow: 1px 15px 50px 2px;
}
.quote_image {
position: absolute;
opacity: .1;
top: 62px;
left: 51px;
}
.image_overlay {
background-color: #282a37;
width: 170px;
height: 490px;
position: absolute;
float: left;
}
.thumbnail_image {
position: absolute;
float: left;
opacity: .12;
display: inline-block;
}
.text_container {
left: 200px;
width: 400px;
height: 338px;
max-width: 90%;
word-wrap: break-word;
position: absolute;
}
h1 {
color: #fff;
text-transform: uppercase;
font-size: 3.7em;
font-family: Montserrat;
font-weight: 700;
line-height: 1.3;
text-align: left;
width: 100%;
word-wrap: break-word;
}
.author_name {
position: absolute;
left: 206px;
bottom: 0px;
}
h3 {
font-family: Open Sans;
font-weight: 700;
letter-spacing: 1px;
text-transform: uppercase;
font-size: 1em;
text-align: left;
color: #fff;
}
p {
font-family: "Roboto";
font-weight: 700;
font-size: 14px;
color: #fff;
text-align: center;
}
h6 {
font-family: Open Sans;
font-weight: light;
font-size: 1em;
letter-spacing: 2px;
text-transform: uppercase;
text-align: center;
}
nav {
position: absolute;
left: 35px;
bottom: 28px;
}
html {
background: linear-gradient(209deg, #E5ECEF 40%, #BBC2C5 100%) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
#footer {
clear: both;
}
#media screen and (max-width: 649px) {
.box {
width: 450px;
height: 350px;
max-width: 90%;
}
h1 {
font-size: 2em;
word-wrap: break-word;
}
.text_container {
width: 280px;
height: 236.6px;
max-width: 90%;
}
}
<body>
<div class="box">
<div class="heart_button">
<img src="http://res.cloudinary.com/dp32vpqfu/image/upload/v1457311522/little_heart_jle1j3.png">
</div>
<div class="heart_background">
</div>
<div class="image_overlay">
</div>
<div class="thumbnail_image">
<img src="http://res.cloudinary.com/dp32vpqfu/image/upload/v1457298445/Sheldon_Pic_l3cprk.jpg">
</div>
<div class="text_container">
<h1>Don't You think that if I were wrong, I'd know it?</h1>
</div>
<div class="author_name">
<h3> - Sheldon Cooper </h3>
</div>
<div class="quote_image">
<img src="http://res.cloudinary.com/dp32vpqfu/image/upload/v1457314397/quotations_image_wfwimc.png">
</div>
<nav>
<img src="http://res.cloudinary.com/dp32vpqfu/image/upload/v1457364436/arrow-left_moebxn.png">
<img src="http://res.cloudinary.com/dp32vpqfu/image/upload/v1457364436/arrow-right_oilpij.png">
</nav>
</div>
</body>
So again, my thought was that I could have the .box class be a parent container and then the .text_container that would be nested could 're-size the text in a responsive manner in smaller viewports. But it's not...and my hair is going grey.
Errggghhhh...
child with the position absolute can't change the size or its parent or vice versa. Alternatively you can use the float property and set it to "right". Also, you might want to use % instead of pixels if you're aiming for a responsive design.
I guess what you need is http://freqdec.github.io/slabText/
font-size cannot do resize accroding to the windows's width, unless you define different font-size accroding to the width with Media Queries

Resources