网站在移动设备上不显示任何 CSS 样式

问题描述

大家好,我对 HTML 等完全陌生。 我一整天都在努力使我的网站成为一个有趣的项目。 在桌面上一切正常,但在移动设备上它不接受单个 CSS 更改。 (背景、图片上的文字、文字颜色等) 我希望你能帮助我。 我的主页是:https://julianjonathanjohnson.ch/

  What have I tried so far: 
- images reduced to far below 5Mb
- body{background:green}
body:after{content: "mobile"}


@media screen and (min-width:481px){
    body{background:blue}
    body:after{content: "481px and larger"} 
}
@media screen and (min-width:769px){
    body{background:red}
    body:after{content: "769px and larger"} 
}

我的 HTML 是:(我认为是一团糟,但对我来说是混乱的:D)

<!DOCTYPE html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title> DogeWall </title>
    
    <script src="js.js"></script>
    
    <link rel="stylesheet" href="CSS.css"> 

    
</head>



<body id="page-wrap">
  
 <h1>Hello dear DOGE HODLER <br> Welcome to DogeWall <br> the hall of fame <br> for the first to walk on the moon.</h1>


        <ol>
<li class="P1">
         
<div class="TxtBild1">
        
        <img src="Bilder/MoonBg.jpg"  width="500" height="300">
        <span> <strong> citation example: Name: Date:  <br>
        <em> "To the moon and much further"</em></strong> </span>
        <span1> <ul>
            <strong>I take with me <br> to the MOON: </strong> 
            <li>Toiletpaper</li>
            <li>Fish snacks</li>
            <li>Bulldozer</li>
            <li> I donated <br> xxxyyz DOGE</li>
        </ul> </span1></div></li>
        
        <li class="P2">
         
<div class="TxtBild2">
        
        <img src="Bilder/MoonBg.jpg"  width="500" height="300">
        <span> <strong> citation example: Name: Date:  <br>
        <em> "To the moon and much further"</em></strong> </span>
        <span2> <ul>
            <strong>I take with me <br> to the MOON:</strong> 
            <li>Toiletpaper</li>
            <li>Fish snacks</li>
            <li>Bulldozer</li>
            <li> I donated <br> xxxyyz DOGE</li>
        </ul> </span1></div></li>
    
    </ol></body></html>

我的 CSS 是:

#page-wrap {
    width: 800px;
    margin: auto;
}

body {
    background-image:url("Bilder/MoonBg.jpg") ;
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
   
    color: bisque;
    
    
}
h1 {
    text-align: center;
}
.TxtBild1 {
    width: 500px;
    height: 300px;
    position: relative;
    border: 5px solid rgb(0,0);
    
    
}
.TxtBild1 span {
    background-color: silver;
    background-color: hsla(0,0%,100%,0.5);
    position: absolute;
    bottom: 5%;
    width: 100%;
    height: 20%;
    line-height: 2em;
    text-align: center;
    font-family: Garamond,serif;
  border-radius: 50%;
    
}
.TxtBild1 img{
    display: block;
    
}
span1 {
    position: absolute;
    top: 0;
    line-height: 2em;
    text-align: center;
    font-family: Garamond,serif;
  border-radius: 50%; 
}


.TxtBild2 {
    width: 500px;
    height: 300px;
    position: relative;
    border: 5px solid rgb(0,0);
    
    
}
.TxtBild2 span {
    background-color: silver;
    background-color: hsla(0,serif;
  border-radius: 50%;
    
}
.TxtBild2 img{
    display: block;
    
}
span2 {
    position: absolute;
    top: 0;
    line-height: 2em;
    text-align: center;
    font-family: Garamond,serif;
  border-radius: 50%; 
}

PS:我的项目的计划是它在任何地方都应该看起来像在桌面上一样简单。

我希望能够轻松复制带有文字的单个图像,但仍然可以轻松更改它们的颜色、背景等,因此我认为我目前的混乱外观方法很容易改变。

友好的问候朱利安

编辑: 问题找到了,很有趣,代码一切正常,我的移动设备有问题,其他手机运行良好,当我在手机上使用 icognito 时,它也运行了,最后是谷歌选项的问题。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)