1

私が作業しているWebサイト(http://tinyurl.com/ax68brt)の背景画像が携帯電話のブラウザで正しく表示されません。この問題は、outheader、outbeurzen、およびouttwitterdivで発生します。ヘッダーの背景が100%の幅で表示されず、outbeurzen /outtwitterdivの背景も正しく表示されません。

ここで何が問題になっていますか?

HTML:

<div id="outheader"></div>
<div id="outintro"></div>
<div id="outbeurzen"></div>
<div id="outfoto"></div>
<div id="outtwitter"></div>
<div id="outfooter"></div>

Css:

#outheader {
background-image: url(images/achtergrond/header.jpg);
float: left;
height: 660px;
width: 100%;
background-attachment: fixed;
background-repeat: no-repeat;
background-position: 50% 0px;
margin: 0px;
padding: 0px;}

    #outintro {
background-image: url(images/achtergrond/body.jpg);
float: left;
height: auto;
width: 100%;
background-attachment: fixed;
background-repeat: repeat-y;
background-position: 50%;
padding-top: 60px;
padding-bottom: 60px;
    }

    #outbeurzen {
background-image: url(images/achtergrond/beurzen.jpg);
float: left;
height: 315px;
width: 100%;
background-attachment: fixed;
background-repeat: no-repeat;
background-position: 50% -300px;
    }

    #outfoto {
background-image: url(images/achtergrond/body.jpg);
float: left;
height: auto;
width: 100%;
background-attachment: fixed;
background-repeat: repeat-y;
background-position: 50%;
margin-bottom: 70px;
margin-top: 70px;
    }

    #outtwitter {
background-image: url(images/achtergrond/twitter.jpg);
float: left;
height: 315px;
width: 100%;
background-attachment: fixed;
background-repeat: no-repeat;
background-position: 50%;
font-family: 'Roboto Condensed', sans-serif;
    }

    #outfooter {
background-image: url(images/achtergrond/body.jpg);
float: left;
height: 240px;
width: 100%;
background-attachment: fixed;
background-repeat: repeat-y;
background-position: 50%;
    }
4

2 に答える 2

5

background-attachment: fixed;モバイルブラウザでは使用しないでください。バグが多く、再描画にはコストがかかりすぎます。feを参照してください

Android / Mobile Webkit CSSの背景-添付ファイル:機能しない問題を修正しましたか?また

https://twitter.com/paul_irish/status/306818591196602368

<meta name="viewport" … >また、サイトに(Viewport meta)タグがありません。https://developer.mozilla.org/en-US/docs/Mobile/Viewport_meta_tagを参照してください。

于 2013-03-03T23:17:32.070 に答える
0

htmlヘッダ部にmetaタグを付与。

 <meta charset="utf-8">
 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
于 2015-06-01T09:54:50.517 に答える