HTML SoloLearn HTML Basics

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Form Elements

The submit button submits a form to its action attribute: <input type="submit" value="Submit" /> After the form is submitted, the data should be processed on the server using a programming language, such as PHP.

The target Attribute

The target attribute specifies where to open the linked document.Giving a _blank value to your attribute will have the link open in a new window or new tab. A visited link is underlined and purple.

The sections in the blog project are created using the following tag:

div

Which attribute of the link tag contains the URL location that you are trying to link to?

href

Set the background color to white.

<body bgcolor = "#FFFFFF">

What tag should be used to add an image?

<img/>

Single Line Break

Use the <br /> tag to add a single line of text without starting a new paragraph. The <br /> element has no end tag.

What does the href attribute contain?

the URL of the page to be transferred.

Fill in the blanks:

<form method="POST" action="#"> <input type="text" name="name" > <input type="submit" name="submit"> </form>

Choose the correct HTML tag for the largest heading:

<h1>

Image Resizing

To define the image size, use the width and height attributes.The value can be specified in pixels or as a percentage. Loading images takes time. Using large images can slow down your page, so use them with care.

Rowspan

To make a cell span more than one row, use the rowspan attribute.

What tags are used to indicate headings?

h1 - h6

What two attributes can be used to resize images inside HTML code?

width and height

Which value of the target attribute makes the link open in a new tab or a new window?

<a href="2.html" target="_blank">

HTML Color Model

Colors are displayed in combinations of red, green, and blue light (RGB). Hex values are written using the hashtag symbol (#), followed by either three or six hex characters. RGB color values are supported in all browsers.

When formatting text, can you get the same result when using different tags?

yes

Color Values

All of the possible red, green, and blue combinations potentially number over 16 million. Hexadecimal color values are supported in all browsers.

HTML Attributes

Attributes provide additional information about an element or a tag, while also modifying them. Most attributes have a value; the value modifies the attribute. Attributes are always specified in the start tag, and they appear in name="value" pairs.

Formatting Elements

Browsers display <strong> as <b>, and <em> as <i>.However, the meanings of these tags differ: <b> and <i> define bold and italic text, respectively, while <strong> and <em> indicate that the text is "important".

Image Border

By default, an image has no borders. Use the border attribute within the image tag to create a border around the image. By default, Internet Explorer 9, and its earlier versions, display a border around an image unless a border attribute is defined.

HTML Elements

HTML documents are made up of HTML elements.An HTML element is written using a start tag and an end tag, and with the content in between.HTML documents consist of nested HTML elements. Some HTML elements (like the <br /> tag) do not have end tags.

The <form> Element

HTML forms are used to collect information from the user.Forms are defined using the <form> element, with its opening and closing tags. Use the action attribute to point to a webpage that will load after the user submits the form. Usually the form is submitted to a web page on a web server.

HTML Headings

HTML includes six levels of headings, which are ranked according to importance.These are <h1>, <h2>, <h3>, <h4>, <h5>, and <h6>. It is not recommended that you use headings just to make the text big or bold, because search engines use headings to index the web page structure and content.

What does HTML stand for?

Hyper Text Markup Language

Types of Elements

In HTML, most elements are defined as block level or inline elements. Block level elements start from a new line. For example: <h1>, <form>, <li>, <ol>, <ul>, <p>, <pre>, <table>, <div>, etc. Inline elements are normally displayed without line breaks. For example: <b>, <a>, <strong>, <img>, <input>, <em>, <span>, etc. The <div> element is a block-level element that is often used as a container for other HTML elements. When used together with some CSS styling, the <div> element can be used to style blocks of content. Similarly, the <span> element is an inline element that is often used as a container for some text.When used together with CSS, the <span> element can be used to style parts of the text. Summary The <div> element defines a block-level section in a document. The <span> element defines an inline section in a document.

Formatting Elements

In HTML, there is a list of elements that specify text style.Formatting elements were designed to display special types of text: <html><head><title>first page</title></head><body><p>This is regular text </p><p><b> bold text </b></p><p><big> big text </big></p><p><i> italic text </i></p><p><small> small text </small></p><p><strong> strong text </strong></p><p><sub> subscripted text </sub></p><p><sup> superscripted text </sup></p><p><ins> inserted text </ins></p><p><del> deleted text </del></p></body></html> The <strong> tag is a phrase tag. It defines important text.

Can you insert a block element inside an inline element?

No

Types of Elements

Other elements can be used either as block level elements or inline elements. This includes the following elements: APPLET - embedded Java applet IFRAME - Inline frame INS - inserted text MAP - image map OBJECT - embedded object SCRIPT - script within an HTML document You can insert inline elements inside block elements. For example, you can have multiple <span> elements inside a <div> element.Inline elements cannot contain any block level elements.

The Align Attribute

The align attribute is used to specify how the text is aligned. The align attribute of <p> is not supported in HTML5.

Background and Font Colors

The bgcolor attribute can be used to change the web page's background color. The color attribute specifies the color of the text inside a <font> element.

Comments

The browser does not display comments, but they help document the HTML and add descriptions, reminders, and other notes.<!-- Your comment goes here --> There is an exclamation point (!) in the opening tag, but not in the closing tag.

Working with Frames

Use the <noresize> attribute to specify that a user cannot resize a <frame> element:<frame noresize="noresize"> Frame content should be defined using the src attribute. Lastly, the <noframes> element provides a way for browsers that do not support frames to view the page. The element can contain an alternative page, complete with a body tag and any other elements.

Which two tags below make the text visually bold?

b and strong

Form Elements

f we change the input type to radio, it allows the user select only one of a number of choices. The type "checkbox" allows the user to select more than one option. The <input> tag has no end tag.

Which of these tags are all table tags?

<table><tr><td>

Which tag contains the cell tags besides the table tag?

<tr>

The border and colspan Attributes

A border can be added using the border attribute:<table border="2"> A table cell can span two or more columns: <table border="2"> <tr> <td>Red</td> <td>Blue</td> <td>Green</td> </tr> <tr> <td><br /></td> <td colspan="2"><br /></td> </tr></table> The border attribute is not supported in HTML5.

HTML Colors!

HTML colors are expressed as hexadecimal values.0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F As you can see, there are 16 values there, 0 through F. Zero represents the lowest value, and F represents the highest.

Creating a Table

Tables are defined by using the <table> tag.Tables are divided into table rows with the <tr> tag.Table rows are divided into table columns (table data) with the <td> tag. Table data tags <td> act as data containers within the table. They can contain all sorts of HTML elements, such as text, images, lists, other tables, and so on.

The <img> Tag

The <img> tag is used to insert an image. It contains only attributes, and does not have a closing tag. The image's URL (address) can be defined using the src attribute. The HTML image syntax looks like this:<img src="image.jpg" /> The alt attribute specifies an alternate text for an image.

What attribute is used to expand a cell for two or more cells?

colspan

Which of the following are block level elements?

h1 and div

What is the role of an attribute in HTML?

it modifies the tag

General HTML elements consist of:

opening tag, content, closing tag

What measurement units can be used for the width attribute?

pixel and %

What attributes does the frameset tag require to indicate its size?

rows and cols

What attribute should be used to add an image URL?

src

What tag is used to create columns in a row?

td

To support multiple lines of input you should use the following element:

textarea

Align the text of the paragraph to the right:

<html> <body align="center"> <div align="right"> <p>This is a line of text</p> </div> </body> </html>

Fill in the blank:

<html> <body> <form method="POST"> <img src="image.jpg" /> <br /> <input type="text" name="name"> <input type="submit" name="Submit"> </form> </body> </html>

The <frame> Tag

A page can be divided into frames using a special frame document. The <frame> tag defines one specific window (frame) within a <frameset>. Each <frame> in a <frameset> can have different attributes, such as border, scrolling, the ability to resize, etc. The <frameset> element specifies the number of columns or rows in the frameset, as well as what percentage or number of pixels of space each of them occupies. The <frameset> tag is not supported in HTML5.

HTML Ordered Lists

An ordered list starts with the <ol> tag, and each list item is defined by the <li> tag. The list items will be automatically marked with numbers.

HTML Unordered List

An unordered list starts with the <ul> tag. The list items will be marked with bullets.

The <a> Tag

Links are also an integral part of every web page. You can add links to text or images that will enable the user to click on them in order to be directed to another file or webpage. In HTML, links are defined using the <a> tag. Use the href attribute to define the link's destination address:<a href=""></a> To link an image to another document, simply nest the <img> tag inside <a> tags. Links can be either absolute or relative.

The method and name Attributes

The method attribute specifies the HTTP method (GET or POST) to be used when forms are submitted (see below for description): <form action="url" method="GET"> <form action="url" method="POST"> When you use GET, the form data will be visible in the page address. Use POST if the form is updating data, or includes sensitive information (passwords). POST offers better security because the submitted data is not visible in the page address. To take in user input, you need the corresponding form elements, such as text fields. The <input> element has many variations, depending on the type attribute. It can be a text, password, radio, URL, submit, etc. The name attribute specifies a name for a form.

The align and bgcolor Attributes

To change your table's position, use the align attribute inside your table tag:<table align="center"> Now let's specify a background color of red for a table cell. To do that, just use the bgcolor attribute. <table border="2"><tr><td bgcolor="red">Red</td><td>Blue</td><td>Green</td></tr><tr><td>Yellow</td><td colspan="2">Orange</td></tr></table> In the case of styling elements, CSS is more effective than HTML.

Horizontal Lines

To create a horizontal line, use the <hr /> tag. In HTML5, the <hr> tag defines a thematic break.

The <p> Element

To create a paragraph, simply type in the <p> element with its opening and closing tags

Image Location

You need to put in the image location for the src attribute that is between the quotation marks. In case the image cannot be displayed, the alt attribute specifies an alternate text that describes the image in words. The alt attribute is required.

Which attribute contains the URL address of the webpage that is loaded after a form submission?

action

What attribute is used to align the contents of an element to the right, center or left?

align

What attribute is used to change the color of a cell?

bgcolor


Set pelajaran terkait

Philosophy (Chapter 11: What is a Good Life? Ethics)

View Set

Chapter Exam 5- Life Insurance Premiums, Proceeds, and Beneficiaries

View Set

Customer Service Chapter 6 SmartBook

View Set

ATI Dosage Calculations Critical Care Medications

View Set

Lesson 17: Real Estate Careers and The real estate license law

View Set

Semester 6, Exam 4, SGQ ENT/Laser (Wolford 2016B)

View Set