Professional Documents
Culture Documents
UNIT VI: PROPS, STATE, AND THE COMPONENT TREE, REACT ROUTER AND SERVER
◦ This markup tells a web browser how to display the text, images and other form of multimedia on a webpage.
◦ Container Tag/ Pair Tag: The first tag in a pair is the start tag (<), the second tag is the end tag (>). The end tag is written like
the start tag, with a forward slash (/) before the tag name.
◦ Start and end tags are also called opening tags and closing tags. For ex <b> and </b>
Computer
Text or HTML editor: For ex, HTML editors are Dreamweaver, SeaMonkey, Coffee Cup, TextPad etc.
The text editors are include Notepad(for windows), Pico(for Linux), or Simpletext/ text Edit/TexT.
Web Browser. For Ex Internet Explorer of Firefox
HTML VERSIONS
◦ HTML 1991
◦ HTML 2.0 1995
◦ HTML 3.2 1997
◦ HTML 4.01 1999
◦ XHTML 2000
◦ HTML 5 2014
A number of new elements and attributes that can help you in building modern websites.
New semantic Elements- These are like <header>, <footer>, and <section>.
Forms 2.0- Implements to HTML web forms where new attributes have been introduced for <input> tag.
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
</body>
</html>
An HTML element is defined by a start tag, some content, and an end tag:
<tagname>Content goes here...</tagname>
The HTML element is everything from the start tag to the end tag:
<h1>My First Heading</h1>
<p>My first paragraph.</p>
Images can improve the design and the appearance of a web page.
Example Program 1
<!DOCTYPE html>
<html>
<body>
<h2>HTML Image</h2>
<img src="pic_trulli.jpg" alt="Trulli" width="500" height="333">
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h2>HTML Image</h2>
<img src="img_girl.jpg" alt="Girl in a jacket" width="500" height="600">
</body>
</html>
The src Attribute (The required src attribute specifies the path (URL) to the image.)
The alt Attribute (The required alt attribute provides an alternate text for an image, if
the user for some reason cannot view it)
Image Size - Width and Height (You can use the style attribute to specify the width and
height of an image.)
we suggest using the style attribute. It prevents styles sheets from changing the size of
images:
If you have your images in a sub-folder, you must include the folder name in the src attribute:
Example
<img src="/images/html5.gif" alt="HTML5
Icon" style="width:128px;height:128px;">
Images on Another Server/Website
Some web sites point to an image on another server.
To point to an image on another server, you must specify an absolute
(full) URL in the src attribute:
Example
<img src="https://www.html.com/images/html_green.jpg" alt=“html.com">
Here are the most common image file types, which are supported in all
browsers (Chrome, Edge, Firefox, Safari, Opera):
Abbreviation File Format File Extension
APNG Animated Portable Network .apng
Graphics
GIF Graphics Interchange Format .gif
ICO Microsoft Icon .ico, .cur
JPEG Joint Photographic Expert Group .jpg, .jpeg, .jfif, .pjpeg, .pjp
image
PNG Portable Network Graphics .png
SVG Scalable Vector Graphics .svg
To add a background image on an HTML element, use the HTML style attribute and the CSS
background-image property:
Example: <div style="background-image: url('img_girl.jpg');">
Specify the background image in the <style> element:
Example: <style>
div {
background-image: url('img_girl.jpg’);
}
</style>
If you want the background image to cover the entire element, you can set the background-size property to cover.
To make sure the entire element is always covered, set the background-attachment property to fixed:
This way, the background image will cover the entire element, with no stretching (the image will keep its original
proportions):
Example: <style>
body {
background-image: url('img_girl.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
</style>
HTML Lists are used to specify lists of information. All lists may contain one or more list
elements. There are three different types of HTML lists:
1.Ordered List or Numbered List (ol)
2.Unordered List or Bulleted List (ul)
3.Description List or Definition List (dl)
**We can create a list inside another list, which will be termed as nested List.**
In the ordered HTML lists, all the list items are marked with numbers by default. It is known as
numbered list also. The ordered list starts with <ol> tag and the list items start with <li> tag.
In HTML Unordered list, all the list items are marked with bullets. It is also known as bulleted
list also. The Unordered list starts with <ul> tag and list items start with the <li> tag.
<ul>
<li>Aries</li>
<li>Bingo</li>
<li>Leo</li>
<li>Oracle</li>
</ul>
HTML Description list is also a list style which is supported by HTML and XHTML. It is also
known as definition list where entries are listed like a dictionary or encyclopedia.
The definition list is very appropriate when you want to present glossary, list of terms or other
name-value list.
The HTML definition list contains following three tags:
1.<dl> tag defines the start of the list.
2.<dt> tag defines a term.
3.<dd> tag defines the term definition (description).
Every HTML element has a default display value, depending on what type of
element it is.
Block-level Elements
Always starts on a new line.
Always takes up the full width available (stretches out to the left and right as far
as it can).
Element has a top and a bottom margin, whereas an inline element does not.
Example <div>Hello World</div>
Inline Elements
An inline element does not start on a new line.
An inline element only takes up as much width as necessary.
This is a <span> element inside a paragraph.
The <div> element is often used as a container for other HTML elements.
The <div> element has no required attributes, but style, class and id are common.
When used together with CSS, the <div> element can be used to style blocks of content:
Example : <div style="background-
color:black;color:white;padding:20px;">
<h2>London</h2>
<p>London is the capital city of England. It is the most populous
city in the United Kingdom, with a metropolitan area of over 13
million inhabitants.</p>
</div>
The <span> element is an inline container used to mark up a part of a text, or a part of a
document.
The <span> element has no required attributes, but style, class and id are common.
When used together with CSS, the <span> element can be used to style parts of the text:
Example :<p>My mother has <span style="color:blue;font-
weight:bold">blue</span> eyes and my father
has <span style="color:darkolivegreen;font-weight:bold">dark
green</span> eyes.</p>
HTML tables allow web developers to arrange data into rows and columns.
Define an HTML Table
Each table row is defined with a <tr> tag. Each table header is defined with
a <th> tag. Each table data/cell is defined with a <td> tag.
The text in <th> elements are bold and centered.
BY default
The text in <td> elements are regular and left-aligned.
Type Description
<input type="text"> Displays a single-line text input field
<input type="radio"> Displays a radio button (for selecting one of many choices)
<input type="checkbox"> Displays a checkbox (for selecting zero or more of many choices)
<input type="submit"> Displays a submit button (for submitting the form)
<input type="button"> Displays a clickable button
<html>
<body>
<h2>Radio Buttons</h2>
<p>Choose your favorite Web language:</p>
<form>
<input type="radio" id="html" name="fav_language" value="HTML">
<label for="html">HTML</label><br>
<input type="radio" id="css" name="fav_language" value="CSS">
<label for="css">CSS</label><br>
<input type="radio" id="javascript" name="fav_language" value="JavaScript">
<label for="javascript">JavaScript</label>
</form>
</body>
</html>
A. border-spacing
B. spacing
C. cell-spacing
D. table-spacing
A. radio button allows to choose only one option from the given options.
B. default option can be chosen using attribute "selected" in radio button
C. default option can be chosen using attribute "checked" in radio button
D. checkbox allows to choose one or more than one options from the given