css3 - Layout change after screen resize CSS -


i have various errors design.

first of all, here link example site have been doing learn html , css.

http://ramroweb.com/mnml/style.css

  • when screen size resized items container moves right. though used margin: 0 auto;
  • the whole content within div id="container" still selects upto section tag excluding footer tag.
  • the background image not fit whole size creating padding on top. great if these queries.

    thank you...

  • to responsive design try using percentages or vw/vh measurements. way elements relative sizes user screen size. it's practice make website mobile accessible, nicely fit in page when open on narrower screen. more here -> https://snook.ca/archives/html_and_css/vm-vh-units. example, check out code (obviously might want adjust scaling fit needs):

    body {     width: 100%;     background: url(img/beach.png) center no-repeat;     background-color: #f3f2de;     font-family: courier, monospace;     font-size: 15%;     margin: 0 auto; }  #container {     color: #cc0000;     margin: 0 auto;     width: 92%; }  header {     margin: 0 auto;     text-align: center;     border-bottom: solid 5% black; }  nav {  }  nav ul {     list-style: none; }  nav ul li {     display: inline-block;     padding: 0 10%;     margin: 0 20%;     font-weight: bold; }  header {     text-align: center;     padding: 10% 0; }  a:link {  }  a:visited {     color: #cc0000; }  a:hover {     color: #fff200; }  section {     margin: 30% 0 40%; }  section h1 {     text-align: center;     font-size: 1em; }  section {     display: block;     align-content: center;     height: 100%;     width: 50%;     margin: 0 auto;     margin-bottom: 30%; }  footer {     display: block;     float: left; } 

    Comments

    Popular posts from this blog

    php - How to display all orders for a single product showing the most recent first? Woocommerce -

    asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

    angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -