Showing posts with label attribute. Show all posts
Showing posts with label attribute. Show all posts

CSS Syntax

CSS Syntax

A CSS rule-set consists of a selector and a declaration block:
The selector points to the HTML element you want to style.
The declaration block contains one or more declarations separated by semicolons.
Each declaration includes a CSS property name and a value, separated by a colon.
A CSS declaration always ends with a semicolon, and declaration blocks are surrounded by curly braces.
In the following example all <p> elements will be center-aligned, with a red text color:Example:

<!DOCTYPE html>
<html>
<head>
<style>
p {
    color: red;
    text-align: center;

</style>
</head>
<body>

<p>Hello World!</p>
<p>These paragraphs are styled with CSS.</p>

</body>
</html>


CSS Selectors

CSS selectors are used to "find" (or select) HTML elements based on their element name, id, class, attribute, and more.

The element Selector

The element selector selects elements based on the element name.
You can select all <p> elements on a page like this (in this case, all <p> elements will be center-aligned, with a red text color):

The id Selector

The id selector uses the id attribute of an HTML element to select a specific element.
The id of an element should be unique within a page, so the id selector is used to select one unique element!
To select an element with a specific id, write a hash (#) character, followed by the id of the element.
The style rule below will be applied to the HTML element with id="para1":
Example:
<!DOCTYPE html>
<html>
<head>
<style>
#para1 {
    text-align: center;
    color: red;
}
</style>
</head>
<body>

<p id="para1">Hello World!</p>
<p>This paragraph is not affected by the style.</p>

</body>
</html>


The class Selector

The class selector selects elements with a specific class attribute.
To select elements with a specific class, write a period (.) character, followed by the name of the class.
In the example below, all HTML elements with class="center" will be red and center-aligned: Example:

<!DOCTYPE html>
<html>
<head>
<style>
.center {
    text-align: center;
    color: red;
}
</style>
</head>
<body>

<h1 class="center">Red and center-aligned heading</h1>
<p class="center">Red and center-aligned paragraph.</p> 

</body>
</html>

CREATING FORM

CREATING FORM 

Form use to creating text , number ,email and password boxes in html page.
For creating boxes we use input tag .
Input tag is also use creating buttons in page of website.

Attribute of input tags

  1. Type="Text" For using text box.
  2. Type="Password" For using password box.
  3. Type="Email" For using Email box.
  4. Type="Radio" For using radio buttons.
  5. Type="submit" For using submit buttons.

Spacial Attribute

Placeholder is very spacial attribute.

FOR Example:

<!DOCTYPE html>
<html>
<body>

<form action="action_page.php">
First name:<br>
<input type="text" name="firstname" Placeholder="First name">
<br>
Last name:<br>
<input type="text" name="lastname" Placeholder="Last name">
<br><br>
<input type="submit" value="Submit">
</form> 



</body>
</html>



HTML TAGS:

For learning HTML following heading very important because these are basic information of HTML. Therefore read carefully and understand every part of this chapter.......

HTML TAGS:


    Tags contain elements which provide instructions for how information will be processed or displayed. There are both starter tags <TAG> and end tags </TAGS>

Element:

    A basic unit of an HTML document. The name of the element is given in the name of the tag, and specifies the meaning associated with a block of text. Some elements are empty since they don't effect a block of text. Elements that have contents are also called containers, i.e., they contain attributes.
    • Example: the <HR> tag contains the Horizontal Ruler element. It is an empty element in that it has no attribute.

    Attribute:

      Defines a special property of an HTML element.
      • Example: <IMG SRC="image.gif"> means that the element IMG has an attribute SRC, which specifies the name of the image file, which is assigned the value "image.gif".

      Delimiters: <, >, /

        Delimiters surround the tag and inform the parser that it should read the enclosed information as an HTML element.

      HTML Structure

      HTML is a structured hierarchical language that requires you to follow its rules if you wish your documents to appear correctly. For example, certain elements and tags are required to fit within other elements and tags and will not work unless they are properly placed.




      introduction of computer

      A video introduction of computer                                         very useful information in this video.                      ...