I am trying to make the Card as i call it attached to the screen so when it is resized, the card will go along with it.
Css code:
#wrapper {
position: relative;
max-width: 1920px;
max-width: 100%;
padding-right: 10px;
padding-left: 10px;
}
#introduction-container {
position: relative;
}
#introduction-textposition {
position: absolute;
bottom: 100%;
left: 10%;
}
#introduction-paragraph {
width: 500px;
height: 150px;
background-color: rgba(18, 18, 18, 0.7);
padding: 40px 25px;
margin-top: 0;
}
html code
<div id="wrapper">
<div id="introduction-container">
<div id="introduction-textposition">
<div id="introduction-paragraph">
<h3>RTX 2080Ti Available Now!</h3>
<h1>RAY-TRACE</h1>
<p><span style="color: rgb(118, 185, 0);">NVIDIA RTX</span> is the most advanced platform for ray tracing and AI technologies that are revolutionizing the ways we play and create</p>
<div>
SHOP NOW!
</div>
</div>
</div>
</div>
ps: the introduction-textposition percentaged is me playing around with it, wont work tho.
problem is, when i used the relative position on #introduction-container it the properties wont show here;
html image
What it should look like: illustration
Try this (Open it in "full page" mode)
* {
box-sizing: border-box;
}
body {
margin: 0;
}
#wrapper {
position: relative;
max-width: 1920px;
max-width: 100%;
padding-right: 10px;
padding-left: 10px;
min-height: 100vh;
}
#introduction-paragraph {
width: 400px;
background-color: rgba(18, 18, 18, 0.7);
padding: 40px 25px;
margin-top: 0;
position: absolute;
bottom: 10%;
left: 10%;
}
<div id="wrapper">
<div id="introduction-paragraph">
<h3>RTX 2080Ti Available Now!</h3>
<h1>RAY-TRACE</h1>
<p><span style="color: rgb(118, 185, 0);">NVIDIA RTX</span> is the most advanced platform for ray tracing and AI technologies that are revolutionizing the ways we play and create</p>
<div>
SHOP NOW!
</div>
</div>
</div>
Let me help my bro, maybe my css can help you
#wrapper{
background-image: linear-gradient(#1391ff,#0145ff);
width: 200px;
height: 160px;
position: absolute;
top: 100%;
left: 100%;
text-align: center;
border-radius: 16px;
padding: 120px 50px;
box-shadow: 2px 2px 8px #000000ab;
}
<div id="wrapper">
<div id="introduction-container">
<div id="introduction-textposition">
<div id="introduction-paragraph">
<h3>RTX 2080Ti Available Now!</h3>
<h1>RAY-TRACE</h1>
<p><span style="color: rgb(118, 185, 0);">NVIDIA RTX</span> is the most advanced platform for ray tracing and AI technologies that are revolutionizing the ways we play and create</p>
<div>
SHOP NOW!
</div>
</div>
</div>
</div>
Related
I have a div on my website that I would like to remain the viewport height until the div gets small enough to where the children elements begin colliding (or a little before). I've tried min-height and display:table; yet none of it works. Here's how it's supposed to look:
However, on vertically smaller screens it looks like this:
Code snippet attached:
* {
margin: 0;
}
body {
overflow-x: hidden;
font-size: large;
margin: 0;
}
.welcome {
text-align: center;
background-image: url("https://images.unsplash.com/photo-1587831990711-23ca6441447b?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8ZGVza3RvcCUyMGNvbXB1dGVyfGVufDB8fDB8fA%3D%3D&auto=format&fit=crop&w=500&q=60");
background-size: cover;
background-repeat: no-repeat;
min-height: 100%;
color: white;
position: absolute;
top: 0px;
width: 100%;
padding: 0 auto;
}
.welcome * {
clear: both;
}
.welcome-txt {
position: absolute;
top: 40%;
left: 50%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
white-space: nowrap;
}
.welcome-content {
animation-name: fadeInLoad;
animation-duration: 3s;
animation-timing-function: linear;
}
#child {
position: absolute;
top: 0;
color: black;
display: inline-block;
}
.info-content {
position: relative;
top: 83vh;
text-align: center;
background-image: url("img_5.jpg");
background-repeat: no-repeat;
background-size: cover;
width: 100%;
min-height: 105%;
padding: 20px;
padding-right: 20px;
clear: both;
overflow: hidden;
}
.info-content-blocks {
background-color: rgba(204, 204, 204, 0.8);
padding: 30px;
margin: 15px;
}
.diveder {
width: 100%;
min-height: 100px;
background-color: rgba(204, 204, 204, 0.8);
padding-top: 2%;
padding-bottom: 1%;
}
<div class="welcome">
<div class="welcome-content">
<h1 class="welcome-txt">Classes<br>
The Coders Club</h1>
<img src="/resources/Copy of The Coders Club.png" class="logo">
<p class="tagline">Learn. Code. Create.</p>
<div class="arrow-background">
<div class="arrow bounce"></div>
</div>
</div>
</div>
<div class="space"></div>
<div class="info-content">
<div class="diveder" style="color: red;"><h2>Class Starts February 10</h2>
<p>Signup by January 20th</p></div>
<div class="info-content-blocks" id="classes">
<h3>What Will Be Taught?</h3>
<h4><b>Beginner Class</b></h4>
<p>In the beginner class students will be taught the basics of HTML (Hyper Text Markup Language), CSS (Cascading Style Sheets). Students will be able to make websites like the one you are one now.</p>
<button class="standard-button">View curriculum</button><br><br>
<button class="standard-button">Enroll</button>
<h4>Intermediate Class Part 1 (New!)</h4>
<p>In the Intermediate part 1 class students will learn the basics of JS. IE: variables, function, if/else statements, object, object oriented programing. Note: The HTML and CSS is not required for the intermediate class.</p>
<button class="standard-button">Enroll</button><br><br>
<button class="standard-button">View curriculum</button><br><br>
</div>
If I understand your question correctly, this might be what you wanna do. First is to add min-height: 100vh to .welcome, then instead of using absolute positioning on the texts, we can use flexbox model to its parent .welcome.
* {
margin: 0;
}
body {
overflow-x: hidden;
font-size: large;
margin: 0;
}
.welcome {
text-align: center;
background-image: url("https://images.unsplash.com/photo-1587831990711-23ca6441447b?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8ZGVza3RvcCUyMGNvbXB1dGVyfGVufDB8fDB8fA%3D%3D&auto=format&fit=crop&w=500&q=60");
background-size: cover;
background-repeat: no-repeat;
min-height: 100vh;
color: white;
top: 0px;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.welcome * {
clear: both;
}
.welcome-txt {
white-space: nowrap;
}
.welcome-content {
animation-name: fadeInLoad;
animation-duration: 3s;
animation-timing-function: linear;
padding: 40px 0;
}
#child {
position: absolute;
top: 0;
color: black;
display: inline-block;
}
.info-content {
position: relative;
text-align: center;
background-image: url("img_5.jpg");
background-repeat: no-repeat;
background-size: cover;
width: 100%;
min-height: 105%;
padding: 20px;
padding-right: 20px;
clear: both;
overflow: hidden;
}
.info-content-blocks {
background-color: rgba(204, 204, 204, 0.8);
padding: 30px;
margin: 15px;
}
.diveder {
width: 100%;
min-height: 100px;
background-color: rgba(204, 204, 204, 0.8);
padding-top: 2%;
padding-bottom: 1%;
}
<div class="welcome">
<div class="welcome-content">
<h1 class="welcome-txt">Classes<br> The Coders Club</h1>
<img src="/resources/Copy of The Coders Club.png" class="logo">
<p class="tagline">Learn. Code. Create.</p>
<div class="arrow-background">
<div class="arrow bounce"></div>
</div>
</div>
</div>
<div class="space"></div>
<div class="info-content">
<div class="diveder" style="color: red;">
<h2>Class Starts February 10</h2>
<p>Signup by January 20th</p>
</div>
<div class="info-content-blocks" id="classes">
<h3>What Will Be Taught?</h3>
<h4><b>Beginner Class</b></h4>
<p>In the beginner class students will be taught the basics of HTML (Hyper Text Markup Language), CSS (Cascading Style Sheets). Students will be able to make websites like the one you are one now.</p>
<button class="standard-button">View curriculum</button><br><br>
<button class="standard-button">Enroll</button>
<h4>Intermediate Class Part 1 (New!)</h4>
<p>In the Intermediate part 1 class students will learn the basics of JS. IE: variables, function, if/else statements, object, object oriented programing. Note: The HTML and CSS is not required for the intermediate class.</p>
<button class="standard-button">Enroll</button><br><br>
<button class="standard-button">View curriculum</button><br><br>
</div>
The key here is to actually not use the position absolute and use the flexbox model instead though, so that it's treated as having its own height.
I came across a useful article here that uses JS to create a min width on the <meta name='viewport' /> and if the device is smaller than that minimum width it renders a more "zoomed out" version of the page.
I believe this solution would fix your issue of the elements colliding.
The github repo with the code
Just set the parent's min-height to fit-content then it's up to your need if you want overflow to be scroll or hidden.
* {
margin: 0;
padding: 0;
}
.parent {
width: 100vw;
height: 100vh;
min-height: fit-content;
display: flex;
background: lightblue;
/* overflow: hidden; */
}
.child {
width: 50%;
height: 100px;
text-align: center;
background: lightcoral;
border: 1px solid lightgray;
}
.parent :nth-child(3) {
height: 300px;
}
<div class="parent">
<div class="child">child1</div>
<div class="child">child2</div>
<div class="child">child3</div>
</div>
i am using some js for this
<script>
let height = screen.height;
document.querySelector(".welcome").style.minHeight=height+"px";
</script>
you can remove the min-height from .welcome as we are using js
even with a small vertical screen, it will work perfectly
here is the complete code
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
* {
margin: 0;
}
body {
overflow-x: hidden;
font-size: large;
margin: 0;
}
.welcome {
text-align: center;
background-image: url("https://images.unsplash.com/photo-1587831990711-23ca6441447b?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8ZGVza3RvcCUyMGNvbXB1dGVyfGVufDB8fDB8fA%3D%3D&auto=format&fit=crop&w=500&q=60");
background-size: cover;
background-repeat: no-repeat;
color: white;
position: absolute;
top: 0px;
width: 100%;
padding: 0 auto;
}
.welcome * {
clear: both;
}
.welcome-txt {
position: absolute;
top: 40%;
left: 50%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
white-space: nowrap;
}
.welcome-content {
animation-name: fadeInLoad;
animation-duration: 3s;
animation-timing-function: linear;
}
#child {
position: absolute;
top: 0;
color: black;
display: inline-block;
}
.info-content {
position: relative;
top: 83vh;
text-align: center;
background-image: url("img_5.jpg");
background-repeat: no-repeat;
background-size: cover;
width: 100%;
min-height: 105%;
padding: 20px;
padding-right: 20px;
clear: both;
overflow: hidden;
}
.info-content-blocks {
background-color: rgba(204, 204, 204, 0.8);
padding: 30px;
margin: 15px;
}
.diveder {
width: 100%;
min-height: 100px;
background-color: rgba(204, 204, 204, 0.8);
padding-top: 2%;
padding-bottom: 1%;
}
</style>
</head>
<body>
<div class="welcome">
<div class="welcome-content">
<h1 class="welcome-txt">Classes<br>
The Coders Club</h1>
<img src="/resources/Copy of The Coders Club.png" class="logo">
<p class="tagline">Learn. Code. Create.</p>
<div class="arrow-background">
<div class="arrow bounce"></div>
</div>
</div>
</div>
<div class="space"></div>
<div class="info-content">
<div class="diveder" style="color: red;"><h2>Class Starts February 10</h2>
<p>Signup by January 20th</p></div>
<div class="info-content-blocks" id="classes">
<h3>What Will Be Taught?</h3>
<h4><b>Beginner Class</b></h4>
<p>In the beginner class students will be taught the basics of HTML (Hyper Text Markup Language), CSS (Cascading Style Sheets). Students will be able to make websites like the one you are one now.</p>
<button class="standard-button">View curriculum</button><br><br>
<button class="standard-button">Enroll</button>
<h4>Intermediate Class Part 1 (New!)</h4>
<p>In the Intermediate part 1 class students will learn the basics of JS. IE: variables, function, if/else statements, object, object oriented programing. Note: The HTML and CSS is not required for the intermediate class.</p>
<button class="standard-button">Enroll</button><br><br>
<button class="standard-button">View curriculum</button><br><br>
</div></div>
</body>
<script>
let height = screen.height;
document.querySelector(".welcome").style.minHeight=height+"px";
</script></html>
i am new to creating animations...and i would like to create facebook like animation for loading the screen.
What i am trying to do?
i have a card and i want to represent the loading state by using the facebook like loading (skeleton screen with animation) for the div with class "image".
The code is added here
https://codepen.io/harika123/pen/vYEdoOY
Below is the code,
.container {
display: flex;
flex-direction: row;
}
.card {
box-shadow: 3px 3px 5px 0 rgba(0, 0,0, 0.15);
width: 309px;
position: relative;
top: 200px;
left: 250px;
}
.image {
display:flex;
width: 309px;
height: 176px;
background-color: #cccccc;
}
.loading {
position: relative;
top: 80px;
left: 125px;
width: 82px;
height: 20px;
background-color: white;
border-radius: 10px;
}
h4 {
height: 30px;
}
.text {
padding-left: 16px;
}
.footer {
display: flex;
width: 309px;
height: 72px;
background-color: white;
}
<div class="container">
<div class="card">
<div class="image">
<div class="loading">
<div class="text">loading</div>
<div class="button"></div>
</div>
</div>
<div class="footer">
<div class="info">
<h4>Card Name</h4>
</div>
</div>
</div>
</div>
I have tried to add the animations but is not working (look into code from codepen). how can i add the animations like the facebook loading skeleton screen. for facebook we see left to right shimmering effect. i want it to use 90 deg linear gradient. could someone help me with this. thanks.
Page Example: https://codepen.io/anthonyhvelazquez/pen/qBBVjBX
The example I posted is a working example of the template I want to have. I have 2 fixed height headers and the rest of the content-container will fill the height of the parent. Anything within the content-container will auto scroll if the child's content is larger than the the content-container. I know there are other functions like minmax, and fit-content and wanted to make sure there isnt a better/more responsive way of setting up the page.
Some other questions I had regarding grids:
If I wanted to have a hidden header that appears and disappears on the click of a button, would it be better using a grid system and trying to animate the grid rows to a height of 0 or would it be better setting up the container as a vertical flex container and modifying the height of the navbars themselves
If I tried to implement this in Angular, would I have to wrap my components in div containers with the grid location style to place them in a grid template properly or can I add the styling to the component itself like so:
<div style="grid-row: 1/2">
<app-component></app-component>
</div>
// or
<app-component style="grid-row: 1/2"></app-component>
The codepen demo is not responsive and to your question. Is it the most responsive method? No, it is not.
With grid system you can make any layout you can think of, but not everywhere you need it.
You can simply use Flex and it will be responsive as well.
I am adding code for a normal web layout. having Header, hero section
content and para and all be responsive. Feel free to go through them and understand them. Feel free to ask anything regarding it. I will help as much I can.
In Angular, you can make components like header, footer and add the respective HTML tags and CSS for the components and imports it in your home page component. Hope this helps.
For two fixed header you can just increse the height of the header in its class. But you have to use js for adding click function and doing the changes in height of that header class.
For the particular example, I had just used flex here.
body, html{
padding: 0px;
margin: 0px ;
box-sizing: border-box;
}
.header{
z-index: 10;
height: 80px;
width: 100%;
position: fixed;
background: linear-gradient( 160deg, #00689b 0%, #00adef 100%);
box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.06);
}
.header .logo{
width: 190px;
height: auto;
position: absolute;
top: 54%;
left: 135px;
transform: translate(-50%, -50%);
cursor: pointer;
color: white;
}
.header-links{
display: flex;
flex-direction: row;
float: right;
padding: 9px 20px;
color: white;
font-size: 18px;
}
.header-links span{
padding: 20px;
}
.hero-section{
width: 100%;
height: 80vh;
position: relative;
background-color: turquoise;
top: 80px;
}
.hero-section img{
width: 100%;
height: 80vh;
object-fit: cover;
position: absolute;
}
.hero-section h1{
position: absolute;
text-align: center;
color: white;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.contents-container{
padding: 5% 5%;
position: relative;
width: 100%;
min-height: 100vh;
}
.h-features-container{
padding-top: 20px;
height: auto;
width: 100%;
position: relative;
background-color: white;
z-index: 1;
}
.h-features-container >h3{
justify-content: center;
text-align: center;
font-size: 28px;
color: #111;
}
.features-card-container{
display: flex;
flex-direction: row;
justify-content: center;
flex-wrap: wrap;
margin-top: 10px;
padding: 50px 9%;
box-sizing: border-box;
}
.features-card{
width: 300px;
height: 412px;
background-color: red;
padding: 20px;
margin: 19px;
border-radius: 2px;
background: #fff;
box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.16);
}
.features-card h3{
text-align: center;
}
.features-card p{
font-size: 16px;
}
/* footer */
.h-footer{
min-height: 50vh;
width: 100%;
position: relative;
bottom: 0px;
padding: 0%;
background: linear-gradient( 90deg, #00689b 0%, #00adef 100%);
}
.h-footer-flex{
display: flex;
flex-direction: row;
flex-wrap: wrap;
color: white;
white-space: nowrap;
padding: 20px 20px;
}
.h-copywrite{
text-align: center;
color: white;
position: relative;
}
.f-box{
height: 60%;
width: 25%;
padding: 20px;
margin: 20px;
}
.f-box p{
position: relative;
}
.f-box>p>a{
cursor: pointer;
}
.f-box-links:before {
content: '';
position: absolute;
background: white;
width: 0px;
height: 1px;
top: 20px;
opacity: .8;
transform: translate(0%, 0%);
transition: all 0.3s ease;
}
.f-box-links:hover:before {
width: 25px;
}
.social-icon-1{
margin-left: -8px;
}
#media screen and (max-width:1200px){
.f-box{
height: 60%;
width: 28%;
padding: 20px;
margin: 20px;
}
}
#media screen and (max-width:999px){
.f-box{
height: 60%;
width: 26%;
padding: 20px;
margin: 20px;
}
}
<header class="header">
<div class="logo">
<h2>Main Logo</h2>
</div>
<div class="header-links">
<span>Products</span>
<span>Features</span>
<span>Contact</span>
</div>
</header>
<div class="hero-section">
<img src="https://source.unsplash.com/random">
<h1>This is a simple heading</h1>
</div>
<div id="features-container" class="h-features-container">
<h3>Our Products</h3>
<div class="features-card-container">
<div class="features-card">
<h3>Inventory Management</h3>
<p>Inventory Management Software enables you to Manage Your assets The way you want you can
arrange your assets in a way that helps you to keep easy track.
</p>
</div>
<div class="features-card">
<h3>Order Management</h3>
<p>Stock Management Software enables you to Manage Your asstes The way you want you can
arrange your assets in a way that helps you to keep easy track.
</p>
</div>
<div class="features-card">
<h3>Employee Management</h3>
<p>Stock Management Software enables you to Manage Your asstes The way you want you can
arrange your assets in a way that helps you to keep easy track.
</p>
</div>
<div class="features-card">
<h3>Payroll Management</h3>
<p>Stock Management Software enables you to Manage Your asstes The way you want you can
arrange your assets in a way that helps you to keep easy track.
</p>
</div>
<div class="features-card">
<h3>Attendence System</h3>
<p>Stock Management Software enables you to Manage Your asstes The way you want you can
arrange your assets in a way that helps you to keep easy track.
</p>
</div>
</div>
</div>
<!-- footer -->
<footer class="footer">
<div class="h-footer">
<div class="h-footer-flex">
<div class=" f-box">
<p> <a class="f-box-links">Home</a></p>
<p> <a class="f-box-links">Features</a></p>
<p><a class="f-box-links">Clients</a></p>
<p><a class="f-box-links">Why Us</a></p>
<p><a class="f-box-links">Contact Us</a></p>
</div>
<div class=" f-box">
<p> <a class="f-box-links">Terms and Condition</a></p>
<p> <a class="f-box-links">Privacy Policy</a></p>
</div>
<div class=" f-box">
<p>Follow us</p>
<p>Facebook</p>
<p>Instagram</p>
</div>
</div>
<p class="h-copywrite">© 2019 website.in All Rights Reserved</p>
</div>
</footer>
I'm creating a website and there is a section where I would like this design to be put in place:
At the moment, the speech bubbles are svg images set as background images to their own individual divs, the elements inside the speech bubbles are nested within the speech bubble parent div. The problems arise when changing browser widths - the text doesn't stay within the bubbles.
What is the best way to go about turning this design into responsive code with html and CSS only?
This is the html code so far:
<!-- Reviews -->
<section id="reviews">
<h2>Reviews</h2>
<section class="visitor-review-1">
<div class="review-1">
<img id="user-image-1" src="media/profile-picture-1.png">
<div id=visitor-comment-1>
<p>Make sure you visit Santorini when you go to Greece. Its magical! An island that is a volcano, what could be dreamier? Make sure you try the local naturally sweet red wine, sweet tomatoes and lava.
</p>
<p>
<strong><br>Amy Santiago</strong><br>Birmingham, UK
</p>
</div>
</div>
</section>
<section class="visitor-review-2">
<div class="review-2">
<img id="user-image-2" src="media/profile-picture-2.png">
<div id=visitor-comment-2>
<p>We went to a restaurant with a beautiful terrace called Elinikon and had the most amazing view. Not only the sunset but before and after the sky remains beautiful colours! 100% must see when in Santorini.
</p>
<p>
<strong><br>Dave William</strong><br>London, UK
</p>
</div>
</div>
</section>
</section>
and CSS:
#reviews {
padding: 5rem 8rem 5rem 8rem;
height: 100px;
}
.visitor-review-1 {
background-image: url(media/speech-bubble-left_1.svg);
background-repeat: no-repeat;
background-size: 30rem;
height: 350px;
margin-top: 2.9rem;
}
.visitor-review-2 {
background-image: url(media/speech-bubble-right.svg);
background-repeat: no-repeat;
background-position: right;
background-size: 30rem;
height: 350px;
position: relative;
top: -9rem;
}
.review-1 {
width: 40%;
position: absolute;
}
.review-2 {
width: 50%;
margin-left: 52%;
position: absolute;
}
#user-image-1 {
width: 110px;
position: relative;
left: 180px;
top: 26px;
}
#visitor-comment-1 {
font-family: 'Lato', sans-serif;
padding: 2rem 4rem 0rem 3rem;
color: rgba(16, 37, 89, 0.78);
text-align: center;
position: relative;
}
#user-image-2 {
width: 110px;
position: relative;
left: 180px;
top: 26px;
}
#visitor-comment-2 {
font-family: 'Lato', sans-serif;
padding: 2rem 4rem 0rem 3rem;
color: rgba(16, 37, 89, 0.78);
text-align: center;
position: relative;
}
You can use the #media tag to tell your code what to do if the max-width of the screen is some size, example:
#media only screen and (max-width: 425px) {
.review-1 {
width: 550%;
position: absolute;
}
/*And keep filling in what you want changed at screensizes here*/
}
So I was wondering how can I make the box stops exactly before it go through the text. The box is just floating under the text, I want to make it stop floating before it hits.
Normal Size
Window resized
HTML:
<div class="program"></div>
<span class="but">
<h2 class="zaglavie">CSGOFREEITEMS <span class="beta">0.5.1</span></h2>
<p class="opisanie"><b>Ultimate platform</b>. The easiest way to have fancy inventory. Get the item you want just in <b>seconds</b>.</p>
<div class="buttons">
<a class="button1" href="#above"></a>
<a class="button2" href="#above"></a>
<span style="float: right; color: white; margin-right: 2px; margin-top: 1px; font-size: 10.5px;">for only <b>$4.99</b>/month</span>
</div>
</span>
<br>
CSS:
.but
{
position: absolute;
top: 90px;
font-family: Verdana;
display: block;
}
.zaglavie
{
font-family: 'Open Sans', sans-serif;
color: #e5e5e5;
font-size: 31px;
text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.39);
position: relative;
left: 70px;
top: 100px;
font-weight: 700;
}
.opisanie
{
font-family: 'Open Sans', sans-serif;
color: #fefefe;
text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.39);
font-size: 16px;
left: 70px;
top: 90px;
position: relative;
width: 400px;
}
.buttons
{
margin-left: 70px;
margin-top: 120px;
width: 375px;
height: 57px;
}
.button1
{
display:block;
width: 227px;
height: 57px;
background-image: url(images/button1.png);
background-repeat: no-repeat;
float: left;
}
.button2
{
display:block;
width: 136px;
height: 57px;
background-image: url(images/button2.png);
margin-left: 240px;
}
.program
{
display:block;
width: 665px;
height: 745px;
background-image: url(images/sosi2.png);
background-repeat: no-repeat;
right: 50px;
position: relative;
float: right;
}
Weave: http://kodeweave.sourceforge.net/editor/#4fc7d9522497eba555377ed94d364ee3
CSS Media Queries are a good solution for your problem.
I made a simple snippet here to show you how they work. You can utilize them with your site to fix the problem.
What I decided to do here is use display: table; and table-cell to center your elements.
I then used media queries to change the element from display: table; to display: block;
In addition I change your program background image to an image element as it's easier to style and handle upon page resize.
I converted your images to Base64 aka DataURL (because I'm on a tablet and it's easier to test without extra http requests.
Here's a very simple example of how you can solve your problem with media queries
You can view this weave for a more extensive solution (ex display: table; and table-cell).
.left, .right {
position: absolute;
top: 0;
bottom: 0;
padding: 1em;
}
.left {
left: 0;
right: 50%;
background: #93e9ff;
}
.right {
right: 0;
left: 50%;
background: #47ffaf;
}
#media all and (min-height: 300px) {
.left, .right {
position: absolute;
left: 0;
right: 0;
}
.left {
top: 0;
bottom: 50%;
}
.right {
bottom: 0;
top: 50%;
}
}
<div class="left">left content</div>
<div class="right">right content</div>
You can use Bootstrap and you will have a nice responsive design for your page.
This is your code with bootstrap, without css and using the images in the HTML section:
<!Doctype html>
<html>
<head>
<meta charset ="utf-8">
<!--Bootstrap-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
</head>
<body>
<div class="container-fluid">
<div class="row">
<!--you can change that numbers to adapt your page to another devices like tablets-->
<!--if you see, the numbers are a proportion of 12, in this case, 5:7 (check the last div)-->
<div class="col-xs-5 col-sm-5 col-md-5 col-lg-5">
<span class="but">
<h2 class="zaglavie">CSGOFREEITEMS <span class="beta">0.5.1</span></h2>
<p class="opisanie"><b>Ultimate platform</b>. The easiest way to have fancy inventory. Get the item you want just in <b>seconds</b>.</p>
<div class="buttons">
<a class="button1" href="#above"><img src="images/button1.png"></a>
<a class="button2" href="#above"><img src="images/button2.png"></a>
<span style="float: right; color: white; margin-right: 2px; margin-top: 1px; font-size: 10.5px;">for only <b>$4.99</b>/month</span>
</div>
</span>
</div>
<!--if you see, the numbers are a proportion of 12, in this case, 5:7-->
<div class="col-xs-7 col-sm-7 col-md-7 col-lg-7">
<img class="img-responsive" src="images/sosi2.png">
</div>
</div> <!-- end row -->
</div> <!-- end container-fluid -->
</body>
You can implement your css from here and you will see that will be more easy and solid.
See http://getbootstrap.com/components/
Or https://www.youtube.com/watch?v=3cYWiU_HsgM (a nice tutorial of Bootstrap 3)
Hope this helps.