PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, July 23, 2022

[FIXED] How to set a max width for html div for mobile devices using css

 July 23, 2022     css, html, mdbootstrap, responsive-design, twitter-bootstrap     No comments   

Issue

On Desktop screens everything is responsive and okay. But on mobile devices content doesn't fit the screen, I have to swipe to the left to see all the content, is there anyway to fix that using CSS?

<div class="row mx-md-5 px-md-4 px-5 mt-3 container">
 <blockquote class="blockquote">

            <div class="mb-0">Quote...
            </div>

          </blockquote>

          <div class="article">
                 <h1>......</h1>
                   <img>
              <p>........</p>
              ...............
          </div>

        </div>

This just an example to work with. And btw I'm using Md-bootstrap as font end framework.


Solution

This div element has a width of 500px, and margin set to auto.

div.container {
  width:500px;
  margin: auto;
  
}



Answered By - Moin Syed
Answer Checked By - Mildred Charles (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing