Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.7k views
in Technique[技术] by (71.8m points)

css - Bootstrap weird behavior on screen width smaller than 480px

I have this website working as expected on desktop and wider devices, however when viewing on screens smaller than about 480px, it looks like the body width gets scaled down.

It gets worse as the screen gets smaller: This is the problem

Because the CSS is so huge and multiple files get combined, I wouldn't even know what code to post here.

Hopefully someone can find the problem by having a look: http://www.sportbijwillem.nl

I appreciate any help.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

There are multiple mistakes:

  1. You have commented out width: 100%; of the img with class .badgeback. The Image should have the width: 100%;.
  2. .badgehead and .badgetext have fixed width of 390px, which is wider than the viewport. Try giving width in percentage. Like give both width: 100%;
  3. .badgehead and .badgetext also have fixed left value left: 249px; which is very very high, thus they push the content out. Try giving them left: 180px;.

Second and Third should only be followed with media queries.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...