Skip to content Skip to sidebar Skip to footer

Responsive Layout For Mobile Tablet

I created an ecommerce page and added @media to make the page responsive. but its not working fine can you please take a look where I am doing mistake more over if my coding style

Solution 1:

EDITED AFER EDIT OF QUESTION AND COMMENTS:

First a general remark (from my original answer):

The usual way is to first define general rules which apply to all sizes and then (below that) define rules in media queries which overwrite some of the general rules.

This can be done with a mobile-first approach (where the general rules apply to mobile sizes and are then partly overwritten by desktio rules) or with a desktop-first apporach (where the general rules are for desktop and some of them overwritten for mobile sizes). I would NOT create three completely different sets of rules - it's just too much...


Now about your code: There are a lot of things I would change, but I won't recreate the whole page for you, so here is just a remark and answer to your last comment:

In the CSS for mobile you have this rule:

#home_category1_boxes3{
  width: 390px; position: absolute; height: 350px; margin-left: 577px; 
}

This means that a 390px wide container is placed 577px from the left border of its container/window, i.e. its right border will be 967px from the left border of the container. But that's inside a ruleset which only applies to screens below 768px width, so it is pushed out of the container by 200px - this simply cannot work. So, first of all, change that margin setting.

Actually, you shouldn't use position: absolute on those .home_category1_boxes containers - it makes them overlap and not-responsive in this case. Just erase that and try to create a regular flow of containers and elements.

Post a Comment for "Responsive Layout For Mobile Tablet"