Center Div on Tablets
Site: https://dev.momentinaboxclub.com/
Area: About the box
I want this column to be centered on mobile devices. I am currently using this css in a media query:
.about-box {
width: 90%;
margin: 0 auto;
}
It seems to work on cell phones but on tablets the box is getting moved to the left. I can't figure out why it won't center. Please help.
Thank you!
html css3 responsive-design media-queries
add a comment |
Site: https://dev.momentinaboxclub.com/
Area: About the box
I want this column to be centered on mobile devices. I am currently using this css in a media query:
.about-box {
width: 90%;
margin: 0 auto;
}
It seems to work on cell phones but on tablets the box is getting moved to the left. I can't figure out why it won't center. Please help.
Thank you!
html css3 responsive-design media-queries
Possible duplicate of How to auto adjust the div size for all mobile / tablet display formats?
– First Name
Nov 14 '18 at 0:42
Post is a duplicate, search for responsive web pages, you need to include meta tags.
– First Name
Nov 14 '18 at 0:43
Matt, familiarize yourself with your browser's document inspector. This sort of thing is trivial to diagnose these days once you do.
– isherwood
Nov 14 '18 at 3:08
add a comment |
Site: https://dev.momentinaboxclub.com/
Area: About the box
I want this column to be centered on mobile devices. I am currently using this css in a media query:
.about-box {
width: 90%;
margin: 0 auto;
}
It seems to work on cell phones but on tablets the box is getting moved to the left. I can't figure out why it won't center. Please help.
Thank you!
html css3 responsive-design media-queries
Site: https://dev.momentinaboxclub.com/
Area: About the box
I want this column to be centered on mobile devices. I am currently using this css in a media query:
.about-box {
width: 90%;
margin: 0 auto;
}
It seems to work on cell phones but on tablets the box is getting moved to the left. I can't figure out why it won't center. Please help.
Thank you!
html css3 responsive-design media-queries
html css3 responsive-design media-queries
edited Nov 14 '18 at 0:50
Johannes
36.9k102967
36.9k102967
asked Nov 14 '18 at 0:38
MattMatt
46110
46110
Possible duplicate of How to auto adjust the div size for all mobile / tablet display formats?
– First Name
Nov 14 '18 at 0:42
Post is a duplicate, search for responsive web pages, you need to include meta tags.
– First Name
Nov 14 '18 at 0:43
Matt, familiarize yourself with your browser's document inspector. This sort of thing is trivial to diagnose these days once you do.
– isherwood
Nov 14 '18 at 3:08
add a comment |
Possible duplicate of How to auto adjust the div size for all mobile / tablet display formats?
– First Name
Nov 14 '18 at 0:42
Post is a duplicate, search for responsive web pages, you need to include meta tags.
– First Name
Nov 14 '18 at 0:43
Matt, familiarize yourself with your browser's document inspector. This sort of thing is trivial to diagnose these days once you do.
– isherwood
Nov 14 '18 at 3:08
Possible duplicate of How to auto adjust the div size for all mobile / tablet display formats?
– First Name
Nov 14 '18 at 0:42
Possible duplicate of How to auto adjust the div size for all mobile / tablet display formats?
– First Name
Nov 14 '18 at 0:42
Post is a duplicate, search for responsive web pages, you need to include meta tags.
– First Name
Nov 14 '18 at 0:43
Post is a duplicate, search for responsive web pages, you need to include meta tags.
– First Name
Nov 14 '18 at 0:43
Matt, familiarize yourself with your browser's document inspector. This sort of thing is trivial to diagnose these days once you do.
– isherwood
Nov 14 '18 at 3:08
Matt, familiarize yourself with your browser's document inspector. This sort of thing is trivial to diagnose these days once you do.
– isherwood
Nov 14 '18 at 3:08
add a comment |
3 Answers
3
active
oldest
votes
There is a float: left
in a media query for that element which affects tablet sizes and in your case applies to class .vc_col-sm-8
at min-width 768px.
Just add float: none;
to your CSS rule for that element.
Thank you (and everyone below) for taking the time to answer me. Sometimes when programming you just don't see the little stuff and I wasn't catching the float: left here. I appreciate it!
– Matt
Nov 14 '18 at 15:53
add a comment |
In your HTML file there is a div that has a property: width: 66.66666667%;
. If you change this to width: auto;
, your issue will be resolved however it will get rid of the pink border around the text. If you add this line to your css file it should fix the alignment issue.
.wpb_column.vc_column_container.vc_col-sm-8.vc_col-has-fill {
width: auto;
}
Hope this helps!
add a comment |
Add display: flex;
to .full_section_inner
, just for medium devices, that should work!
@media only screen and (min-width: 768px) and (max-width: 992px){
.full_section_inner{
display: flex;
justify-content: center;
}
}
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53291524%2fcenter-div-on-tablets%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
There is a float: left
in a media query for that element which affects tablet sizes and in your case applies to class .vc_col-sm-8
at min-width 768px.
Just add float: none;
to your CSS rule for that element.
Thank you (and everyone below) for taking the time to answer me. Sometimes when programming you just don't see the little stuff and I wasn't catching the float: left here. I appreciate it!
– Matt
Nov 14 '18 at 15:53
add a comment |
There is a float: left
in a media query for that element which affects tablet sizes and in your case applies to class .vc_col-sm-8
at min-width 768px.
Just add float: none;
to your CSS rule for that element.
Thank you (and everyone below) for taking the time to answer me. Sometimes when programming you just don't see the little stuff and I wasn't catching the float: left here. I appreciate it!
– Matt
Nov 14 '18 at 15:53
add a comment |
There is a float: left
in a media query for that element which affects tablet sizes and in your case applies to class .vc_col-sm-8
at min-width 768px.
Just add float: none;
to your CSS rule for that element.
There is a float: left
in a media query for that element which affects tablet sizes and in your case applies to class .vc_col-sm-8
at min-width 768px.
Just add float: none;
to your CSS rule for that element.
answered Nov 14 '18 at 0:49
JohannesJohannes
36.9k102967
36.9k102967
Thank you (and everyone below) for taking the time to answer me. Sometimes when programming you just don't see the little stuff and I wasn't catching the float: left here. I appreciate it!
– Matt
Nov 14 '18 at 15:53
add a comment |
Thank you (and everyone below) for taking the time to answer me. Sometimes when programming you just don't see the little stuff and I wasn't catching the float: left here. I appreciate it!
– Matt
Nov 14 '18 at 15:53
Thank you (and everyone below) for taking the time to answer me. Sometimes when programming you just don't see the little stuff and I wasn't catching the float: left here. I appreciate it!
– Matt
Nov 14 '18 at 15:53
Thank you (and everyone below) for taking the time to answer me. Sometimes when programming you just don't see the little stuff and I wasn't catching the float: left here. I appreciate it!
– Matt
Nov 14 '18 at 15:53
add a comment |
In your HTML file there is a div that has a property: width: 66.66666667%;
. If you change this to width: auto;
, your issue will be resolved however it will get rid of the pink border around the text. If you add this line to your css file it should fix the alignment issue.
.wpb_column.vc_column_container.vc_col-sm-8.vc_col-has-fill {
width: auto;
}
Hope this helps!
add a comment |
In your HTML file there is a div that has a property: width: 66.66666667%;
. If you change this to width: auto;
, your issue will be resolved however it will get rid of the pink border around the text. If you add this line to your css file it should fix the alignment issue.
.wpb_column.vc_column_container.vc_col-sm-8.vc_col-has-fill {
width: auto;
}
Hope this helps!
add a comment |
In your HTML file there is a div that has a property: width: 66.66666667%;
. If you change this to width: auto;
, your issue will be resolved however it will get rid of the pink border around the text. If you add this line to your css file it should fix the alignment issue.
.wpb_column.vc_column_container.vc_col-sm-8.vc_col-has-fill {
width: auto;
}
Hope this helps!
In your HTML file there is a div that has a property: width: 66.66666667%;
. If you change this to width: auto;
, your issue will be resolved however it will get rid of the pink border around the text. If you add this line to your css file it should fix the alignment issue.
.wpb_column.vc_column_container.vc_col-sm-8.vc_col-has-fill {
width: auto;
}
Hope this helps!
answered Nov 14 '18 at 1:53
roberthayekroberthayek
185
185
add a comment |
add a comment |
Add display: flex;
to .full_section_inner
, just for medium devices, that should work!
@media only screen and (min-width: 768px) and (max-width: 992px){
.full_section_inner{
display: flex;
justify-content: center;
}
}
add a comment |
Add display: flex;
to .full_section_inner
, just for medium devices, that should work!
@media only screen and (min-width: 768px) and (max-width: 992px){
.full_section_inner{
display: flex;
justify-content: center;
}
}
add a comment |
Add display: flex;
to .full_section_inner
, just for medium devices, that should work!
@media only screen and (min-width: 768px) and (max-width: 992px){
.full_section_inner{
display: flex;
justify-content: center;
}
}
Add display: flex;
to .full_section_inner
, just for medium devices, that should work!
@media only screen and (min-width: 768px) and (max-width: 992px){
.full_section_inner{
display: flex;
justify-content: center;
}
}
edited Nov 14 '18 at 3:05
answered Nov 14 '18 at 0:47
MartinBAMartinBA
7161213
7161213
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53291524%2fcenter-div-on-tablets%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Possible duplicate of How to auto adjust the div size for all mobile / tablet display formats?
– First Name
Nov 14 '18 at 0:42
Post is a duplicate, search for responsive web pages, you need to include meta tags.
– First Name
Nov 14 '18 at 0:43
Matt, familiarize yourself with your browser's document inspector. This sort of thing is trivial to diagnose these days once you do.
– isherwood
Nov 14 '18 at 3:08