Knowledge in html class 7 vii cs ncert cbse hindi

Some basic knowledge about HTML

This file contains all about basics knowledge of HTML which is very important for programmers who are beginners.

HTML Attribute

HTML Attributes • All HTML elements can have attributes • Attributes provide additional information about an element • Attributes are always specified in the start tag • Attributes usually come in name/value pairs like: name="value" ________________________________________ The href Attribute HTML links are defined with the tag. The link address is specified in the href attribute: Example This is a link » You will learn more about links and the tag later in this tutorial. ________________________________________

HTML Elements

HTML Elements An HTML element usually consists of a start tag and an end tag, with the content inserted in between: Content goes here... The HTML element is everything from the start tag to the end tag: My first paragraph.

HTML Paragraphs

HTML Paragraphs The HTML element defines a paragraph: Example This is a paragraph. This is another paragraph. » Note: Browsers automatically add some white space (a margin) before and after a paragraph. ________________________________________ HTML Display You cannot be sure how HTML will be displayed. Large or small screens, and resized windows will create different results. With HTML, you cannot change the output by adding extra spaces or extra lines in your HTML code. The browser will remove any extra spaces and extra lines when the page is displayed: Example This paragraph contains a lot of lines in the source code, but the browser ignores it. This paragraph contains a lot of spaces in the source code, but the browser ignores it. »

HTML Background Images

Background Images A background image can be specified on almost any HTML element. To add a background image in HTML, use the CSS property background-image. ________________________________________ Background Image on a HTML element To add a background image on an HTML element, you can use the style attribute: Example Add a background image on a HTML element: Try it Yourself » You can also specify the background image in the element: Example Specify the background image in the style element: div { background-image: url('img_girl.jpg');

HTML The class Attribute

Using The class Attribute The HTML class attribute is used to define equal styles for elements with the same class name. So, all HTML elements with the same class attribute will get the same style. Here we have three elements that point to the same class name: Example .cities { background-color: black; color: white; margin: 20px; padding: 20px; } London London is the capital of England. Paris Paris is the capital of France. Tokyo Tokyo is the capital of Japan.

HTML Styles

HTML Styles HTML Styles - CSS CSS = Styles and Colors Manipulate Text Colors, Boxes ________________________________________ Styling HTML with CSS CSS stands for Cascading Style Sheets. CSS describes how HTML elements are to be displayed on screen, paper, or in other media. CSS saves a lot of work. It can control the layout of multiple web pages all at once. CSS can be added to HTML elements in 3 ways: • Inline - by using the style attribute in HTML elements • Internal - by using a element in the section • External - by using an external CSS file The most common way to add CSS, is to keep the styles in separate CSS files. However, here we will use inline and internal styling, because this is easier to demonstrate, and easier for you to try it yourself. Tip: You can learn much more about CSS in our CSS Tutorial. ________________________________________ Inline CSS An inline CSS is used to apply a unique style to a single HTML element. An inline CSS uses the style attribute of an HTML element. This example sets the text color of the element to blue:

HTML Picture Element

HTML Picture Element The picture element allows us to display different pictures for different devices or screen sizes. ________________________________________

HTML The id Attribute

Using The id Attribute The id attribute specifies a unique id for an HTML element (the value must be unique within the HTML document). The id value can be used by CSS and JavaScript to perform certain tasks for the element with the specific id value. In CSS, to select an element with a specific id, write a hash (#) character, followed by the id of the element: Example Use CSS to style an element with the id "myHeader": #myHeader { background-color: lightblue; color: black; padding: 40px; text-align: center; } My Header Result: My Header Try it Yourself » Tip: The id attribute can be used on any HTML element. Note: The id value is case-sensitive. Note: The id value must contain at least one character, and must not contain whitespace (spaces, tabs, etc.). ________________________________________

HTML Image Maps

HTML Image Maps With image maps, you can add clickable areas on an image. ________________________________________ Image Maps The tag defines an image-map. An image-map is an image with clickable areas. Click on the computer, the phone, or the cup of coffee in the image below: