括号中的代码颜色已更改

时间:2016-10-31 11:37:49

标签: html

为什么代码suddelny的颜色在html页面代码中间变为红色和绿色?编辑器是括号,它不会导致任何问题,除了它只是令人讨厌并使代码难以辨认:

https://i.stack.imgur.com/ohsLK.png

谢谢!

下面我粘贴index.html如果这对任何方面都有帮助

<!DOCTYPE html>
<html>
<html lang="pl-PL">

<head>

    <title>Strona Wojciech 12345</title>

    <!--Polskie znaki-->
    <meta charset="UTF-8">

    <!--CSS-->
    <link rel="stylesheet" type="text/css" href="style.css">


    <!--Fonty-->
    <link href="https://fonts.googleapis.com/css?family=Amatic+SC|Indie+Flower|Josefin+Sans|Lobster|Passion+One|Righteous|Shadows+Into+Light|Yellowtail" rel="stylesheet"> 



    </head>

<body>

    <div class="container">

        <!--Skrypty-->
        <script type="text/javascript">confirm("asdf?")
        <script type="text/javascript">
        <script type="text/javascript">prompt('podaj imie')</script>

         <div class="dropdown">
          <button onclick="myFunction()" class="dropbtn">Menu</button>
          <div id="myDropdown" class="dropdown-content">
            <a href="#">Link 1</a>
            <a href="#">Link 2</a>
            <a href="#">Link 3</a>
          </div>
        </div>




        <h1>
        Witaj na stronie
        </h1>

        <div class="floating-box">
            Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 
        </div>

        <div class="floating-box">
            Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
        </div>

        <div class="floating-box">
            Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
        </div>

        <div class="floating-box">
            Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
        </div>


        <div id ="firstdiv">
        Element sekcji jest imperatywnym elementem strony stworzonej w hipertekstowym języku znaczników HTML5 oraz kaskadowych arkuszach stylu CSS3
        </div>

        <section>
        <a href="https://www.google.pl/?gws_rd=ssl#q=html5" target="_blank"><img src="https://www.w3.org/html/logo/downloads/HTML5_Logo_512.png" height="80" width="80"></a>

        <a href="https://www.google.pl/?gws_rd=ssl#q=css3" target="_blank"><img src="http://jaspreetchahal.org/images/css3.svg" height="80 width="80"></a>
        </section>

        <p>Click the button to display a random number between 1 and 10.</p>

        <button onclick="myFunction()">Generate random number</button>

        <p id="demo"></p>

        <script>
        function myFunction() {
            var x = Math.floor((Math.random() * 10) + 1);
            document.getElementById("demo").innerHTML = x;
        }
        </script>

        <hr>

        <p>
            Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
        </p>

        <hr>

        <h3>Limes inferior...</h3>
        <div id = "seconddiv">
            "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.""Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
        </div>

        <hr>


        <div class="floating-box"><ul>
          <li>jedzenie</li>
          <li>spanie</li>
          <li>kodowanie</li>
        </ul></div>
        <div class="floating-box"><ul>
          <li>jedzenie</li>
          <li>spanie</li>
          <li>kodowanie</li>
        </ul></div>



        <!--skrypt menu-->

        <script>
        function myFunction() {
            document.getElementById("myDropdown").classList.toggle("show");
        }

        window.onclick = function(event) {
          if (!event.target.matches('.dropbtn')) {

            var dropdowns = document.getElementsByClassName("dropdown-content");
            var i;
            for (i = 0; i < dropdowns.length; i++) {
              var openDropdown = dropdowns[i];
              if (openDropdown.classList.contains('show')) {
                openDropdown.classList.remove('show');
              }
            }
          }
        }
        </script>
</div>

</body>

<footer>
 Stopka: Strona by Wojciech 2016
</footer>


</html> 

2 个答案:

答案 0 :(得分:1)

您的编辑器语法突出显示只是警告您。仔细查看您的第二个<img>代码。

height="80

你错过了第二个&#34;。

答案 1 :(得分:0)

其实问题不是img标签。问题是你错过的引号。

(高度=“80”符号表示此问题。) img标签不需要关闭标签。在崇高的编辑器中显示非常有助于识别错误。

示例:

<img src="images/example.png" />