Question

In: Computer Science

Which part of an HTML5 file specifies the document language? The document character set? The document...

Which part of an HTML5 file specifies the document language?
The document character set?
The document character encoding?
For all 3 question above show the HTML code.


Consider UTF-8 and UTF-16 character encodings. Why do we say
UTF-8 is ASCII preserving.


Are there situations when a correctly specified table has rows
containing different number of td elements?
Explain.


Using notepad ++ Practice row and column spanning by creating an HTML table to
present the mirror image of the following:

<table style = "width: 120px; text-align: center">

<tbody>

<tr> <td colspan="2"

style="background-color:red;height:40px">A</td>

<td rowspan="2"

style="background-color: cyan">B</td></tr>

<tr><td rowspan="2"

style = "background-color: yellow">C</td>

<td style="background-color: green;

color white; height: 40px">D</td></tr>

<tr><td colspan="2"

style="background-color: blue;

color: white; height 40px">E</td></tr>

</tbody>

</table>

Solutions

Expert Solution

The language of the HTML document can be declared in different ways in the <html> tag.

1. using lang attribute

Eg: 1.

<!DOCTYPE html>

<html lang="en-US">

<body>

</body>

</html>

Eg: 2.

<!DOCTYPE html>

<html lang="fr">

<body>

</body>

</html>

The first two letters specify the language (en). If there is a dialect, use two more letters (US).

2. Using xml:lang attribute.

Eg:-

<html lang="fr" xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml">

Note:-

If you are serving your page as XML, do not need the lang attribute.

Eg:-

<html xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml">

3. In addition to the lang also possible to specify the language by using meta elements and an HTTP header

For single language

Eg:- <meta http-equiv="Content-Language" content="en">  

For multiple languages

Eg:- <meta http-equiv="Content-Language" content="de, fr, it">

HTML charset Attribute/character encoding

The character encoding standard, also called character set.

To display an HTML page correctly, a web browser must know the character set used in the page.

The default character encoding for HTML5 is UTF-8.

The default character encoding for HTML4 was ISO-8859-1.

UTF-8 (Unicode) covers almost all of the characters and symbols in the world.

Eg:- <meta charset="UTF-8">


UTF-8 encodes all characters into 8 bits like ASCII. A UTF-8 file containing only ASCII characters has the same encoding as an ASCII file. UTF-16 is better where ASCII is not predominant, since it uses 2 bytes per character, primarily.

--------------------------------------------------------

There may be situations like table has rows containing different number of td elements.

The better way to handle this is use of colspan which align the content in single td by merging multiple td s..

Eg:- <td colspan="2">Sum: $180</td>

This will include/display the entire content in the single td, also it will align the table properly.


Related Solutions

What are the three main parts of an HTML5 document?
What are the three main parts of an HTML5 document?
language c++(Data structure) You have to read a file and store a data in character array...
language c++(Data structure) You have to read a file and store a data in character array ( you cant initialize a character array, you have to code generically) code must be generic u must read a file onece u cant use built in function etc string, code in classes if u initialized a char array or ur code doesn't run i will dislike and report u you can use link list to store data
Use HTML5 to create a document that contains the following text: Internet and World Wide Web...
Use HTML5 to create a document that contains the following text: Internet and World Wide Web How to Program: Fifth Edition Welcome to the world of Internet programming. We have provided coverage for many Internet-related topics. Use h1 for the title (the first line of text), p for text (the second and third lines of text). Insert a horizontal rule between the h1 element and the p element. Open your new document in a web browser to view the marked-up...
Use the data set attached. Include your SPSS output in this document as part of Step...
Use the data set attached. Include your SPSS output in this document as part of Step 3. Test for the significance of the correlation coefficient at the .05 level using a two-tailed test between hours of studying and grade. Hours of Study Grade 0 80 5 93 8 97 6 100 5 75 3 83 4 98 8 100 6 90 2 78
​​​​​​​LANGUAGE IS JAVA Part One A hotel salesperson enters sales in a text file. Each line...
​​​​​​​LANGUAGE IS JAVA Part One A hotel salesperson enters sales in a text file. Each line contains the following, separated by semicolons: The name of the client, the service sold (such as Dinner, Conference, Lodging, and so on), the amount of the sale, and the date of that event. Prompt the user for data to write the file. Part Two Write a program that reads the text file as described above, and that writes a separate file for each service...
Please use markup language HTML5 please. For this homework assignment, you will create a Web site...
Please use markup language HTML5 please. For this homework assignment, you will create a Web site made up of three different pages and links between those pages Index.htm The Web pages in a site should have a similar look-and-feel. For this site, you should create a simple menu as follows: Create a horizontal line across the very top and bottom of the page. Also on the home (Index) page, create links to the other two pages. The links should appear...
Which one of the following is not one of the new HTML5 semantic elements?
QUESTION 16Which one of the following is not one of the new HTML5 semantic elements?chapterarticlesectionasideQUESTION 17Which of the following is the name for the file used for the "home page" of a website?All of these are correcthome.htmindex, htmldefault.aspQUESTION 18Which of the following are the opening and closing delimiters of an HTML5 entity?& and ;& and !I and ;< and >QUESTION 19One method that we can use so that common markup will be placed in several of our web pages is...
Which of the following refers to a statute which specifies the time period in which a...
Which of the following refers to a statute which specifies the time period in which a person must bring a lawsuit? Group of answer choices a. statute of frauds b. statute of claims c. statute of limitations d. statute of estoppel
Use C language Write a program that reads in a series of lines of input character...
Use C language Write a program that reads in a series of lines of input character by character (using getchar()). The first line of the input contains an integer which specifies the number of remaining lines of input, each of which contains a floating point number. The integer value on the first line can be read with scanf(), but all of the following lines can only be read with getchar(). Each line after the first contains a single floating point...
Create a CodeBlocks project with a main.cpp file. Submit the main.cpp file in Canvas. C++ Language...
Create a CodeBlocks project with a main.cpp file. Submit the main.cpp file in Canvas. C++ Language A Game store sells many types of gaming consoles. The console brands are Xbox, Nintendo, PlayStation. A console can have either 16 or 8 gigabytes of memory. Use can choose the shipping method as either Regular (Cost it $5) or Expedite (Cost is $10) The price list is given as follows: Memory size/Brand Xbox Nintendo PlayStation 16 gigabytes 499.99 469.99 409.99 8 gigabytes 419.99...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT