Where to insert overflow:x? - html

I have a grey background rectangle upon which I've to position elements with position: relative, the rectangle should go out of the page and I'd have to ue overflow-x: hidden, but the problem is that when I use it it messes up all the page. Where should I place overflow-x without messing up all the page? Should I change the HTML?
I tried to place it in main or to wrap the div inside another div use the wrapper for overflow-x, but it still messes up all the page!
body {margin: 0px;
padding: 0px;
font-size: 16px;}
.under-bg_blue-big {float: right;
height: 690px;
width: 690px;
background-image: url(../img/bg-intro-desktop.svg);}
.list {position: relative;
float: right;
color: white;
z-index: 5;
margin-top: 36px;
margin-right: 0px;
padding-left: 0px;}
nav > ul > li {list-style: none;
display: inline;
position: relative;
z-index: 5;}
.under-bg_white-btn {margin-right: 16px;
font-size: 12px;}
.under-bg_green-btn {background-color: #06d89b;
padding: 8px 21px;
border-radius: 5px;
margin-right: 24px;
font-size: 12px;}
.logo {float: left;
width: 180px;
margin-top: 4.58%;
margin-left: 8.19%;
position: relative;
z-index: 1;
margin-bottom: 170px;
clear: both;}
.block-hero {text-align: center;}
.block-hero__hero {float: right;
position: relative;
top: 190px;
right: -50px;}
.section-a {padding-top: 284px;
margin-left: 8.19%;}
.section-a__heading {width: 34.375%;
font-size: 40px;}
.section-a__par {width: 35.28%;}
.section-a__btn {padding: 27px 90px;
background-color: #06d79d;
border: none;
border-radius: 5px;
color: white;}
.under-bg_grey {background-color: #fafafa;
height: 744px;
width: 150%;
margin-top: 30%;
position: relative;
left: -50px;
clip-path: inset(0% 0% 0% 0% round 100px);
font-size: 14px;
z-index: 0;
transform: rotate(15.589deg);
clear: both;}
<main>
<section class="section-a">
<h1 class="section-a__heading">All your files in one secure location, accessible anywhere.</h1>
<p class="section-a__par">Fylo stores all your most important files in one secure location. Access them wherever you need, share and collaborate with friends, family and co-workers.</p>
<button type="button" name="button" class="section-a__btn">Get
Started</button>
</section>
<div class="under-bg_grey"></div>
</main>

If you want the div with the class 'under-bg_grey' as a background for other elements you can change the styles for the particular element as follows.
.under-bg_grey {
background-color: #fafafa;
height: 744px;
width: 150%;
margin-top: -25%;
position: relative;
left: -50px;
clip-path: inset(0% 0% 0% 0% round 100px);
font-size: 14px;
z-index: -1;
transform: rotate(15.589deg);
clear: both;
}
Think so there would not be any need for overflow-x property.
I hope the above provides what you needed :)

add this code..
css
main{
overflow-x:hidden;
}
.under-bg_grey {
background-color: #fafafa;
height: 744px;
width: 100%;
margin-top: 30%;
position: relative;
left: -50px;
clip-path: inset(0% 0% 0% 0% round 100px);
font-size: 14px;
z-index: 0;
transform: rotate(15.589deg);
clear: both;
}

Adding overflow-x: hidden to the main element should do the trick.
As in:
main {
overflow-x: hidden;
}
Here's the working demo:
body {
margin: 0px;
padding: 0px;
font-size: 16px;
}
main {
overflow-x: hidden;
}
.under-bg_blue-big {
float: right;
height: 690px;
width: 690px;
background-image: url(../img/bg-intro-desktop.svg);
}
.list {
position: relative;
float: right;
color: white;
z-index: 5;
margin-top: 36px;
margin-right: 0px;
padding-left: 0px;
}
nav>ul>li {
list-style: none;
display: inline;
position: relative;
z-index: 5;
}
.under-bg_white-btn {
margin-right: 16px;
font-size: 12px;
}
.under-bg_green-btn {
background-color: #06d89b;
padding: 8px 21px;
border-radius: 5px;
margin-right: 24px;
font-size: 12px;
}
.logo {
float: left;
width: 180px;
margin-top: 4.58%;
margin-left: 8.19%;
position: relative;
z-index: 1;
margin-bottom: 170px;
clear: both;
}
.block-hero {
text-align: center;
}
.block-hero__hero {
float: right;
position: relative;
top: 190px;
right: -50px;
}
.section-a {
padding-top: 284px;
margin-left: 8.19%;
}
.section-a__heading {
width: 34.375%;
font-size: 40px;
}
.section-a__par {
width: 35.28%;
}
.section-a__btn {
padding: 27px 90px;
background-color: #06d79d;
border: none;
border-radius: 5px;
color: white;
}
.under-bg_grey {
background-color: #fafafa;
height: 744px;
width: 150%;
margin-top: 30%;
position: relative;
left: -50px;
clip-path: inset(0% 0% 0% 0% round 100px);
font-size: 14px;
z-index: 0;
transform: rotate(15.589deg);
clear: both;
}
<main>
<section class="section-a">
<h1 class="section-a__heading">All your files in one secure location, accessible anywhere.</h1>
<p class="section-a__par">Fylo stores all your most important files in one secure location. Access them wherever you need, share and collaborate with friends, family and co-workers.</p>
<button type="button" name="button" class="section-a__btn">Get
Started</button>
</section>
<div class="under-bg_grey"></div>
</main>

take one div with class name name grey_box and next put your div which has class name under-bg_grey inside it. Take .grey_box div width 100% and overflow-x:hidden. I think this code will help you,
<style>
.grey_box{
width:100%;
overflow-x:hidden;
}
</style>
<body>
<div class="grey_box">
<div class="under-bg_grey"></div>
</div>
</body>

Related

How do I remove invisible space around text (Heading)?

So as the title say I put a color on top of an image and I then tried to put some text on top of it, but then all the div got moved to the bottom and the text got moved to the top of the div and when I inspect the heading, it shows a space colored in yellow. I'm trying to understand CSS position and I'm starting to understand it, but right now I don't understand haha. I think it's something with a margin, but I reinitialized it at the beginning of the CSS.
(Also sorry! If you feel the need to tell me that my CSS is bad don't hesitate to tell me off i want to learn from my mistake!)
The HTML
<div id="section3">
<div id="layer">
<h1>Parmi les premiers de classe !</h1>
</div>
</div>
And CSS
#section3 img {
width: 1903px;
margin-left: 0px;
margin-top: -645px;
z-index: 100;
}
#section3 h1 {
margin-top: 260px;
margin-left: 420px;
font-size: 80px;
}
#section3 p {
margin-top: 10px;
margin-left: 590px;
font-size: 30px;
}
.img4{
position: relative;
top: 641px;
}
#section3{
background: url('../Images/CF3.jpg');
position: relative;
bottom:4px;
width: 1903px;
height: 930px;
}
#layer{
background-color: #4c96eb75;
width: 100%;
height: 100%;
}
#layer h1{
display: block;
}
The reset at the start of CSS
* {
margin: 0;
padding: 0;
font-family: Segoe UI;
}
You used up higher values of height and width that's why it happened. I changed that:
#section3 h1 {
/* margin-top: 260px;
margin-left: 420px; */
font-size: 80px;
}
#section3 p {
margin-top: 10px;
margin-left: 590px;
font-size: 30px;
}
.img4{
position: relative;
top: 641px;
}
#section3{
background: url('../Images/CF3.jpg');
position: relative;
bottom:4px;
width: 390px;
height: 300px;
}
#layer{
background-color: #4c96eb75;
width: 100%;
height: 100%;
}
#layer h1{
display: block;
margin: 0;
}
<div id="section3">
<div id="layer">
<h1>Parmi les premiers de classe !</h1>
</div>
</div>
Change the css to this:
#section3 img {
width: 1903px;
margin-left: 0px;
margin-top: -645px;
z-index: 100;
}
#section3 h1 {
/* margin-top: 260px;
margin-left: 420px; */
font-size: 80px;
}
#section3 p {
margin-top: 10px;
margin-left: 590px;
font-size: 30px;
}
.img4{
position: relative;
top: 641px;
}
#section3{
background: url('../Images/CF3.jpg');
position: relative;
bottom:4px;
width: 1903px;
height: 930px;
}
#layer{
background-color: #4c96eb75;
width: 100%;
height: 100%;
}
#layer h1{
display: block;
margin: 0;
}
I have added a margin:0, to the header and removed other styles margin for #section3 h1, that was the reason div was placed at the bottom and

struggling with exact calculation of heights and margins

I'm currently working on a website where I work with perfect squares and rectangles. These need to perfectly fit on mobile devices and laptop screens, tablets and so on. Therefore I want exactly now and be in control how much space every element is taking.
My problem: it goes about the light blue color, these div is taking 50% of the width and a height of 100%. Next I set the purple div to a height of 60% with a margin on top of 10% (so 70%), then I have the green div with a height of 30% which will bring the total to 100%. As you see in the example it isn't taking 100% but more than that.
I've red that the margin is calculated from the parent div (so the light-blue div I suppose), so I need to change my way of thinking-calculating I suppose but don't know how. Someone who can help me out?
.toegelatenDagWeek {
float: left;
background-color: yellow;
}
.verhoudingTijd {
float: right;
background-color: red;
}
.extraTijdDagWeek {
float: right;
background-color: silver;
}
.square-box{
position: relative;
width: 50%;
overflow: hidden;
}
.square-box:before{
content: "";
display: block;
padding-top: 50%;
}
.square-content{
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
color: white;
text-align: center;
margin: 1%;
}
.vierkanttt{
width: 35%;
float:left;
text-align:center;
margin-left: 37.5%;
margin-right: 37.5%;
margin-top: 1%;
margin-bottom: 2%;
position: relative;
}
.vierkanttt-marges {
flex: 1;
margin: 1px 1px 1px 1px;
position: relative;
}
.inputTimeSmall {
background-color: #b721ff;
border: none;
border-radius: 0.5em;
padding: 15% 0% 20% 0%;
width:100%;
text-align:center;
font-size:0.8em;
}
input {
color: white;
}
.inputTimeSmall::placeholder {
color: white;
}
.inputTime:focus {
outline: none;
}
.inputTime {
background-color: #b721ff;
border: none;
border-radius: 0.5em;
padding: 15% 0% 20% 0%;
width:100%;
text-align:center;
font-size:4em;
color: white;
}
.gespeeldeTijdTitel {
color: white;
width: 100%;
padding-left: 5%;
float: left;
text-align: left;
text-decoration-line: underline;
//background: purple;
font-size: 1.5em;
padding-bottom: 3%;
padding-top: 3%;
background-color: blue;
}
.toegelatenTijdTitel {
background: blue;
height: 30%;
width: 100%;
position: relative;
}
.toegelatenTijdTitel div {
position: absolute;
top: 50%;
color: white;
text-decoration-line: underline;
transform: translateY(-50%);
margin-left: 5%;
font-size: 1.5em;
}
.testje {
width: 100%;
height: 70%;
background-color: black;
}
.spaceInputTimeSmall {
background-color: #21d4fd;
border-radius: 0.5em;
float:left;
width: 50%;
height: 100%;
}
.inputTimeMini {
width: 80%;
background-color: #b721ff;
font-size:2em;
height: 60%;
margin-top: 10%;
margin-left: 10%;
margin-right: 10%;
border-radius: 0.5em;
display: table;
}
.textBoxSmall {
height: 30%;
width: 80%;
background-color: green;
margin: 00% 10% 0% 10%;
vertical-align: center;
display: table;
}
.centerText {
display: table-cell;
text-align: center;
vertical-align: middle;
}
.boxtienprocent {
background-color: grey;
}
#container {
width: 90%;
height: 90%;
margin: 5%;
position: relative;
color: white;
}
<div class="square-box toegelatenDagWeek">
<div class='square-content '>
<div class="toegelatenTijdTitel">
<div>
toegelaten tijd
</div>
</div>
<div class="testje">
<div class="spaceInputTimeSmall">
<div class="boxtienprocent"></div>
<!--<input type="text" class="inputTimeSmall" id="inputHoursMaandag" name="maandagUren" placeholder="00" maxlength="3">-->
<div class="inputTimeMini" name="uren" id="DisplayToegelatenHours" ><div class="centerText">05</div></div>
<div class="textBoxSmall"><div class="centerText">uren</div></div>
</div>
<div class="spaceInputTimeSmall">
<!--<input type="text" class="inputTimeSmall" id="inputMinutesMaandag" name="maandagMinuten" placeholder="00" maxlength="2">-->
<div class="inputTimeMini" name="uren" id="DisplayToegelatenMinutes" ><div class="centerText">05</div></div>
<div class="textBoxSmall"><div class="centerText">minuten</div></div>
</div>
</div>
</div>
</div>
Instead of margins, you need to use padding, because padding is the space between the content and the border, meanwhile margin is the space outside the border. In your example, you used margins, so it pushed the rectangular outside.

Overflow:hidden - is there any way to make a specific child visible?

I need the grey half-circle to include the quote so that it will be the correct height, but I also need that line to be able to overflow from it's containers.
.CONTAINER {
width: 70%;
position: relative;
margin-left: 15%;
margin-right: 15%;
margin-top: 25%;
margin-bottom: -10px;
overflow: hidden;
}
.halfCircle {
max-width: 100%;
background: darkgray;
border-top-left-radius: 100%;
border-top-right-radius: 100%;
border-bottom: 0;
text-align: center;
overflow: visible;
margin-bottom: -10px;
}
#QUOTE22 {
text-align: center;
margin-top: -32px;
font-size: 1.3em;
letter-spacing: 2px;
font-weight: 30;
}
#PLogo {
position: relative;
margin-left: auto;
margin-right: auto;
height: 200px;
width: 200px;
}
#FrontQuote {
height: 1.3em;
width: 1.3em;
position: relative;
right: -5px;
}
#QUOTE {
text-align: center;
line-height: 100%;
letter-spacing: 1px;
font-size: 1.3em;
}
#QUOTE12 {
text-align: center;
line-height: 100%;
letter-spacing: 0px;
font-size: 1.3em;
margin-top: 10px;
z-index: 100;
overflow: visible;
}
#BackQuote {
height: 1.7em;
width: 1.7em;
transform: rotate(180deg);
z-index: 100;
overflow: visible;
}
#stock1 {
position: absolute;
margin-top: -52.5px;
margin-left: -8px;
width: 101.5vw;
height: auto;
max-height: 500px;
filter: grayscale(1);
opacity: .5;
background: #121212;
z-index: -1;
}
<div class="CONTAINER">
<div class="halfCircle">
<img id="PLogo" src="https://static.wixstatic.com/media/058e45_e590acfd22c440f4b5c89450738f321d~mv2.png/v1/fill/w_438,h_438,al_c,q_85,usm_0.66_1.00_0.01/058e45_e590acfd22c440f4b5c89450738f321d~mv2.webp">
<p id="QUOTE12"><img id="FrontQuote" src="https://static.wixstatic.com/media/058e45_df55c46642a94f489cf76fa18cc13cb8~mv2.png/v1/fill/w_50,h_50,al_c,q_85,usm_0.66_1.00_0.01/Logo%20Quotes.webp"> WHAT WE LEARN WITH PLEASURE, WE NEVER FORGET
<sub><sub><img id="BackQuote" src="https://static.wixstatic.com/media/058e45_df55c46642a94f489cf76fa18cc13cb8~mv2.png/v1/fill/w_50,h_50,al_c,q_85,usm_0.66_1.00_0.01/Logo%20Quotes.webp"></sub></sub>
</p>
</div>
</div>
</section>
<section id="SKILLS">
<p id="QUOTE22">- ALFRED MERCIER</p>
<img id="stock1" src="https://media.istockphoto.com/photos/graphic-designer-drawing-on-graphics-tablet-at-workplace-picture-id865230556">
Some additional information, since the bot says I need more words:
I read on another post that someone suggested having a container around the half circle and have that be overflow:hidden so that the child of the child wouldn't be effected, but that hasn't worked for me below.
I'd prefer HTML or CSS answers only, since that's all I know at the moment... but if there's no other way, I'll try other languages.
It's going to be difficult for me to adjust position too much, but I read another comment somewhere that position might be an issue, so I tried to take position tags off of as many elements as I could.
position:relative; should bring it on top. You may add a z-index value if that is not efficient.
example
.CONTAINER {
width: 70%;
position: relative;
margin-left: 15%;
margin-right: 15%;
margin-top: 25%;
margin-bottom: -10px;
overflow: hidden;
}
.halfCircle {
max-width: 100%;
background: darkgray;
border-top-left-radius: 100%;
border-top-right-radius: 100%;
border-bottom: 0;
text-align: center;
overflow: visible;
margin-bottom: -10px;
}
#QUOTE22 {
text-align: center;
margin-top: -1em;
font-size: 1.3em;
letter-spacing: 2px;
font-weight: 30;
position:relative;/* added <====== */
}
#PLogo {
position: relative;
margin-left: auto;
margin-right: auto;
height: 200px;
width: 200px;
}
#FrontQuote {
height: 1.3em;
width: 1.3em;
position: relative;
right: -5px;
}
#QUOTE {
text-align: center;
line-height: 100%;
letter-spacing: 1px;
font-size: 1.3em;
}
#QUOTE12 {
text-align: center;
line-height: 100%;
letter-spacing: 0px;
font-size: 1.3em;
margin-top: 10px;
z-index: 100;
overflow: visible;
}
#BackQuote {
height: 1.7em;
width: 1.7em;
transform: rotate(180deg);
z-index: 100;
overflow: visible;
}
#stock1 {
position: absolute;
margin-top: -52.5px;
margin-left: -8px;
width: 101.5vw;
height: auto;
max-height: 500px;
filter: grayscale(1);
opacity: .5;
background: #121212;
z-index: -1;
}
<div class="CONTAINER">
<div class="halfCircle">
<img id="PLogo" src="https://static.wixstatic.com/media/058e45_e590acfd22c440f4b5c89450738f321d~mv2.png/v1/fill/w_438,h_438,al_c,q_85,usm_0.66_1.00_0.01/058e45_e590acfd22c440f4b5c89450738f321d~mv2.webp">
<p id="QUOTE12"><img id="FrontQuote" src="https://static.wixstatic.com/media/058e45_df55c46642a94f489cf76fa18cc13cb8~mv2.png/v1/fill/w_50,h_50,al_c,q_85,usm_0.66_1.00_0.01/Logo%20Quotes.webp"> WHAT WE LEARN WITH PLEASURE, WE NEVER FORGET
<sub><sub><img id="BackQuote" src="https://static.wixstatic.com/media/058e45_df55c46642a94f489cf76fa18cc13cb8~mv2.png/v1/fill/w_50,h_50,al_c,q_85,usm_0.66_1.00_0.01/Logo%20Quotes.webp"></sub></sub>
</p>
</div>
</div>
</section>
<section id="SKILLS">
<p id="QUOTE22">- ALFRED MERCIER</p>
<img id="stock1" src="https://media.istockphoto.com/photos/graphic-designer-drawing-on-graphics-tablet-at-workplace-picture-id865230556">

Customized strikethrough on title

I'm creating a website to school project and i want to put a strikethrough behind my title like in this image. I want that green lines behind text
I am working with HTML and CSS , someone know the code to get that beautiful strikethrough?
Short example including overlaying both strikes should be
p {font-size: 130px; color: #f00;}
span {position: relative;}
span:before, span:after {content: ''; background: rgba(0,0,0,.5); border-radius: 20px; position: absolute; top: calc(50% - 20px); width: 56%; height: 40px; z-index: -1}
span:before {left: 0;}
span:after {right: 0;}
span.left:before {width: 100%;}
span.left:after {width: 100px; left: 0;}
span.longer:before {width: 60%; left: 8%}
span.longer:after {width: 43%; left: 47%;}
<p>
<span>TEXT</span> <br>
<span>WITH</span> <br>
<span>STRIKE</span><br>
<span class="left">LEFT</span>
<span class="longer">OTHER</span>
</p>
Using classes you can make overlays with different widths, etc. The basic idea is obvious.
This is an example , adjust as you wish, but you get the idea.
h2 {
font: 33px sans-serif;
margin-top: 30px;
text-align: center;
text-transform: uppercase;
color: red;
}
h2.background {
position: relative;
z-index: 1;
}
h2.background:before {
border-top: 2px solid #000;
content:"";
margin: 0 auto; /* this centers the line to the full width specified */
position: absolute; /* positioning must be absolute here, and relative positioning must be applied to the parent */
top: 50%; left: 0; right: 0; bottom: 0;
width: 95%;
z-index: -1;
}
<h2 class="background">Random Title</h2>
I did it (Image example) but when i change resolution this happen: not responsive... How can i put it to be responsive? here is my HTML and here is my CSS... Thank you for all resolution but i'm using panther's example
#titulo1{
font-size: 5vw;
font-weight: 400;
color:#f5dc9f;
font-family: 'Moon Light' , sans-serif;
float: right;
margin-bottom: 0;
margin-top: 15vw;
margin-right: 15vw;
display: flex;
}
#titulo2{
color: #f5dc9f;
font-size:6.7vw;
font-family: 'Moon Bold', sans-serif;
clear: right;
float: right;
margin-top: 0;
margin-bottom: 0;
margin-right: 13vw;
}
#titulo3{
font-size: 4.8vw;
font-weight: 400;
color:#f5dc9f;
font-family: 'Moon Light' , sans-serif;
float: right;
margin-top: 0;
margin-right: 3vw;
}
#titulo2:before, #titulo2:after {
content: '';
background: rgba(0,0,255,0.3);;
border-radius: 40px;
position: absolute;
top: calc(53% - 1vw);
width: 50%;
height: 5%;
z-index: -1
}
#titulo2:before{
left: 54vw;
width: 15vw;
}
#titulo2:after{
right: 11vw;
width: 26vw;
}
#titulo1:before, #titulo1:after {
content: '';
background: rgba(0,0,255,0.3);;
border-radius: 40px;
position: absolute;
top: calc(40% - 20px);
width: 50%;
height: 5%;
z-index: -1
}
#titulo1:before{
left: 52vw;
width: 17vw;
height: 2vw;
}
#titulo1:after{
right: 15vw;
width: 20vw;
height: 2vw;
}
#titulo3:before, #titulo3:after {
content: '';
background: rgba(0,0,255,0.3);;
border-radius: 40px;
position: absolute;
top: calc(66% - 20px);
width: 50%;
height: 5%;
z-index: -1
}
#titulo3:before{
width: 3em;
height: 0.4em;
}
#titulo3:after{
right: 0.5em;
width: 9em;
height: 0.4em;
}
<h2 id="titulo1">Aqui vai ser</h2><br>
<h1 id="titulo2">o titulo</h1><br>
<h2 id="titulo3">do nosso trabalho!</h2><br>
here is the snippet but is very diferent from what i see on my browser

Website on different resolutions

I have a problem with my website. It looks great on my 20" screen but on the 11" it does not. The #logo is covering #menu and the #bubble appears beneath the #frame. As you see in the code, I have set up precentage size parameters because I found such a solution in a tutorial. It worked for many elements but not for all. What is the problem?
I believe this may be something to do with the #bubble height and width because it is still in ems. When I tried doing it with percentages, I lost the circular shape and the #bubble went to the bottom of the page often.
HTML:
<body>
<div id="top">
<div>
<p id="logo">XXXXXXXXXXX</p>
<div id="menu">
<h3 id="test">xxxxxx</h3>
<h3 id="test2">xxxxxx</h3>
<h3 id="test3">xxxxxx</h3>
<h3 id="test4">xxxxx</h3>
<h3 id="test5">xxxxxx</h3>
</div>
</div>
</div>
<div id="frame">
<div id="main"></div>
</div>
</body>
CSS
body {
width: 100%;
margin-top: 0%;
margin-left: 0%;
margin-right: 0%;
background-image: url("http://www.wallpapersmood.com/uploads/2010-07/july-high-defintion-wallpaper/1280109101-FWEMRDA.jpg");
}
#top {
background-color: black;
width: 100%;
height: 50px;
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
}
#logo {
text-align: center;
position: absolute;
margin-top: 0.5%;
margin-left: 2%;
color: white;
font-family: Impact,cursive;
font-size: 160%;
}
h3 {
width: 10%;
height: 10%;
border-radius: 9px;
text-align: center;
line-height: 2;
display: table-cell;
font-size: 120%;
font-family: "Verdana";
color: white;
}
h3:hover {
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.35, rgb(60,156,196)),
color-stop(0.68, rgb(90,188,236)),
color-stop(0.84, rgb(117,226,255)));
opacity: 1;
}
#menu {
float: left;
width: auto;
height: auto;
margin-left: 20%;
margin-top: 0.5%;
}
#frame {
width: 78%;
height: 90%;
border: 1px solid;
border-radius: 20px;
margin-left: auto ;
margin-right: 5%;
margin-top: 1%;
background-color: white;
opacity: 0.9;
float: right;
}
#main {
height: 90%;
width: 80%;
border: 1px solid black;
border-radius:15px;
float: right;
margin-right: 2%;
margin-top: 2%;
margin-bottom: 2%;
background-color: white;
overflow: auto;
}
#main img {
max-width: 60%;
max-height: auto;
margin: auto;
margin-top: 2%;
display: block;
border-radius: 15px;
}
#bubble {
position: absolute;
height: 14em;
width: 14em;
border: 6px dashed white;
text-align: center;
border-radius: 100%;
margin-left: 1%;
margin-top: 1%;
opacity: 0.6
}
#bubble p {
position: relative;
top: 20%;
font-size: 200%;
color: white;
font-family: "Impact";
}
You can use CSS #media queries to apply different styles for different screen sizes.
Read here.
Basically it's like if statements.. "if the window size is more than 500px" apply a certain set of CSS rules.. "if the window size is less than 500px and more than 300px" apply another set of rules etc..