iOS 16.6.1 / iOS 17 PWA CSS Darstellungsprobleme / CSS Issues

Hallo liebe Entwickler,


ist euch auch aufgefallen, dass seit iOS 16.6.1, einschließlich iOS 17 Stylesheets für die mobile Ansicht ignoriert werden?


Das ist mir nicht nur bei meiner Website aufgefallen, sondern auch auf anderen Websites. Es muss am Safari Browser liegen, denn Google Chrome gibt das Stylesheet ordnungsgemäß wieder. Gibt es dafür eine Lösung?


CSS Code:


.background-image-container.fade-out {
z-index: -1; /* Verschiebt das ausgeblendete DIV hinter andere Inhalte */
}

.fade-out {
opacity: 0; /* Fügt die Opacity hinzu, um auszublenden */
}

.background-image-container {
background-color:#f5f5f5;
position: fixed; /* Oder 'absolute', je nach Bedarf */
top: 69px;
left: 0;
width: 100%;
height: 100%;
z-index: 99999;
}

.background-image {
position: fixed;
top: 20%;
left: 0;
transform: translate(50%, 50%) scale(0.5); /* Hier kannst du die Skalierung anpassen */
width: 100%;
height: 100%;
background-image: url('/images/login-loader.svg');
background-position: center;
z-index: 9999;
display: flex;
justify-content: center;
align-items: center;
max-width: 50%; /* Begrenzt die Breite auf 100% des verfügbaren Bereichs */
max-height: 29%;
}

body {
font-family : Arial, sans-serif;
font-size : 14px;
background-color : #f5f5f5;
color: black;
}

.content {
top: 50%;
left: 50%;
width: 30em;
height: 18em;
transform: translate(-50%, -50%);
position: fixed;
border: 1px solid #ccc; /* Border style */
padding: 20px; /* Padding inside the box */
width: 300px; /* Set the desired width of the box */
margin: 0 auto; /* Center the box horizontally on the page */
background-color: #f9f9f9; /* Background color of the box */
border-radius: 5px; /* Add rounded corners to the box */
}

img.logo {
position: fixed;
top: 30px;
left: 87%;
transform: translateY(-50%);
z-index: 2;
}

.failed-login-message {
position: fixed; 
top: 175px; 
margin-bottom: 20px; 
left:75px; 
color: red;
}

h1 {
font-size : 24px;
font-weight : bold;
margin : 0;
padding : 20px;
padding-left: 70px;
background-color : #009688;
color : #fff;
left : 0;
top : 0;
position : fixed;
width : 100%;
z-index : 1;
user-select : none;
}

form {
margin : 20px;
}

input[type="text"], select {
padding : 10px;
font-size : 14px;
border : #ccc solid 0;
margin : 10px 0;
width : 100%;
box-sizing : border-box;
border-radius : 20px;

}
input[type="text"] {
background-color : #f0f0f0;
color : green;
border-radius : 20px;
transition : all 0.3s ease-in-out;
}

input[type="text"]:hover, input[type="text"]:focus {
background-color : white;
color : black;
transition : all 0.3s ease-in-out;
}

input[type="password"], select {
padding : 10px;
font-size : 14px;
border : #ccc solid 0;
margin : 10px 0;
width : 100%;
box-sizing : border-box;
border-radius : 20px;
background-color: #f0f0f0;
}

input[type="password"]:hover, input[type="password"]:focus {
background-color : white;
color : black;
transition : all 0.3s ease-in-out;
}

label {
display : block;
margin : 10px 0;
font-weight : bold;
font-size:20px;
color: #009688;
}
		
button[type="submit"] {
background-color : #009688;
color : #fff;
border : none;
padding : 10px;
margin-top: 50px;
font-size : 14px;
font-weight: bold;
border-radius : 3px;
cursor : pointer;
width: 100%;
border-radius : 20px;
transition : all 0.3s ease-in-out;
}

button:hover {
background-color : red;
}


Am CSS habe ich nichts verändert. Das Problem ist nach dem iOS Update von 16.6 auf 16.6.1 erstmalig aufgetreten. In iOS 16.6.1 wurde das CSS immerhin noch richtig direkt im Browser dargestellt, dafür nicht in der PWA. Seit iOS 17 wird es in beiden Fällen nicht mehr richtig, bzw. gar nicht dargestellt, als wäre kein CSS vorhanden.


Mag sein, dass mein CSS nicht optimal ist, hat aber bis JETZT problemlos funktioniert. Ich finde im CSS keinen Fehler. Wie gesagt, Google Chrome kommt weiterhin mit dem CSS klar und Safari hatte bis zum iOS Update keine Probleme. Wurde etwas im Safari Browser verändert?


Ich freue mich auf eure Kommentare und viele Grüße!

iPhone X

Gepostet am 19. Sept. 2023 15:21

Antworten
5 Antworten

20. Sept. 2023 15:07 als Antwort auf mjolredark274

Ich hab’ mir mal den Spaß gemacht, da etwas aufzuräumen (und einen vermutlichen Fehler dabei zu brereinigen). (Etwas aufräumen, umfassend ist das sicherlich nicht!)

Mit der Funktion oder Nicht-Funktion hat es vmtl. nichts zu tun. Aber vielleicht gibt’s Anregungen?)

:root { /* da das DOM nicht bekannt ist, „lokal“ wäre besser! */
	--bg0: #009688;
	--bg5: #f5f5f5;
	--box-color: #f9f9f9;
	--bgc: #ccc;
	--bgf: #fff;
	--bgf0: #f0f0f0;
}

.fade-out {
	opacity: 0; /* Fügt die Opacity hinzu, um auszublenden */
}

.background-image-container {
	background-color:var(--bg5);
	position: fixed; /* Oder 'absolute', je nach Bedarf */
	inset-block-start: 69px;
	inset-inline-start: 0;
	inline-size: 100%;
	block-size: 100%;
	z-index: 99999;
	&fade-out {
		z-index: -1; /* Verschiebt das ausgeblendete DIV hinter andere Inhalte */
	}
}

.background-image {
	position: fixed;
	inset-block-start: 20%;
	inset-inline-start: 0;
	transform: translate(50%, 50%) scale(0.5); /* Hier kannst du die Skalierung anpassen */
	inline-size: 100%;
	block-size: 100%;
	background-image: url('/images/login-loader.svg');
	background-position: center;
	z-index: 9999;
	display: flex;
	justify-content: center;
	align-items: center;
	max-inline-size: 50%; /* Begrenzt die Breite auf 100% des verfügbaren Bereichs */
	max-block-size: 29%;
}

body {
	font-family: Arial, sans-serif;
	font-size: 14px;
	background-color: var(--bg5);
	color: black;
}

.content {
	inset-block-start: 50%;
	inset-inline-start: 50%;
	inline-size: 30em;
	block-size: 18em;
	transform: translate(-50%, -50%);
	position: fixed;
	border: 1px solid var(--bgc); /* Border style */
	padding: 20px; /* Padding inside the box */
	inline-size: 300px; /* Set the desired width of the box */
	margin: 0 auto; /* Center the box horizontally on the page */
	background-color: var(--box-color); /* Background color of the box */
	border-radius: 5px; /* Add rounded corners to the box */
}

img.logo {
	position: fixed;
	inset-block-start: 30px;
	inset-inline-start: 87%;
	transform: translateY(-50%);
	z-index: 2;
}

.failed-login-message {
	position: fixed; 
	inset-block-start: 175px; 
	margin-block-end: 20px; 
	inset-inline-start:75px; 
	color: red;
}

h1 {
	font-size: 24px;
	font-weight: bold;
	margin: 0;
	padding-inline: 70px 20px;
	background-color: var(--bg0);
	color: var(--bgf);
	inset-inline-start: 0;
	inset-block-start: 0;
	position: fixed;
	width: 100%;
	z-index: 1;
	user-select: none;
}

form {
	margin: 20px;
}

input[type="text"] {
	background-color: var(--bgf0);
	color: green;
	border-radius: 20px;
	transition: all 0.3s ease-in-out;
}

input[type="password"], select { /* das "text" sah an der Stelle für mich nach einem Fehler aus … */
	padding: 10px;
	font-size: 14px;
	border: var(--bgc) solid 0;
	margin-inline: 10px;
	margin-block: 0;
	width: 100%;
	box-sizing: border-box;
	border-radius: 20px;
	/* … der dazu führt, daß man hier zusammenlegen kann */
	background-color: var(--bgf0);
	&:is(:hover, :focus) {
		background-color: white;
		color: black;
		transition: all 0.3s ease-in-out;
	}
}

label {
	display: block;
	margin-inline: 10px;
	margin-block: 0;
	font-weight: bold;
	font-size:20px;
	color: var(--bg0);
}

button {
	&[type="submit"] {
		background-color: var(--bg0);
		color: var(--bgf);
		border: none;
		padding: 10px;
		margin-block-start: 50px;
		font-size: 14px;
		font-weight: bold;
		border-radius: 3px;
		cursor: pointer;
		inline-size: 100%;
		border-radius: 20px;
		transition: all 0.3s ease-in-out;
	}
	&:hover {
		background-color: red;
	}
}

20. Sept. 2023 12:38 als Antwort auf mjolredark274

Es tut mir leid, wenn der Hinweis auf das Entwickler Forum nicht die gewünschte Hilfestellung für dich darstellt.


Aber begann deine Begrüßung nicht mit „Hallo liebe Entwickler“ , diese Entwickler sind im besagtem Forum Apple Developer Forums zu finden. Hier in dieser Apple Community sind es unterschiedlich versierte Apple Anwender, die versuchen zu helfen.


Eine kleine Bitte, zur besseren Darstellung hält der Editor der Forensoftware, sogenannte Code-Tags vor.

Beste Grüße und viel Erfolg!


Dieser Thread wurde vom System oder dem Community-Team geschlossen. Du kannst alle Beiträge positiv bewerten, die du hilfreich findest, oder in der Community nach weiteren Antworten suchen.

iOS 16.6.1 / iOS 17 PWA CSS Darstellungsprobleme / CSS Issues

Willkommen in der Apple Support Community
Ein Forum, in dem Apple-Kunden sich gegenseitig mit ihren Produkten helfen. Melde dich mit deinem Apple Account an, um Mitglied zu werden.