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
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...
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...
For c language. I want to read a text file called input.txt for example, the file...
For c language. I want to read a text file called input.txt for example, the file has the form. 4 hello goodbye hihi goodnight where the first number indicates the n number of words while other words are separated by newlines. I want to store these words into a 2D array so I can further work on these. and there are fewer words in the word file than specified by the number in the first line of the file, then...
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
Desc: Encrypts or decrypts a file. Input: The user supplies the character '1' to encrypt, or...
Desc: Encrypts or decrypts a file. Input: The user supplies the character '1' to encrypt, or '2' to decrypt via the keyboard.   The user also supplies the name of the source file via the keyboard.   Output: If the user wants to encrypt, the text in input file is encrypted and the encrypted text is stored in "encrypted.txt". The original file is not changed. If the user wants to decrypt, the text in input file is decrypted and the decrypted text...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT