Reputation: 4762
My concept of "Responsive Web Design" is:
%
) rather than pixels (px
).After the common concepts I owned some concepts, now at this point, I'm confused of:
@media screen and (max-width: 800px) { /* do Media CSS here; */ }
, and add your NEW CSS for any of the element of your layout.style.css
I specified width of header .somediv{ width: 100%; }
, in 320px I can specify the width whatever I like to as @media screen and (max-width: 800px) { header .somediv{ width: 50%; } }
.img{ max-width: 100%; }
.Now for my satisfaction and progress through the responsive world, I want you to criticize me - what am I wrong about responsive CSS if I'm thinking like the above?
Or, I'm completely OK with the concept, then why my site is breaking in 320px while not on 800px, and I can't apply different CSS for 320px solely. Why I have to specify header height in 800px where it's applicable only in 320px?
Upvotes: 1
Views: 185
Reputation: 392
So it looks as though you are doing everything right, I can see issues with your site but only at say 640px
but 320px
looks fine for me.
When I first started responsive designs I found this website: http://css-tricks.com/
I opened up their CSS stylesheet and studied it and found out how they did it.
For reference sake I would advise looking at the following links on how to do responsive design:
With regards to getting the Media Queries I would strongly advise looking here:
There is people I know who still use php scripts to determine the users screen resolution and then load a specific CSS stylesheet which personally I would not recommend but that is also an option.
I personally would try changing your CSS to include the following:
@media only screen
and (max-width : 320px) {
#div1 {
width:100%;
}
}
The only way I have managed to get this working though is by either copying my whole CSS over again for that specific media screen or by only specifying the certain div's to change.
Remember you can re-declare the CSS styling for a DIV
or CLASS
further down the stylesheet
Hope this can be of some help to you.
Upvotes: 2