Question

In: Computer Science

What does the HTML tag designate in an HTML document?

What does the HTML tag designate in an HTML document?

Solutions

Expert Solution

HTML tags are hidden keywords that define how the web browser must format and display contents into a web page. Most tags have two parts: an opening and a closing part. There are a list of tags used in HTML.

1. New paragraph

The <p> tag is used to define a paragraph in HTML. Most browsers will display text even if you forget to close the paragraph tag.

The usage of <p> tag:

<p> ... </p>

Executable code:

<! DOCTYPE html>

<html>

<head> </head>

<body>

<p> This is a sample paragraph </p>

</body>

</html>

2. Personal Data

The <details> tag is used to specify additional details that the user can view or hide accordingly.

The usage of <details> tag:

<details>

<summary> ... </summary>

<p> ... </p>

</details>

Executable code:

<! DOCTYPE html>

<html>

<head> </head>

<body>

<details open>

<summary> Personal details </summary>

<p> the personal data is visible in the web site </p>

</details>

3. Print command

The print() method prints the contents of the current window.

The usage of print() method:

<script>

windows.print();

</script>

Executable code:

<! DOCTYPE html>

<html>

<head> </head>

<body>

<button onclick = "myfunction()">Print</button>

<script>

function myfunction(){

windows.print();

}

</script>

</body>

</html>

4. Show photo

The <img> tag is empty and does not have closing tag. It contains only attributes.

The src specifies the url of the image. You can use the image name (for saved images) or the complete url.

The usage of <img> tag:

<img src = "image1.jpg">

Executable code:

<! DOCTYPE html>

<html>

<head> </head>

<body>

<img src="image1.jpg">

</body>

</html>


Related Solutions

Your HTML document should contain the following elements/features: HTML tags: An <input> tag labeled "Timer Duration"...
Your HTML document should contain the following elements/features: HTML tags: An <input> tag labeled "Timer Duration" with the initial value 0 A <button> tag labeled "Start" Script: When the user presses the button (1b), a function will begin that does the following: Reads the value from the input field (1a) Removes the <input> and <button> tags (1a & 1b) Creates a new <p> tag, initialized to show the input value Starts a timer that ticks down to zero. For every...
CSS Write a document wide style block (include the correct HTML tag) to set all <p>...
CSS Write a document wide style block (include the correct HTML tag) to set all <p> tags to be double spaced and justified (not ragged left / right text)
How does the use of the HTML5 <nav> tag differ from previous versions of HTML when...
How does the use of the HTML5 <nav> tag differ from previous versions of HTML when creating navigation?
lab3 exercise 5 html <!DOCTYPE html> <!-- Webpage HTML document for Lab 03.   Author: Amir H...
lab3 exercise 5 html <!DOCTYPE html> <!-- Webpage HTML document for Lab 03.   Author: Amir H Chinaei   For: EECS 1012, York University, Lassonde School of Engineering --> <html lang="En"> <head>   <meta charset="UTF-8">   <title> EECS1012: Lab 3 - My Kit </title>   <!-- in Ex1, add a link tag here to connect it to the css file -->   <link rel="stylesheet" type="text/css" href="myLearningKit_ex2.css">   <script src="myLearningKit_ex4.js"></script>      <!-- in Ex2, add a script tag here to connect it to the js file -->   ...
FOR HTML Web scripting Complete the following: Create and test an HTML document that has six...
FOR HTML Web scripting Complete the following: Create and test an HTML document that has six short paragraphs of text that describe various aspects of the state in which you live. You must define three different paragraph styles, p1, p2, and p3. The p1 style must use left and right margins of 20 pixels, a background color of pink, and a foreground color of blue. The p2 style must use left and right margins of 30 pixels, a background color...
This should be done in JavaScript. The HTML file should only contain an empty main tag....
This should be done in JavaScript. The HTML file should only contain an empty main tag. All other HTML on the page should be created with JavaScript. The JavaScript file should be a separate file.   Make an empty HTML file, put an empty main tag inside the body. In your JavaScript, use querySelector to get a reference to the main tag and save it in a variable named main. Look up three good jokes and store them as separate variables...
Create an “About Me” HTML webpage. Use the <h2> Tag to give the page a header...
Create an “About Me” HTML webpage. Use the <h2> Tag to give the page a header with your Full name. The header needs to be in Plum color(Any color other than black, blue – Make the page look good). The webpage should have a background color that compliments the header color. Set the content(Anything about yourself!) of the page inside <p> tags and use a different color for it. Save your file as “AboutMe.html” and upload the file to BB...
2. The HTML document on the following page consists of JavaScript code executed when the document...
2. The HTML document on the following page consists of JavaScript code executed when the document is loaded. It prompts the user for his/her name (first and last names) then outputs the greeting “Hello Mr. _____!” or “Hello Ms. _____!” (where _____ is the user’s last name) depending on whether the first name is recognized as a male name. (In the code, only three male names are checked; a realistic program would check many more names.) We allow for the...
Write an HTML document to provide a form that collects familynames and telephonenumbers. The...
Write an HTML document to provide a form that collects family names and telephone numbers. The family name should start with a capital letter, followed by at least one lowercase letter, and not include any spaces or any other characters, and the length should not be more than 30 characters. The phone numbers must be in the format (ddd)-ddd-dddd. Write a PHP script that checks the submitted last name and the telephone number to be sure that they conform to...
Coding – You don’t have to submit the full html document only submit what should be...
Coding – You don’t have to submit the full html document only submit what should be in the <body> element. Be sure to name your form controls, classes and/or ids in a meaningful manor. 1. Create the HTML needed to have the largest heading with your name followed by an ordered list with your top favorite 5 bands, TV shows, movies or books. 2. Create a document that contains 3 hyperlinks. One hyperlink should contain an absolute path, another should...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT