The quoted text below (a mock forum question) has some errors in it. All you have to do is spot as many errors as you can and list them in your reply. They may include such things as grammatical mistakes and/or errors or potential problems in the code.

There is extra credit for explaining why something is an error. The winner will be the person who spots the most errors, or who gives the best explanation of what the errors are. (So don't be discouraged if someone beats you to it. Just give a better explanation.)

The prize is a free SitePoint ebook.

The competition will only be open for about 24 hours, so you need to be quick.

Note

By "error" I'm not talking about preferences or stylistic choices. For example, "coler" is a misspelling, while "color" and "colour" are accepted alternatives. Likewise, while it may not be ideal to wrap an <h1> in a <div>, it's not strictly an error. (I've tried not to make too many rules, so just have fun with this, and let's see what happens!)

Tip

There are arguably at least 11 errors here.

I have a problem with the top div, Its supposed to be red, but its bacground color is not showing up. What am I missing.

htmlCode:

<div class="top">
<h1>My Site</hl>
</div>

css

#top {background: #0000ff;}
h1 {float: left;}

Edit:

OK guys, this competition is now over, though you are welcome to discuss the issues further. The winner is announced in post #27, with some comments on the various issues as well.

r937
—
2012-05-29T00:28:10Z —
#2

what a fantastic idea for a thread!!!

okay, i'll get the ball rolling...

the first error is that there is no SQL involved in the problem

ha ha, j/k

here's the first error...

the div has a class called "top" but the css specifies a style for an id selector called "#top"

in other words, that css will not apply to the div

edbrenner
—
2012-05-29T02:20:46Z —
#3

r937 said:

what a fantastic idea for a thread!!!

okay, i'll get the ball rolling...

the first error is that there is no SQL involved in the problem

ha ha, j/k

here's the first error...

the div has a class called "top" but the css specifies a style for an id selector called "#top"

in other words, that css will not apply to the div

So we already know that the CSS needs to be a '.' instead of '#'. The difference between a 'class' and a 'id'.

The reason the color doesn't show is that the 'property' should be 'background-color'.The 'hex code' in your example is 'blue'. The 'hex code' for 'red' is #ff0000.

I also see that your closing tag for the 'h1' is using a lowercase 'L' instead of a '1'.It should be <h1>My Site</h1>.

tebzil
—
2012-05-29T02:21:00Z —
#4

Error 1 - CSS has a declaration for an ID selector (#top) - but the div is set to a class of top - so the CSS will not apply to the divError 2 -The hex code for the color declared in the CSS is blue - therefore the background color will not show up as red (even when coded correctly)Error 3 - Its ... should be it's - Improper spelling of a contraction/usage of an apostrophe - it's is the contraction for "it is" - which is the proper usage in this sentenceError 4 - bacground... spelled incorrectly - the proper spelling of background is "Background" Error 5 -What am I missing. > Should be ... What am I missing? Improper usage of a period. All questions should end with a question mark.Error 6 -Its - as used in this sentence it uses improper capitalization. Coming after a comma, it should be a lower case "i".Error 7 -Improper usage of comma's in the sentence. The commas should wrap a part of a sentence that can be removed without changing the essential meaning of that sentence.Error 8 - H1 closing tag uses a small L instead of a 1 - this will cause the code to breakError 9 -This one may be arguable - but the first statement... I have a problem with the top div... should be .... I have a problem with the div with the class of "top".Error 10 -CSS declaration for background to set the color should be "background-color"

tonyhouse
—
2012-05-29T02:22:50Z —
#5

ralph_m said:

Spot the Error!

Hey folks, we have a fun, quick challenge for you.

The quoted text below (a mock forum question) has some errors in it. All you have to do is spot as many errors as you can and list them in your reply. They may include such things as grammatical mistakes and/or errors or potential problems in the code.

There is extra credit for explaining why something is an error. The winner will be the person who spots the most errors, or who gives the best explanation of what the errors are. (So don't be discouraged if someone beats you to it. Just give a better explanation.)

The prize is a free SitePoint ebook.

The competition will only be open for about 24 hours, so you need to be quick.

Note

By "error" I'm not talking about preferences or stylistic choices. For example, "coler" is a misspelling, while "color" and "colour" are accepted alternatives. Likewise, while it may not be ideal to wrap an <h1> in a <div>, it's not strictly an error. (I've tried not to make too many rules, so just have fun with this, and let's see what happens!)

Tip

There are arguably at least 11 errors here.

Hmmm - I managed 9:1 - Sentence run on. First sentence should end at "top div".2 - Its should be it is or it's3 - get rid of the comma after red4 - second its is possessive and should have an apostrophe5 - background spelled wrong6 - Last sentence is a question - should end with a question mark7 - CSS code - #top should be .top or the html code should be changed to id8 - CSS code - the hex code for red is #ff0000.9 - CSS code - the selector is background-color

Two potential issues but not really:1 - it can be argued that HTML and CSS should be in caps2 - the theoretical author of the post didn't leave their name.

Tony

pdmeyer
—
2012-05-29T02:23:15Z —
#6

Love it!

Okay, here's what I can see.

I have a problem with the top div, Its supposed to be red, but its bacground color is not showing up. What am I missing.

This should be to me:

I have a problem with the div classed "top". It's supposed to be red, but its background color is not showing up. What am I missing?

Problems are:- Specifying the div properly (in the event that there were more than one div containers)- Full stop after specifying the problem. (1 message, 1 sentence)- Its should be It's (It is)- background spelt wrong.- Last sentence is a question.

Other problems: - #top should be .top as this is a class- The h1 tag is not closed properly. It should be </h1> not </hl>- Background colour should be red (#ff0000) not blue (#0000ff).- Float should be placed in the top class as floating the h1 tag collapses the div. => .top {background: #ff0000; float: left;}

For some people, depending on how sophisticated the website is, the CSS should be structure like so to represent the HTML document

.top {background: #0000ff;}.top h1 {float: left;}

That way the h1 that is being used within that div, represents it properly.

that case it would be like this with the proper use of background-color property.

.top {background-color: #0000ff;}.top h1 {float: left;}

If there is 11 I like to know where lol.

CreedFeed
—
2012-05-29T02:25:55Z —
#8

The div has a class of "top" but the CSS is defining an id of "top". Based on the CSS defining an id of "top" and there is no id defined in the HTML, no styling will take place.

The div is supposed to be styled with a background color of red, but the only contents of the div is a floating h1. Because of the defined float of the h1, the height of the containing div essentially collapses on itself. To rectify, you'd need to clear the floating h1 or insert something else that is not floating within the div.

The intent of the problem was to make the "top" div have a background color of red, but the CSS defines a background of blue (#0000ff). Red is #ff0000.

delr2691
—
2012-05-29T02:28:19Z —
#9

1,2) I have a problem with the top div, Its (this should be "it's", a contraction of "it is," and with lower case given that it continues a sentence)3) I have a problem with the top div, it's supposed ... (that comma should be a colon -> :)4) but its bacground (this should be "background" or, better, background-color) color is not showing up.5) What am I missing. (that should end with a question mark: ?, given that it is a question)6) <h1>My Site</hl> (the closing tag should be h1 rather than hl (l as in loud)7)

#top {background: #0000ff;} the correct selector

is .top, given that the div has a top class assigned to it rather than an id "top"8) #[LEFT]top {background: #0000ff;} the color should be #ff0000 or "red," right now is a blue.9) html Code: Code: Repeated "Code:"

[/LEFT]

anekola
—
2012-05-29T02:35:43Z —
#10

Well the journalist in me wants to critique the description of the problem:1) It is a compound sentence. "I have a problem with the top div." Period.3) "it's" not "its"4) "background" is spelled wrong5) "What am I missing." is a question

With the code,6) #0000ff is blue, the coder wants red, which would be #ff00007) Because the h1 is floated, the div has no depth and thus won't display a background color.8) Also, why are we floating the h1 at all?9) Looks like the closing h1 is a lower case "L"

And of course, the previously mentioned; "top" should be a class in the CSS.

lillyanka
—
2012-05-29T02:37:37Z —
#11

I have a problem with the top div, Its supposed to be red, but its bacground color is not showing up. What am I missing.

html

<div class="top"> <h1>My Site</hl></div>css

top {background: #0000ff;}

h1 {float: left;}

Including misspellings, here's what I've found:

It should be "it's supposed to be red"

Also, it should be "it's" with a lowercase i, since it's located after a comma.

It should say "I have a problem with the top div:" since the explanation of the problem comes after that phrase

"Background" instead of "bacground"

There should be a question mark at the end of the first paragraph.

The <h1> tag is closed using </hl>

The div has a class of "top", but the CSS says "#top", which is why the background color isn't being applied. # is for IDs while . is for Classes.

The background color is supposed to be red, but #0000ff is blue

If the <h1> is being floated, div.top should have an overflow: hidden, or the float: left could be added to div.top instead of the <h1>

Instead of saying "the top div", it should say something like "div.top", so that there's no potential confusion with other divs in case there were others.

The word "Code" is repeated after HTML

HTML and CSS should be in uppercase

michael_ohio
—
2012-05-29T02:39:18Z —
#12

The first comma ("div,") should be a colon ("div;").2."Its" should not be capitalized.

"Its" should be "it is" (or "it's).

"bacground" should be "background".

"missing should be punctuated with a question mark (?), not a period (.).

css code #top shouldn't have a hash.

css code {background: ... } should be {background-color: ...}.

css code #0000ff is a dark blue, not red.

css code h1 {float: left;} won't work - you can't float the h1 tag - you need to float an object, like a div or an image (complete wag on my part - I'm not a coder!).

Bursh
—
2012-05-29T02:40:12Z —
#13

Typos in question"Its" should be "It's". "Its" is the possessive form, used when the object belongs to the subject in some way."bacground" should be "background". No explanation necessary there, presumably. Unless an etymology is required?

Grammatical error in question".. with the top div, Its ..." uses a comma in place of a full stop. Should be ".. with the top div. It's supposed ...""What am I missing." should be "What am I missing?". Needs a question mark to make it a question, rather than a statement.

Grammatical mistakes in titles of code samplesHTML and CSS should be capitalized, because they are acronyms of HyperText Markup Language and Cascading Style Sheets respectively.

Extraneous textBelow HTML, "Code:" is extraneous. It is automatically included with a code block.

H1 closing tag is actually HL (using upper case here to allow readers to avoid the ambiguity I'm talking about)The font here hides, at first glance, the fact that the close tag for the H1 actually says HL - which is not a tag. The H1 in opening tag and the CSS code do say H1, not HL. It looks like a 1 pixel difference.

Mismatch. Wrong HTML attribute or wrong selector.The HTML code specified as a div with a class "top" whilst the CSS specifies an identifier/id by that name. Of course, this will mean the desired background colour attributes won't be applied to the div as hoped. The solution here is to decide whether a class or id is in order. If it class, then the CSS selector should be changed to ".top". If it's an id that's needed, then the HTML attribute "class" should be changed for "id". It's not possible to make that judgement with the information given.

"background" declaration is incomplete, or used erroneously.The expected structure of the "background" property is:

Wrong hex codeThe user wants wants a red background. The hex code they use (as I mentioned) corresponds to blue. The correct values code would be "#FF0000", "red" and "rgb(255, 0, 0)".

8 out of a disputable 11. I'm happy with that. I couldn't see any more that seemed like they fit within the rules, but I suppose a couple of the ones I pointed out (like spelling errors) might be considered independent by others? I don't know.

a_elnajjar
—
2012-05-29T02:40:12Z —
#14

1- you have to use . for class selector not # id selector2- your hex color is blue not red the red color hex is #FF0000

ChasMan
—
2012-05-29T03:15:45Z —
#15

There should not be a comma after the word “div” in the first sentence as it is a complete statement. A period or semi-colon would be more appropriate.

The first occurrence of the word “Its” should have an apostrophe in it as the word is a contraction of the words “It is”.

There is a letter “k” missing in the misspelled word “bacground”.

The last sentence in the first paragraph poses a question, thus it should end in a question mark.

As it is an acronym, the letters “html” should all be capitalized.

The first occurrence of the word “Code”, along with its accompanying colon, should be on the same line as the acronym “HTML” since both words together describe the code that follows it.

The word “Code” referenced in the previous list item should not be capitalized as it is not part of a (sub-)heading. If it was a heading, there would not be a colon on the same line.

The second occurrence of the word “Code”, along with its accompanying colon, should be deleted as it is a duplication of the line above it (albeit indented).

The class in the HTML’s div should be an id; or, the id reference in the CSS should be a class.

As it is an acronym, the letters “css” should all be capitalized.

The third occurrence of the word “Code”, along with its accompanying colon, should be on the same line as the acronym “CSS” since both words together describe the code that follows it.

The word “Code” referenced in the previous list item should not be capitalized as it is not part of a (sub-)heading. If it was a heading, there would not be a colon on the same line.

The HEX code used in #top would produce a color of blue, not red. If red is the desired result, a HEX code of #ff0000, for example, should be used.

Unless there is some preceding CSS code not listed that would define otherwise, the h1 tag has a default width of 100% and a default alignment of left, thus floating it, be it left or right, would serve no purpose.

dilipsharma2005
—
2012-05-29T03:16:49Z —
#16

Error1. In code "top" is a class. But in Css it is defined with # which is not correct. # is used to define properties of a object defined with id , for class it should be started with a dot. "."

The property of top,Once it is defined as a Class in css with ".", next thing we need to correct is , we must define all properties , when use only background, If just color need to be set then background-color should be use.

ralph_m said:

Spot the Error!

Hey folks, we have a fun, quick challenge for you.

The quoted text below (a mock forum question) has some errors in it. All you have to do is spot as many errors as you can and list them in your reply. They may include such things as grammatical mistakes and/or errors or potential problems in the code.

There is extra credit for explaining why something is an error. The winner will be the person who spots the most errors, or who gives the best explanation of what the errors are. (So don't be discouraged if someone beats you to it. Just give a better explanation.)

The prize is a free SitePoint ebook.

The competition will only be open for about 24 hours, so you need to be quick.

Note

By "error" I'm not talking about preferences or stylistic choices. For example, "coler" is a misspelling, while "color" and "colour" are accepted alternatives. Likewise, while it may not be ideal to wrap an <h1> in a <div>, it's not strictly an error. (I've tried not to make too many rules, so just have fun with this, and let's see what happens!)

Tip

There are arguably at least 11 errors here.

dsimk2002
—
2012-05-29T03:33:44Z —
#17

ralph_m said:

Spot the Error!

Hey folks, we have a fun, quick challenge for you.

The quoted text below (a mock forum question) has some errors in it. All you have to do is spot as many errors as you can and list them in your reply. They may include such things as grammatical mistakes and/or errors or potential problems in the code.

There is extra credit for explaining why something is an error. The winner will be the person who spots the most errors, or who gives the best explanation of what the errors are. (So don't be discouraged if someone beats you to it. Just give a better explanation.)

The prize is a free SitePoint ebook.

The competition will only be open for about 24 hours, so you need to be quick.

Note

By "error" I'm not talking about preferences or stylistic choices. For example, "coler" is a misspelling, while "color" and "colour" are accepted alternatives. Likewise, while it may not be ideal to wrap an <h1> in a <div>, it's not strictly an error. (I've tried not to make too many rules, so just have fun with this, and let's see what happens!)

Tip

There are arguably at least 11 errors here.

Here is my answer1) First sentence should have a period after div.2) Its is supposed to be It's3) The comma after red doesn't need to be there4) bacground should be background5) "What am I missing should have a ? at the end6) Closing h1 tag should have the number 1 instead of the letter l7) #top should be .top since top is a class and not an id8) background should be background-color9) #0000ff is blue. It should be #ff0000; to be red10) float is used with block level elements. h1 tag is not a block level element.11) float should be used in the top class instead of h1. code should read .top {background-color: #ff0000; float: left;}

galvao
—
2012-05-29T03:33:51Z —
#18

Errors #1 and #2: On the initial phrase, where it reads: "Its supposed to be red" it should read "it's supposed to be red". Since it's part of a sentence the capitalization of the "I" is wrong. Also, it refers to a substantive so it should have the apostrophe indicating it.Errors #3 and #4: Same as before, the apostrophe is missing from the "its bacground", where it should read "it's". Also, the correct spelling is "background" and not "bacground".Error #5: "What am I missing" is a question and therefore it should end with a question mark rather than a dot.Error #6: HTML is an acronym (it means "Hyper Text Markup Language"), so all letters should be capitalized.Error #7: The closing tag at the second line of the HTML code should be "</h1>". It has a typo, so it reads "</hl>" (slash, lowercase letter H and lowercase letter L).Error #8: As in #6, CSS is an acronym (meaning "Cascading Style Sheets"), so all letters should be capitalized.Error #9: At the first line of the CSS code, "top" is syntatically indicated as an ID and not a class, so it should begin with a dot (".top", instead of "#top"). The opposite would also be true, so if the OP would like to implement "top" as an ID then he would leave the CSS code as is ("#top") and change the first line of it's HTML code to read: '<div id="top">'.Error #10: At the first line of the CSS code, the correct style name for setting a background color would be "background-color" and not "background".Error #11: The hexadecimal value of the style "background-color", as coded by the OP represents blue and not red. That is recognizable because the hexadecimal notation for colors in HTML and CSS represents the amount of the three primary colors in this specific order: Red, Green and Blue, being the hexadecimal value "FF" the maximum value and "00" the minumum (meaning the absence of the color). So the correct hexadecimal representation for the red color would be "#ff0000", meaning "maximum amount of red, no green and no blue".

ralphm
—
2012-05-29T03:36:06Z —
#19

Wow, you guys are good! You're picking up the sneaky things I stuck in there to catch you out. Keep the answers coming! You are also seeing things I didn't see.

estjohn
—
2012-05-29T03:36:50Z —
#20

Grammar"div," should have a period and not a comma after it because "div" ends the sentence.

"Its" should have an apostrophe because it represents a contraction.

"Its supposed" It is not pre-defined in that sentence and would refer to div tag. What is "It's" ? The div tag? The words "My Site" ? Misplaced modifier.

"bacground" should be spelled background.

"missing." should be "missing?" - punctuation asking a question

Code "0000ff" is blue and red is not specified in the CSS

the css shows #top { background: #0000ff; } when the actual solution should be #top { background-color: #0000ff; } if the browser does not support the former. Person does not state what browser this is in.