Click here to Skip to main content
15,910,981 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I Have Question about container width How I can use full container width on mobile devices When I Open My Site In Mobile Extra Padding space come there?
here's my code

.th-container {
  margin: 0 auto;
  padding: 0 30px;
  max-width: 1200px;
}
@media (max-width: 768px) {
  .th-container {
    padding: 0 25px;
  }
}

#primary.content-area {
  float: left;
  width: 65.7894736842105%;
  max-width: 900px;
}
@media (max-width: 768px) {
  #primary.content-area {
    width: 100%;
    float: none;
  }
}


What I have tried:

I have tried some solutions now my website container is good.
thanks
Posted
Updated 16-Jan-20 18:28pm
v3
Comments
[no name] 13-May-19 15:07pm    
You have padding and widths.

Change everything to zero; change one at a time; observe; adjust.

1 solution

The container max-width:1200px in desktop if window screen size is greater then 1200px means the remain space will come in left and right side so it look like large space in left and right.
In mobile your are give 100% with padding so it occupy the full width and it take left and right padding 25px so space look like less compare to desktop.
If you give max-width:100% with padding left and right 25px in desktop also in mobile and desktop look like same space.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900