Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New to the CF scene
    Join Date
    Sep 2019
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Find the errors in the following code and let me know.

    <html>
    <body bgcolor=”red”>
    <align = “right”> HTML stands for Hyper Text Markup Language
    HTML describes the structure of a Web page
    HTML consists of a series of elements
    HTML elements tell the browser how to display the content
    HTML elements are represented by tags
    </align>
    <BODY BACKGROUND=”ABCD.JPEG”>
    <CENTRE>HTML tags label pieces of content such as "heading", "paragraph", "table", and so on
    Browsers do not display the HTML tags, but use them to render the content of the page</CENTRE>
    <FRAMESET ROW=”10,20,30,40” COL = “50,50>
    <frame src=”a.html”>
    <frame src =b.html>
    </frameset>

  2. #2
    Administrator VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    11,410
    Thanks
    7
    Thanked 1,376 Times in 1,345 Posts
    Is this some kind of homework, or what? If so, please read rule 1.5 of the forum rules.

  3. #3
    New to the CF scene
    Join Date
    Sep 2019
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    "I am new to HTML and my daughter has this query. i tried and was able to solve the below:-
    Need your assistance to understand the same."

    <html>
    <body bgcolor=”red”>
    <align = “right”> HTML stands for Hyper Text Markup Language
    HTML describes the structure of a Web page
    HTML consists of a series of elements
    HTML elements tell the browser how to display the content
    HTML elements are represented by tags
    </align>
    <BODY BACKGROUND=”ABCD.JPEG”>
    <CENTRE>HTML tags label pieces of content such as "heading", "paragraph", "table", and so on
    Browsers do not display the HTML tags, but use them to render the content of the page</CENTRE>
    <FRAMESET ROWS=”10%,20%,30%,40%”>
    <FRAMESET COLS=" COL = “50%,50%">
    <frame src=”a.html”>
    <frame src =b.html>
    </frameset>
    </html>

  4. #4
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    3,596
    Thanks
    3
    Thanked 641 Times in 627 Posts
    Hi there Midhun1987,

    and a warm welcome to these forums.

    "I am new to HTML and my daughter has this query"
    In which case I woul suggest that you head straight here...


    ...and do not pass "GO".

    coothead
    ~ the original bald headed old fart ~

  5. #5
    Master Coder sunfighter's Avatar
    Join Date
    Jan 2011
    Location
    West Des Moines, Iowa
    Posts
    8,191
    Thanks
    38
    Thanked 1,091 Times in 1,087 Posts
    Hello Midhun1987,
    I take it the 1987 is the year that your code worked.It does not work today, because the <CENTRE> and the <FRAMESET> are deprecated and are no longer used.
    We also use CSS to style the HTML; which is where we would declare the background color of the body and the image we want to place there.
    You have two <body> tags and never close either.
    The skeleton layout of a web page is:
    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title>My Web Page</title>
    </head>
    
    <body>
    
    </body>
    </html>
    Please follow the link coothead has given you and learn modern HTML/CSS coding.
    Evolution - The non-random survival of random variants.
    Physics is actually atoms trying to understand themselves.

  6. #6
    New to the CF scene
    Join Date
    Sep 2019
    Location
    Canada
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You are not closing some tags of HTML and body tag will use one time
    Example of your code:

    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title>Page Title</title>
    </head>
    <body bgcolor=”red”>
    
    <div style="text-align:left;"> HTML stands for Hyper Text Markup Language
    HTML describes the structure of a Web page
    HTML consists of a series of elements
    HTML elements tell the browser how to display the content
    HTML elements are represented by tags
    </div>
    <CENTRE>HTML tags label pieces of content such as "heading", "paragraph", "table", and so on
    Browsers do not display the HTML tags, but use them to render the content of the page</CENTRE>
    <frameset ROW=”10,20,30,40” COL = “50,50>
    <frame src=”a.html”>
    <frame src =b.html>
    </frameset>
    </body>
    </html>
    Last edited by VIPStephan; Sep 16th, 2019 at 06:19 PM. Reason: added code BB tags

  7. #7
    Senior Coder deathshadow's Avatar
    Join Date
    Feb 2016
    Location
    Keene, NH
    Posts
    3,740
    Thanks
    5
    Thanked 536 Times in 522 Posts
    Lots of criticism, but no actual breakdown line-by-line of what was asked... so let's do that!

    Code:
    <html>
    No doctype before the HTML tag, and no language declaration.

    No <head> which has NOT been "optional" in HTML since 1996. Likewise no <title> or character encoding <meta>

    Code:
    <body bgcolor=”red”>
    "bgcolor" stopped being a balid attribute in HTML in 1998. That's CSS' job.


    Code:
    <align = “right”> HTML stands for Hyper Text Markup Language
    There is NO SUCH THING as an <align> tag, NEVER WAS!!! Somebody was just randomly making s*** up. Align was an attribute in legacy HTML, but again that derpitude was kicked to the curb twenty years ago and has ZERO business any HTML written since 1997. (unless it's for the mental midgetry of HTML e-mails).

    Good rule of thumb? If you choose ANY of your HTML tags based on what you want things to look like, you're doing it ALL WRONG!


    Code:
    <BODY BACKGROUND=”ABCD.JPEG”>
    A second <body> is ALWAYS invalid. That's not what BODY is or is for. Likewise that background attribute is more invalid junk from twenty year old coding. See that "rule of thumb" I just mentioned? Yeah, that.

    Code:
    <CENTRE>
    It's CENTER, not CENTRE... There's no such thing as <centre>, and <center>was deprecated twenty years ago and has ZERO business in HTML either.

    Code:
    <FRAMESET ROW=”10,20,30,40” COL = “50,50>
    <frame src=”a.html”>
    <frame src =b.html>
    </frameset>
    Framesets are invalid in everything except HTML 3.2 or "HTML 4 Frameset" documents. NEITHER of which have been mainstream standards for -- again -- two decades. No website written after 1998 really has ANY business using ANY of those tags. PERIOD.

    Also the BODY tags are not closed, with </body> NOT being optional any time after HTML 3.2 -- again two decades past.

    It all pretty much screams "learn HTML".
    “There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies.” – C.A.R. Hoare, The 1980 ACM Turing Award Lecture
    http://www.cutcodedown.com

  8. #8
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    3,596
    Thanks
    3
    Thanked 641 Times in 627 Posts
    Hi there alexjames,

    and a warm welcome to these forums.

    I think that you should check the validity
    of the code that you posted here...



    coothead
    ~ the original bald headed old fart ~

  9. #9
    Administrator VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    11,410
    Thanks
    7
    Thanked 1,376 Times in 1,345 Posts
    And what hasn’t been mentioned at all: quotes around attribute values should be straight quotes; in your code all quotation marks are so-called typographic quotes (a.k.a. “curly” or “smart” quotes). The strange thing is that they are inconsequential in their application, so I kinda doubt that this came from a rich text editor, but in any case, you should use a dedicated code editor or at least a plain text editor like Notepad on Windows or TextEdit on Mac, or at the very least, set whatever text editor you are using to plain text (as opposed to “rich text”) before writing code, and/or disable all auto correction.

  10. #10
    Senior Coder deathshadow's Avatar
    Join Date
    Feb 2016
    Location
    Keene, NH
    Posts
    3,740
    Thanks
    5
    Thanked 536 Times in 522 Posts
    Quote Originally Posted by VIPStephan View Post
    And what hasn’t been mentioned at all: quotes around attribute values should be straight quotes
    Ooh, good catch. My old man eyeballs couldn't even see that on the forums -- another reason "styled quotes" are idiotic nonsense that really don't belong in a standard character set -- REGARDLESS of what the print jockeys say.

    But what do I know? Since all my content is usually written in English I rarely if ever venture outside ASCII7 when it comes to writing copy.
    “There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies.” – C.A.R. Hoare, The 1980 ACM Turing Award Lecture
    http://www.cutcodedown.com


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •