0

The CSS code is:

li.block1 img {
    display: block;
    margin: 0 auto 0 auto;
}​

I have tried removing the li and making it .block img. I have tried removing img and only having li.block. I tried changing block to block1. I even tried changing margin: 0 auto 0 auto to just margin: auto. Nothing changes. The CSS validator returns the error "Parse Error [ ]". It doesn't even tell me what the error is or show me the offending code. I have checked the document to see if there is some unusual non-displayed character there, and there is none. The error disappears if I remove this entire piece of the style code.

The HTML part doesn't have any issue at all.

Here is the entire STYLE block:

<STYLE>
  body {
    background-color: #103872;
    color:lightseagreen;
    font-family:verdana;
  }
  a:link {
    color:seagreen;
    text-decoration:none;
  }
  a:visited {
    color:seagreen;
  }
  a:hover {
    color:seagreen;
  }
  a:active {
    color:seagreen;
  }
  p {
    text-align:justify;
  }
  li.block1 img {
    display: block;
    margin: 0 auto 0 auto;
  }​
</STYLE>

Edit: Here's the HTML that uses this code.

<LI class="block1">If everything goes well, you will get this when the installation is complete: <IMG style="padding-top:10px; padding-bottom:10px; height:50%; width:50%" src="Images/complete.png" alt="Installation Complete image"></LI>

What do I do to fix this?

TylerH
  • 20,799
  • 66
  • 75
  • 101
WayneCa
  • 157
  • 8
  • That is the point. It isn't telling me what the error is. Just Parsing Error [ ]. The code works as far as the html part working. It's just the validation that's failing and I don't know why. – WayneCa Sep 04 '20 at 14:58
  • Do you mean the html that uses it? I can do that, but that isn't what's giving the error. It's the CSS validation that's failing, not the HTML validation. – WayneCa Sep 04 '20 at 15:01
  • @WayneCa We can not see the same error without having to look at the HTML. So that we can see the same error. In the question it look okay. – Always Helping Sep 04 '20 at 15:02
  • Maybe there is an character code that is displayed as whitespace. Did you try to remove this piece of css and then typ it by hand (not using caopy/pste or something like that) – bron Sep 04 '20 at 15:04
  • maybe have STYLE as lower-case style? – nihiser Sep 04 '20 at 15:04
  • the case of the style tag is not important. html is case-insensitive. I have added the html that uses the code, but again, the html validation is not what's failing. It's the css validation that's failing. – WayneCa Sep 04 '20 at 15:05
  • THe error is Error: Parse Error. At line 26, column 5 n: 0 auto;↩ }​↩ so after – MaxiGui Sep 04 '20 at 15:07
  • @WayneCa if you run into this again, i just found a validator - https://jigsaw.w3.org/css-validator/validator – nihiser Sep 04 '20 at 15:09
  • li.block1 is class"block1". The li can be removed and it works the same. The img is not using it, but I had left that there. I copied this from another page and did little changing to it. It wasn't my code initially. What it does is center the image in the LI without centering the text that occurs in the same list. – WayneCa Sep 04 '20 at 15:19

2 Answers2

3

There's a "gremlin", an invisible character, after the closing brace. Delete that and it validates fine.

ray
  • 26,557
  • 5
  • 28
  • 27
2

Some words for you.

You are calling the li in your css but in your html says LI... is just different

There is an invisible character U+200B at the end of the closing brace, delete it. You can view invisible characters here: https://www.soscisurvey.de/tools/view-chars.php

The equivalent of saying

margin: 0 auto 0 auto;

is

margin: 0 auto;