Best way to make a 2 column layout that works with multiple resolutions?
up vote
0
down vote
favorite
I've asked this a couple times but seems like I didn't word it quite right so will try do better here,
I'm trying to make a 2 column layout in HTML, CSS, & Java, what I want is the text on the left to center in the middle of both columns once the resolution is too low (by this I mean the columns look great in 1920x width and 1600x width, but when it gets down to 1200x800 the text breaks past the height of the right image).
I've seen a website that once the page width hits a certain point (around 1200x width) the text in the left column snaps to center in the middle of both, which results in the page looking good at all res. I have a feeling the text is overlayed on top of both columns with a java snippet that tells the text to move into the center at a certain width, only problem is I don't know how to achieve that,
I've attached my code at the bottom but in my version the text is inside the left column, am I right thinking that the text is probably on-top of both columns? and is there a javascript to tell the text to move center at a certain width? would really appreciate any help!
HTML:
<div class="content1">
<div class="column1 animation fadeInUp">
<div class="title1">
<h3>STATEMENT</h3> .
<h2>Title of Some Sort.</h2>
<div class="blue-line"></div>
</div>
<p1>Paragraph text.<br></p1>
<button class="svg1">FORUM</button>
<button class="svg2">SIGN UP</button>
</div>
<div class="column2">
<div class="column2pic"></div>
</div>
</div>
CSS:
.content1 {
display: flex;
margin-left:100px;
margin-right:0px;
}
.column1 {
display:inline-block;
flex: 31%;
padding-bottom: 0px;
padding-right:50px;
opacity: 0; animation-play-state: paused;
}
.animated {
-webkit-animation-duration: 1.5s;
animation-duration: 1.5s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
animation-play-state: running;
}
.fadeInUp {
-webkit-animation-name: fadeInUp;
animation-name: fadeInUp;
}
@keyframes fadeInUp {
from {
opacity: 0;
-webkit-transform: translate3d(0, 2.5rem, 0);
transform: translate3d(0, 2.5rem, 0);
}
to {
opacity: 1;
-webkit-transform: none;
transform: none;
}
.column2 {
flex: 50%;
padding-bottom: 0px;
padding-left:100px;
padding-top:0px;
width:50vw;
}
.column2pic {
background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0,
0.0)), url(../Assets/Images/Content1pic);
background-size:cover;
z-index: 100;
width:50vw;
height:600px;
}
NOTE: the animation is just a simple effect for the left text to fade up, but don't mind if anyone excludes that part to keep it simple.
Let me know if you have any ideas! Thanks!
javascript html css
New contributor
add a comment |
up vote
0
down vote
favorite
I've asked this a couple times but seems like I didn't word it quite right so will try do better here,
I'm trying to make a 2 column layout in HTML, CSS, & Java, what I want is the text on the left to center in the middle of both columns once the resolution is too low (by this I mean the columns look great in 1920x width and 1600x width, but when it gets down to 1200x800 the text breaks past the height of the right image).
I've seen a website that once the page width hits a certain point (around 1200x width) the text in the left column snaps to center in the middle of both, which results in the page looking good at all res. I have a feeling the text is overlayed on top of both columns with a java snippet that tells the text to move into the center at a certain width, only problem is I don't know how to achieve that,
I've attached my code at the bottom but in my version the text is inside the left column, am I right thinking that the text is probably on-top of both columns? and is there a javascript to tell the text to move center at a certain width? would really appreciate any help!
HTML:
<div class="content1">
<div class="column1 animation fadeInUp">
<div class="title1">
<h3>STATEMENT</h3> .
<h2>Title of Some Sort.</h2>
<div class="blue-line"></div>
</div>
<p1>Paragraph text.<br></p1>
<button class="svg1">FORUM</button>
<button class="svg2">SIGN UP</button>
</div>
<div class="column2">
<div class="column2pic"></div>
</div>
</div>
CSS:
.content1 {
display: flex;
margin-left:100px;
margin-right:0px;
}
.column1 {
display:inline-block;
flex: 31%;
padding-bottom: 0px;
padding-right:50px;
opacity: 0; animation-play-state: paused;
}
.animated {
-webkit-animation-duration: 1.5s;
animation-duration: 1.5s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
animation-play-state: running;
}
.fadeInUp {
-webkit-animation-name: fadeInUp;
animation-name: fadeInUp;
}
@keyframes fadeInUp {
from {
opacity: 0;
-webkit-transform: translate3d(0, 2.5rem, 0);
transform: translate3d(0, 2.5rem, 0);
}
to {
opacity: 1;
-webkit-transform: none;
transform: none;
}
.column2 {
flex: 50%;
padding-bottom: 0px;
padding-left:100px;
padding-top:0px;
width:50vw;
}
.column2pic {
background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0,
0.0)), url(../Assets/Images/Content1pic);
background-size:cover;
z-index: 100;
width:50vw;
height:600px;
}
NOTE: the animation is just a simple effect for the left text to fade up, but don't mind if anyone excludes that part to keep it simple.
Let me know if you have any ideas! Thanks!
javascript html css
New contributor
1
One thing that would make things easy in terms of responsiveness would be using flexbox, or existing CSS frameworks, such as Bootstrap. Both are responsive in design. I would suggest having a look at either of those. Alternatively, you could use media queries, if you prefer to build it yourself entirely. But then again, why reinvent the wheel? ;)
– Martin
Nov 8 at 9:29
Here's a wordpress template that's doing exactly what I'd like my 2 column layout to do, from looking at this and pulling in the right side of the browser window you can see it snaps the text to center, is one of those frameworks how you think they are achieving it? templatemonster.com/demo/53878.html (they've given it a class "elementor")
– JTR
Nov 8 at 9:37
Bootstrap has the exact same functionality within its framework. All you need to do is look up the classes for it, e.g.row
,col
,col-sm-
,col-md-
,col-lg-
etc. More here: getbootstrap.com/docs/4.0/layout/grid
– Martin
Nov 8 at 9:42
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I've asked this a couple times but seems like I didn't word it quite right so will try do better here,
I'm trying to make a 2 column layout in HTML, CSS, & Java, what I want is the text on the left to center in the middle of both columns once the resolution is too low (by this I mean the columns look great in 1920x width and 1600x width, but when it gets down to 1200x800 the text breaks past the height of the right image).
I've seen a website that once the page width hits a certain point (around 1200x width) the text in the left column snaps to center in the middle of both, which results in the page looking good at all res. I have a feeling the text is overlayed on top of both columns with a java snippet that tells the text to move into the center at a certain width, only problem is I don't know how to achieve that,
I've attached my code at the bottom but in my version the text is inside the left column, am I right thinking that the text is probably on-top of both columns? and is there a javascript to tell the text to move center at a certain width? would really appreciate any help!
HTML:
<div class="content1">
<div class="column1 animation fadeInUp">
<div class="title1">
<h3>STATEMENT</h3> .
<h2>Title of Some Sort.</h2>
<div class="blue-line"></div>
</div>
<p1>Paragraph text.<br></p1>
<button class="svg1">FORUM</button>
<button class="svg2">SIGN UP</button>
</div>
<div class="column2">
<div class="column2pic"></div>
</div>
</div>
CSS:
.content1 {
display: flex;
margin-left:100px;
margin-right:0px;
}
.column1 {
display:inline-block;
flex: 31%;
padding-bottom: 0px;
padding-right:50px;
opacity: 0; animation-play-state: paused;
}
.animated {
-webkit-animation-duration: 1.5s;
animation-duration: 1.5s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
animation-play-state: running;
}
.fadeInUp {
-webkit-animation-name: fadeInUp;
animation-name: fadeInUp;
}
@keyframes fadeInUp {
from {
opacity: 0;
-webkit-transform: translate3d(0, 2.5rem, 0);
transform: translate3d(0, 2.5rem, 0);
}
to {
opacity: 1;
-webkit-transform: none;
transform: none;
}
.column2 {
flex: 50%;
padding-bottom: 0px;
padding-left:100px;
padding-top:0px;
width:50vw;
}
.column2pic {
background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0,
0.0)), url(../Assets/Images/Content1pic);
background-size:cover;
z-index: 100;
width:50vw;
height:600px;
}
NOTE: the animation is just a simple effect for the left text to fade up, but don't mind if anyone excludes that part to keep it simple.
Let me know if you have any ideas! Thanks!
javascript html css
New contributor
I've asked this a couple times but seems like I didn't word it quite right so will try do better here,
I'm trying to make a 2 column layout in HTML, CSS, & Java, what I want is the text on the left to center in the middle of both columns once the resolution is too low (by this I mean the columns look great in 1920x width and 1600x width, but when it gets down to 1200x800 the text breaks past the height of the right image).
I've seen a website that once the page width hits a certain point (around 1200x width) the text in the left column snaps to center in the middle of both, which results in the page looking good at all res. I have a feeling the text is overlayed on top of both columns with a java snippet that tells the text to move into the center at a certain width, only problem is I don't know how to achieve that,
I've attached my code at the bottom but in my version the text is inside the left column, am I right thinking that the text is probably on-top of both columns? and is there a javascript to tell the text to move center at a certain width? would really appreciate any help!
HTML:
<div class="content1">
<div class="column1 animation fadeInUp">
<div class="title1">
<h3>STATEMENT</h3> .
<h2>Title of Some Sort.</h2>
<div class="blue-line"></div>
</div>
<p1>Paragraph text.<br></p1>
<button class="svg1">FORUM</button>
<button class="svg2">SIGN UP</button>
</div>
<div class="column2">
<div class="column2pic"></div>
</div>
</div>
CSS:
.content1 {
display: flex;
margin-left:100px;
margin-right:0px;
}
.column1 {
display:inline-block;
flex: 31%;
padding-bottom: 0px;
padding-right:50px;
opacity: 0; animation-play-state: paused;
}
.animated {
-webkit-animation-duration: 1.5s;
animation-duration: 1.5s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
animation-play-state: running;
}
.fadeInUp {
-webkit-animation-name: fadeInUp;
animation-name: fadeInUp;
}
@keyframes fadeInUp {
from {
opacity: 0;
-webkit-transform: translate3d(0, 2.5rem, 0);
transform: translate3d(0, 2.5rem, 0);
}
to {
opacity: 1;
-webkit-transform: none;
transform: none;
}
.column2 {
flex: 50%;
padding-bottom: 0px;
padding-left:100px;
padding-top:0px;
width:50vw;
}
.column2pic {
background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0,
0.0)), url(../Assets/Images/Content1pic);
background-size:cover;
z-index: 100;
width:50vw;
height:600px;
}
NOTE: the animation is just a simple effect for the left text to fade up, but don't mind if anyone excludes that part to keep it simple.
Let me know if you have any ideas! Thanks!
javascript html css
javascript html css
New contributor
New contributor
New contributor
asked Nov 8 at 9:25
JTR
54
54
New contributor
New contributor
1
One thing that would make things easy in terms of responsiveness would be using flexbox, or existing CSS frameworks, such as Bootstrap. Both are responsive in design. I would suggest having a look at either of those. Alternatively, you could use media queries, if you prefer to build it yourself entirely. But then again, why reinvent the wheel? ;)
– Martin
Nov 8 at 9:29
Here's a wordpress template that's doing exactly what I'd like my 2 column layout to do, from looking at this and pulling in the right side of the browser window you can see it snaps the text to center, is one of those frameworks how you think they are achieving it? templatemonster.com/demo/53878.html (they've given it a class "elementor")
– JTR
Nov 8 at 9:37
Bootstrap has the exact same functionality within its framework. All you need to do is look up the classes for it, e.g.row
,col
,col-sm-
,col-md-
,col-lg-
etc. More here: getbootstrap.com/docs/4.0/layout/grid
– Martin
Nov 8 at 9:42
add a comment |
1
One thing that would make things easy in terms of responsiveness would be using flexbox, or existing CSS frameworks, such as Bootstrap. Both are responsive in design. I would suggest having a look at either of those. Alternatively, you could use media queries, if you prefer to build it yourself entirely. But then again, why reinvent the wheel? ;)
– Martin
Nov 8 at 9:29
Here's a wordpress template that's doing exactly what I'd like my 2 column layout to do, from looking at this and pulling in the right side of the browser window you can see it snaps the text to center, is one of those frameworks how you think they are achieving it? templatemonster.com/demo/53878.html (they've given it a class "elementor")
– JTR
Nov 8 at 9:37
Bootstrap has the exact same functionality within its framework. All you need to do is look up the classes for it, e.g.row
,col
,col-sm-
,col-md-
,col-lg-
etc. More here: getbootstrap.com/docs/4.0/layout/grid
– Martin
Nov 8 at 9:42
1
1
One thing that would make things easy in terms of responsiveness would be using flexbox, or existing CSS frameworks, such as Bootstrap. Both are responsive in design. I would suggest having a look at either of those. Alternatively, you could use media queries, if you prefer to build it yourself entirely. But then again, why reinvent the wheel? ;)
– Martin
Nov 8 at 9:29
One thing that would make things easy in terms of responsiveness would be using flexbox, or existing CSS frameworks, such as Bootstrap. Both are responsive in design. I would suggest having a look at either of those. Alternatively, you could use media queries, if you prefer to build it yourself entirely. But then again, why reinvent the wheel? ;)
– Martin
Nov 8 at 9:29
Here's a wordpress template that's doing exactly what I'd like my 2 column layout to do, from looking at this and pulling in the right side of the browser window you can see it snaps the text to center, is one of those frameworks how you think they are achieving it? templatemonster.com/demo/53878.html (they've given it a class "elementor")
– JTR
Nov 8 at 9:37
Here's a wordpress template that's doing exactly what I'd like my 2 column layout to do, from looking at this and pulling in the right side of the browser window you can see it snaps the text to center, is one of those frameworks how you think they are achieving it? templatemonster.com/demo/53878.html (they've given it a class "elementor")
– JTR
Nov 8 at 9:37
Bootstrap has the exact same functionality within its framework. All you need to do is look up the classes for it, e.g.
row
, col
, col-sm-
, col-md-
, col-lg-
etc. More here: getbootstrap.com/docs/4.0/layout/grid– Martin
Nov 8 at 9:42
Bootstrap has the exact same functionality within its framework. All you need to do is look up the classes for it, e.g.
row
, col
, col-sm-
, col-md-
, col-lg-
etc. More here: getbootstrap.com/docs/4.0/layout/grid– Martin
Nov 8 at 9:42
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
You will need to use css @media
. In your case, you will have to create @media only screen and (max-width: 1200px)
with the style that you would like at this size. See below an example of it. I put the width to 400px to fit with this snippet. When you resize the browser window under 400px @media only screen and (max-width: 400px)
, it lowers the text size font-size: 20px;
and align it in the center text-align: center;
.
#mypic {
width: 100%;
max-width: 560px;
height: 350px;
background-image: url("https://images.pexels.com/photos/531880/pexels-photo-531880.jpeg?auto=compress&cs=tinysrgb&h=350");
font-size: 50px;
}
@media only screen and (max-width: 400px) {
#mypic {
font-size: 20px;
text-align: center;
}
}
<div id="mypic">My Title In Picture!</div>
So for this website, templatemonster.com/demo/53878.html is that what they are doing? its the "elementor" div in their site code. I'm not wanting to stop the screen getting smaller I'm wanting the 2 column layout to look good at separate resolutions, achieving it by moving the text from the left column to the middle of both columns once the resolution gets so low that the text tries to break out of its left container, resulting in way more space for the text at low resolution, like they do on the site like I've attached.
– JTR
Nov 8 at 9:48
Yes this is it. You will need to use@media
. If you run the snippet, you will see the text get align in the middle as soon it is getting smaller than 400px;
– Jonathan Gagne
Nov 8 at 9:51
I made another example with the same text that you were talking about on the other website.
– Jonathan Gagne
Nov 8 at 9:59
You're an absolute legend.
– JTR
Nov 8 at 10:02
Hehe it was my pleasure! Enjoy!
– Jonathan Gagne
Nov 8 at 10:03
|
show 8 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
You will need to use css @media
. In your case, you will have to create @media only screen and (max-width: 1200px)
with the style that you would like at this size. See below an example of it. I put the width to 400px to fit with this snippet. When you resize the browser window under 400px @media only screen and (max-width: 400px)
, it lowers the text size font-size: 20px;
and align it in the center text-align: center;
.
#mypic {
width: 100%;
max-width: 560px;
height: 350px;
background-image: url("https://images.pexels.com/photos/531880/pexels-photo-531880.jpeg?auto=compress&cs=tinysrgb&h=350");
font-size: 50px;
}
@media only screen and (max-width: 400px) {
#mypic {
font-size: 20px;
text-align: center;
}
}
<div id="mypic">My Title In Picture!</div>
So for this website, templatemonster.com/demo/53878.html is that what they are doing? its the "elementor" div in their site code. I'm not wanting to stop the screen getting smaller I'm wanting the 2 column layout to look good at separate resolutions, achieving it by moving the text from the left column to the middle of both columns once the resolution gets so low that the text tries to break out of its left container, resulting in way more space for the text at low resolution, like they do on the site like I've attached.
– JTR
Nov 8 at 9:48
Yes this is it. You will need to use@media
. If you run the snippet, you will see the text get align in the middle as soon it is getting smaller than 400px;
– Jonathan Gagne
Nov 8 at 9:51
I made another example with the same text that you were talking about on the other website.
– Jonathan Gagne
Nov 8 at 9:59
You're an absolute legend.
– JTR
Nov 8 at 10:02
Hehe it was my pleasure! Enjoy!
– Jonathan Gagne
Nov 8 at 10:03
|
show 8 more comments
up vote
1
down vote
accepted
You will need to use css @media
. In your case, you will have to create @media only screen and (max-width: 1200px)
with the style that you would like at this size. See below an example of it. I put the width to 400px to fit with this snippet. When you resize the browser window under 400px @media only screen and (max-width: 400px)
, it lowers the text size font-size: 20px;
and align it in the center text-align: center;
.
#mypic {
width: 100%;
max-width: 560px;
height: 350px;
background-image: url("https://images.pexels.com/photos/531880/pexels-photo-531880.jpeg?auto=compress&cs=tinysrgb&h=350");
font-size: 50px;
}
@media only screen and (max-width: 400px) {
#mypic {
font-size: 20px;
text-align: center;
}
}
<div id="mypic">My Title In Picture!</div>
So for this website, templatemonster.com/demo/53878.html is that what they are doing? its the "elementor" div in their site code. I'm not wanting to stop the screen getting smaller I'm wanting the 2 column layout to look good at separate resolutions, achieving it by moving the text from the left column to the middle of both columns once the resolution gets so low that the text tries to break out of its left container, resulting in way more space for the text at low resolution, like they do on the site like I've attached.
– JTR
Nov 8 at 9:48
Yes this is it. You will need to use@media
. If you run the snippet, you will see the text get align in the middle as soon it is getting smaller than 400px;
– Jonathan Gagne
Nov 8 at 9:51
I made another example with the same text that you were talking about on the other website.
– Jonathan Gagne
Nov 8 at 9:59
You're an absolute legend.
– JTR
Nov 8 at 10:02
Hehe it was my pleasure! Enjoy!
– Jonathan Gagne
Nov 8 at 10:03
|
show 8 more comments
up vote
1
down vote
accepted
up vote
1
down vote
accepted
You will need to use css @media
. In your case, you will have to create @media only screen and (max-width: 1200px)
with the style that you would like at this size. See below an example of it. I put the width to 400px to fit with this snippet. When you resize the browser window under 400px @media only screen and (max-width: 400px)
, it lowers the text size font-size: 20px;
and align it in the center text-align: center;
.
#mypic {
width: 100%;
max-width: 560px;
height: 350px;
background-image: url("https://images.pexels.com/photos/531880/pexels-photo-531880.jpeg?auto=compress&cs=tinysrgb&h=350");
font-size: 50px;
}
@media only screen and (max-width: 400px) {
#mypic {
font-size: 20px;
text-align: center;
}
}
<div id="mypic">My Title In Picture!</div>
You will need to use css @media
. In your case, you will have to create @media only screen and (max-width: 1200px)
with the style that you would like at this size. See below an example of it. I put the width to 400px to fit with this snippet. When you resize the browser window under 400px @media only screen and (max-width: 400px)
, it lowers the text size font-size: 20px;
and align it in the center text-align: center;
.
#mypic {
width: 100%;
max-width: 560px;
height: 350px;
background-image: url("https://images.pexels.com/photos/531880/pexels-photo-531880.jpeg?auto=compress&cs=tinysrgb&h=350");
font-size: 50px;
}
@media only screen and (max-width: 400px) {
#mypic {
font-size: 20px;
text-align: center;
}
}
<div id="mypic">My Title In Picture!</div>
#mypic {
width: 100%;
max-width: 560px;
height: 350px;
background-image: url("https://images.pexels.com/photos/531880/pexels-photo-531880.jpeg?auto=compress&cs=tinysrgb&h=350");
font-size: 50px;
}
@media only screen and (max-width: 400px) {
#mypic {
font-size: 20px;
text-align: center;
}
}
<div id="mypic">My Title In Picture!</div>
#mypic {
width: 100%;
max-width: 560px;
height: 350px;
background-image: url("https://images.pexels.com/photos/531880/pexels-photo-531880.jpeg?auto=compress&cs=tinysrgb&h=350");
font-size: 50px;
}
@media only screen and (max-width: 400px) {
#mypic {
font-size: 20px;
text-align: center;
}
}
<div id="mypic">My Title In Picture!</div>
edited Nov 9 at 2:22
answered Nov 8 at 9:37
Jonathan Gagne
1,7981720
1,7981720
So for this website, templatemonster.com/demo/53878.html is that what they are doing? its the "elementor" div in their site code. I'm not wanting to stop the screen getting smaller I'm wanting the 2 column layout to look good at separate resolutions, achieving it by moving the text from the left column to the middle of both columns once the resolution gets so low that the text tries to break out of its left container, resulting in way more space for the text at low resolution, like they do on the site like I've attached.
– JTR
Nov 8 at 9:48
Yes this is it. You will need to use@media
. If you run the snippet, you will see the text get align in the middle as soon it is getting smaller than 400px;
– Jonathan Gagne
Nov 8 at 9:51
I made another example with the same text that you were talking about on the other website.
– Jonathan Gagne
Nov 8 at 9:59
You're an absolute legend.
– JTR
Nov 8 at 10:02
Hehe it was my pleasure! Enjoy!
– Jonathan Gagne
Nov 8 at 10:03
|
show 8 more comments
So for this website, templatemonster.com/demo/53878.html is that what they are doing? its the "elementor" div in their site code. I'm not wanting to stop the screen getting smaller I'm wanting the 2 column layout to look good at separate resolutions, achieving it by moving the text from the left column to the middle of both columns once the resolution gets so low that the text tries to break out of its left container, resulting in way more space for the text at low resolution, like they do on the site like I've attached.
– JTR
Nov 8 at 9:48
Yes this is it. You will need to use@media
. If you run the snippet, you will see the text get align in the middle as soon it is getting smaller than 400px;
– Jonathan Gagne
Nov 8 at 9:51
I made another example with the same text that you were talking about on the other website.
– Jonathan Gagne
Nov 8 at 9:59
You're an absolute legend.
– JTR
Nov 8 at 10:02
Hehe it was my pleasure! Enjoy!
– Jonathan Gagne
Nov 8 at 10:03
So for this website, templatemonster.com/demo/53878.html is that what they are doing? its the "elementor" div in their site code. I'm not wanting to stop the screen getting smaller I'm wanting the 2 column layout to look good at separate resolutions, achieving it by moving the text from the left column to the middle of both columns once the resolution gets so low that the text tries to break out of its left container, resulting in way more space for the text at low resolution, like they do on the site like I've attached.
– JTR
Nov 8 at 9:48
So for this website, templatemonster.com/demo/53878.html is that what they are doing? its the "elementor" div in their site code. I'm not wanting to stop the screen getting smaller I'm wanting the 2 column layout to look good at separate resolutions, achieving it by moving the text from the left column to the middle of both columns once the resolution gets so low that the text tries to break out of its left container, resulting in way more space for the text at low resolution, like they do on the site like I've attached.
– JTR
Nov 8 at 9:48
Yes this is it. You will need to use
@media
. If you run the snippet, you will see the text get align in the middle as soon it is getting smaller than 400px;– Jonathan Gagne
Nov 8 at 9:51
Yes this is it. You will need to use
@media
. If you run the snippet, you will see the text get align in the middle as soon it is getting smaller than 400px;– Jonathan Gagne
Nov 8 at 9:51
I made another example with the same text that you were talking about on the other website.
– Jonathan Gagne
Nov 8 at 9:59
I made another example with the same text that you were talking about on the other website.
– Jonathan Gagne
Nov 8 at 9:59
You're an absolute legend.
– JTR
Nov 8 at 10:02
You're an absolute legend.
– JTR
Nov 8 at 10:02
Hehe it was my pleasure! Enjoy!
– Jonathan Gagne
Nov 8 at 10:03
Hehe it was my pleasure! Enjoy!
– Jonathan Gagne
Nov 8 at 10:03
|
show 8 more comments
JTR is a new contributor. Be nice, and check out our Code of Conduct.
JTR is a new contributor. Be nice, and check out our Code of Conduct.
JTR is a new contributor. Be nice, and check out our Code of Conduct.
JTR is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53204775%2fbest-way-to-make-a-2-column-layout-that-works-with-multiple-resolutions%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
One thing that would make things easy in terms of responsiveness would be using flexbox, or existing CSS frameworks, such as Bootstrap. Both are responsive in design. I would suggest having a look at either of those. Alternatively, you could use media queries, if you prefer to build it yourself entirely. But then again, why reinvent the wheel? ;)
– Martin
Nov 8 at 9:29
Here's a wordpress template that's doing exactly what I'd like my 2 column layout to do, from looking at this and pulling in the right side of the browser window you can see it snaps the text to center, is one of those frameworks how you think they are achieving it? templatemonster.com/demo/53878.html (they've given it a class "elementor")
– JTR
Nov 8 at 9:37
Bootstrap has the exact same functionality within its framework. All you need to do is look up the classes for it, e.g.
row
,col
,col-sm-
,col-md-
,col-lg-
etc. More here: getbootstrap.com/docs/4.0/layout/grid– Martin
Nov 8 at 9:42