Path To Web Development
Path To Web Development
<h1>Heading1</h1>
<h2>Heading2</h2>
<h3>Heading3</h3>
<h4>Heading4</h4>
<h5>Heading5</h5>
<h6>Heading6</h6>
HTML Paragraphs
• The HTML <p> element defines a paragraph.
• A paragraph always starts on a new line.
• Browsers automatically add some white space (a margin) before and after a paragraph.
• The <p> tag in HTML is used to define a paragraph of text.
• It is one of the most fundamental and commonly used HTML elements for structuring content.
• The <p> tag allows you to group and format text, creating separate blocks of content, which are
typically displayed with some spacing above and below to visually separate them.
• Here's an explanation of the <p> tag
ul -> unordered list, ol-> ordered list, li-> list item, dl-> Definition List, dt-> Definition Term, dd-> Definition Description
HTML Tables
• Table is a structured grid of data or information organized in rows and columns.
• It used to present and arrange data in a tabular format.
• It makes it easier for users to read, compare, and understand the information.
<form> <form>
. <label for="fname">First name:</label><br>
form elements <input type="text" id="fname" name="fname“
. placeholder=“Enter Your first name”><br>
</form> <label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname">
</form>
HTML Forms
• Here are some examples:
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 Form Elements
The HTML <form> element can contain one or more of the following form elements:
•<input>
•<label>
•<select>
•<textarea>
•<button>
•<datalist>
•<option>
HTML Form Elements
• The <input> Element
One of the most used form elements is the <input> element.
The <input> element can be displayed in several ways, depending on
the type attribute.
Examples
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname">
HTML Form Elements
• The <select> Element
• The <select> element defines a drop-down list:
<label for="cars">Choose a car:</label>
<select id="cars" name="cars">
<option value=“Harrier">Harrier</option>
<option value=“XUV700">XUV 700</option>
<option value=“creta">Creta</option>
<option value=“Thar">Thar</option>
</select>
• Visible Values:
Use the size attribute to specify the number of visible values .
<label for="cars">Choose a car:</label>
<select id="cars" name="cars" size="3">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat">Fiat</option>
<option value="audi">Audi</option>
</select>
• The rows attribute specifies the visible number of lines in a text area.
• The cols attribute specifies the visible width of a text area.
• This is how the HTML code above will be displayed in a browser:
• You can also define the size of the text area by using CSS:
<textarea name="message">
The cat was playing in the garden.
</textarea>
• The <button> Element
• The <button> element defines a clickable button:
<button type="button" onclick="alert('Hello World!')">Click Me!</button>
HTML Forms Elements Table:
Tag Description
<form> Defines an HTML form for user input
<input> Defines an input control
<textarea> Defines a multiline input control (text area)
<label> Defines a label for an <input> element
<fieldset> Groups related elements in a form
<legend> Defines a caption for a <fieldset> element
<select> Defines a drop-down list
<optgroup> Defines a group of related options in a drop-down list
<option> Defines an option in a drop-down list
<button> Defines a clickable button
<datalist> Specifies a list of pre-defined options for input controls
<output> Defines the result of a calculation
CSS (Cascading Style Sheet)
• CSS stands for Cascading Style Sheets
• CSS declarations are separated with semicolons, and declaration blocks are
surrounded by curly braces.
How to insert CSS
• Inline CSS
• Internal CSS
• External CSS
Inline CSS
• An inline style may be used to apply a unique style for a
single element.
• <h1 style="color:blue;text-align:center;">This is a
heading</h1>
<style>
body {
background-color: linen;
}
h1 {
color: maroon;
margin-left: 40px;
}
</style>
External CSS
• <head>
<link rel="stylesheet" href="mystyle.css">
</head>
• mystyle.css
body {
background-color: lightblue;
}
h1 {
color: navy;
margin-left: 20px;
}
CSS Selectors
• CSS selectors are used to "find" (or select) the HTML
elements you want to style.
Style=“background-color: #000000;”
Style=“background-color:rgb(255,255,255);”
• Style=“background-color: #000000;”
• Style=“border-style: solid;
• Style=“border-color: red;
• Style=“border-color: red;
• border-radius: 5px;
CSS Margin & CSS Padding
• Margins are used to create space around elements,
outside of any defined borders.
• margin: 25px 50px 75px 100px;
• text-align: center;
• text-decoration-line: underline;
• text-transform: uppercase;
HTML Links