2017-12-09 1 views
-1

Wenn ein Element größer als ca. ist. 400 px (hier das grüne div) das Element mit Position: fixierte Stopps werden fixiert. In Firefox Mobile ist es in Ordnung. "Überlauf: versteckt oder scrollen" hilft nicht.Position: behoben funktioniert nicht in Chrome Mobile

dies ist mein Code:

<!-- <!doctype html> 
<html> 
<head> 
<meta charset="utf-8"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0"> 
<title>fix test</title> 
<style> 
body { 
    margin: auto; 
    max-width: 900px; 
} 
.fix { 
    position: fixed; 
    top: 110px; 
    background-color: orange; 
} 
.large { 
    width: 650px; 
    height: 88px; 
    background-color: green; 
} 
</style> 
</head> 

<body> 
<div class="fix"> 
    <h1> should be fixed </h1> 
</div> 
<h1>sample text</h1> 
<h1>sample text</h1> 
<h1>sample text</h1> 
<h1>sample text</h1> 
<div class="large"></div> 
<h1>sample text</h1> 
<h1>sample text</h1> 
<h1>sample text</h1> 
<h1>sample text</h1> 
<h1>sample text</h1> 
<h1>sample text</h1> 
<h1>sample text</h1> 
<h1>sample text</h1> 
<h1>sample text</h1> 
<h1>sample text</h1> 
<h1>sample text</h1> 
<h1>sample text</h1> 
<h1>sample text</h1> 
<h1>sample text</h1> 
</body> 
</html> 
--> 

Was kann ich tun. Ich möchte einige Bilder mit mehr als 400 Pixel haben.

hier ist mein Beispiel: my link

Antwort

0

Seine Arbeit für mich sieht es so nicht funktioniert, weil die Körpergröße zu groß ist, in dem mobilen Gerät angezeigt werden soll. versuchen Sie, [top: 0] in Ihrer Fixklasse zu verwenden und den Unterschied zu sehen.

+0

Rap, danke, aber top: 0 hilft nicht. Wie gesagt, das Problem besteht nur in Chrome Mobile. –

Verwandte Themen