5/7/21

CSS tutorials : CSS Selector & Different type of CSS Selectors Part 1

Hey Friends, in our last tutorials we have seen about CSS syntax. Now, in this tutorial, we are going to learn about CSS selectors. So let’s begin…

CSS Selectors

CSS Selectors are used to selecting the Html elements which you want to style. Selectors are select Html elements by their id, class, attributes, type, etc. 

There are several different types of CSS selectors are:- 

  • CSS Element Selector
  • CSS Id Selector
  • CSS Class Selector
  • CSS Universal Selector
  • CSS Group Selector

CSS Element Selector

In this type of CSS Selector the selector select by the name of html element. Let’s See the Example below.

Example :- 

<html>

<head>

<title> CSS Elements Selector </title>

</head>

<style>

h1 { 

background-color: red;

color: Yellow; }

p { 

background-color: Yellow;

color : Green; }

</style>

<body>

<h1> This is a Heading. </h1>

<p> This is a Paragraph Tag. </p>

</body>

</html>

Output: - 

CSS ID Selector

This type of CSS Selector selects the element by its id.  It is good practice to give id or class name to each and every Html element. The main reason behind giving id and class name was you can select a particular element by its id or class name. 

Example: -

 <html>

<head>

    <title> CSS ID Selector </title>

</head>

<style>

    #heading {

        background-color: red;

        color: Yellow;

    }

    #heading2{

        background-color: black;

        color: white;

    }


    #para {

        background-color: Yellow;

        color: Green;

    }

</style>

<body>

    <h1 id="heading"> This is a Heading. </h1>

    <h2 id = "heading2"> This is another heading</h2>

    <p id="para"> This is a Paragraph Tag. </p>

</body>

</html>

Note:- For Selecting the Html Element by its id. Always use "#" first, then the id name. 

Output: -


Continue Reading →

5/4/21

CSS Tutorials - CSS Comments with Example.

 CSS Comments

Comments are added to the source code to easily understand the code. It helps the other developer or programmer to understand the code (written by another developer) easily. Just like Html, comments are also written in CSS. 

There are two types of comments in CSS: -

  • Single Line Comments: - These types of comments written only in one line. 
  • Multi Line Comments: - These types of comments are written in one or more lines.

Note :- Comments are ignored by the browser and would not be display as output. 

Example of Comments

<html>
<head>
<title> Example of CSS Syntax </title>
<style> 
h1{             
/* This style is given to the heading tag only they didn't work on paragraph tag. */
color: Red;
background-color: Yellow;
text-align: center;
}
p {          
        /* This style is given to the 
                        paragraph tag only 
                        they didn't work on heading tag. 
                        */

color: Yellow;
background-color: green;
text-align: center;
}
</style>
</head>
<body>
<h1> This is a Heading. </h1>
<p> This is a Paragraph. </p>
<div class="container">
    <p> This is a paragraph tag under the div. </p>
</div>
</body>
</html>

Output: -




Continue Reading →

CSS Tutorials - CSS Syntax with Example

CSS Syntax 

A CSS style sheet consists of a set of instructions that is interpreted by the web browser and after interpreted by the web browser instructions are applied to the corresponding elements. Such as - paragraph, heading, div, etc. 

The CSS Syntax Rule is made of three major parts:-

  • Selectors: - A Selector is an html tag on which the CSS Style Sheet will be applied. Like :- <h1>, <p>, <span> etc.
  • Property: - A property is a type of attribute of the Html elements. Such as Color, border, etc. 
  • Value: - Value is assigned on the CSS Property. Such as Color is the property and red is the value which is assigned to the color attribute. 

Syntax of CSS


Let us see through with a simple example.

<html>
<head>
<title> Example of CSS Syntax </title>
<style> 
h1{
color: Red;
background-color: Yellow;
}
p{
color: Yellow;
background-color: green;
}
</style>
</head>
<body>
<h1> This is a Heading. </h1>
<p> This is a Paragraph. </p>
</body>
</html>

Output: -


You May Also Like:- 



Continue Reading →

4/29/21

CSS Tutorials - Introduction to CSS.

Hey Friends, from here we are going to start our new tutorial series about CSS. In this tutorial, we are going to cover complete CSS versions of CSS1, CSS2, CSS3 and gives you a complete understanding of CSS from the basics to advance. So let’s begin...

Introduction to CSS

CSS Stands for Cascading Style Sheet. It is used to style the web pages of the websites. It handles the look of Html documents. By applying CSS in your Html documents you can change the font of your web pages, color, alignment, style, background color, etc. a lot of things can be changed or style. CSS is easy to learn and understand. CSS is combined with other markup languages such as Html, XHTML, etc. to make web pages more attractive and beautiful. 

Why we should learn CSS?

CSS played an important role in web development. It is necessary to implement CSS Code in your Html file. It increases the standard of your website. Users easily interact with your site. You can’t build a website without CSS. CSS makes the website more attractive and more beautiful. So if you have to become a web developer then you should have to learn CSS:- 

Basic of web development: - Two basic skills that every web developer should have 1. Html 2. CSS. If you find a career in web development then you should have some knowledge about those two things.

Creating a stunning website: - Without CSS no one can create an attractive website. If you want to create a stunning website you need to apply CSS to it. 

Increase the user attraction: - A simple and attractive UI website would help the users to visit your website again and again. 

Example of a html webpage with or without CSS 

Without CSS

<html>

<head>

<title> Example of CSS </title>

<body>

<h1> This is a Heading </h1>

<p> This is an Example of html documents.

</body>

</html>

Output :- 


With CSS

<html>

<head>

<title> Example of CSS </title>

<style> 

h1{        background-color: yellow;

              color: red; }

p{         background-color: tomato;

             color: green; }

</style>

<body>

<h1> This is a Heading </h1>

<p> This is an Example of html documents.

</body>

</html>

Output:- 


Continue Reading →

4/25/21

C Program to Find Area and Perimeter of Rectangle

C Program to Find Area and Perimeter of a Given Length and Breadth

#include<stdio.h>

void main ()

{

float l,b,area,peri;

printf("Enter length breadth of rectangle=");

scanf("%f%f",&l,&b);

area=l*b;

peri=2*(l+b);

printf("Area is=%f",area);

printf("\nperimenter is=%f",peri);

if (area<=peri)

        printf("\nPerimeter is greater than area");

else

printf("\nArea is greater than perimeter");

getch();

}

Output:-

Explanation:- 

 In this program first, we have accepted input from the user (length and breadth). After that we put the formula of area and perimeter of rectangle into it. After that program gives the area and perimeter of rectangle as output. Then we compare the area and perimeter to check the which one of these are greatest. 

Continue Reading →

4/22/21

C Program to Find Square Root of any Number

 Program to Find Square Root of any Number.

#include<stdio.h>

#include<math.h>

void main()

{

int number;

float result;

printf("Enter the Number=");

scanf("%d",&number);

result=sqrt(number);

printf("Square root=%f",result);

getch();

}

Note:- In this program, we added a new header file named math.h. This header file is used to perform mathematical operations in our program. such as sqrt() to find square root, log() to find the logarithm of a number, etc.

Output:-


Continue Reading →

4/16/21

C Program to Find Simple Interest in C Programming.

Program to find Simple Interest 

#include<stdio.h>

#include<conio.h>

void main()

{

float p,r,t,si;

printf("Enter the value of Principle=");

scanf("%f",&p);

printf("Enter the value of Rate=");

scanf("%f",&r);

printf("Enter the value of Time (Year) =");

scanf("%f",&t);

si=p*r*t/100;

printf("Answer is=%f",si);

getch();

}

Output:- 



Continue Reading →

C Program to Find the greatest number between 3 Numbers.


C Program to Find Greatest Number Between 3 Numbers. 

#include <stdio.h>
#include <conio.h>
void main()
{
    int a,b,c;
    printf("Enter the three Number=");
    scanf("%d%d%d",&a,&b,&c);
    if (a>b)
    {
        if (a>c)
        {
            printf("A is greater number");
        }
        else
        {
            printf("C is greater number");
        }
    }
    else

        if(b>c)
        {
            printf("B is greater number");
        }
        else if (a==b && a==c)
        {
            printf("Numbers are equal");
        }
        else
        {
            printf("C is greater number");
        }
    getch();
}

Output :- 





Continue Reading →

4/15/21

C Program to find Odd & Even Number given by the User.


C Program to Find ODD & EVEN Number given by the user. 

#include<stdio.h>

void main()

{

    int a;

        printf("Enter the Number");

        scanf("%d",&a);

    if (a%2==0)

        printf("Number is Even");

    else

        printf("Number is Odd");

getch();

}

Output :-




Continue Reading →

4/11/21

Nested IF-Else in C Programming


Hey Friend, in our last tutorial we have seen about if statements, and if-else statements. In the if statement only one condition is check and if the condition is true then the output will be shown on the display. And on the other hand, we have also seen that if you have two conditions then if-else were used to check those conditions. 

Now, during the high-level programming, you have to check more than two conditions. For Example, you have to write a program to check whether

  • Num1 is less than num2
  • Num1 is greater than num2
  • Num1 is equal to num2

In that case, you have to use a nested if-else statement on your programs. 

Nested IF – ELSE

A nested if-else statement is used when a series of decisions were used to check through your program. As the name suggests, Nesting means using an if-else construct within another one. But guys basically there is no limitation to nesting. But the programmers nest up to 3 blocks only. You could use more if you want. 

Syntax of the nested if-else statement

if (condition)

   {

      Statement 1

      Statement 2 and so on

   }

else

   {

      if (condition)

   {

      Statement a

      Statement b

   }

else

   {

Statement c

Statement d

   }

}

I know it is a bit complex for beginners but I will explain it to you in the easiest way. So let’s try to understand this. 

Look at the syntax. you see that I am nested the if-else statement into the else statement of the syntax. Now when the code is executed then the compiler first checks the if condition (primary if block) if the condition is false of if statement then the compiler goes on the else part. Now in the else block it will check the if condition (secondary if block). If the condition is not true of secondary if block, then the compiler is print the else (secondary else part) as output.

You can also nested if-else on the if(primary statement). If you haven’t understood it yet, then don’t worry let try it with a simple program.


Program to find out the greater number between two numbers. 

#include<stdio.h>

int main()

{

int a, b;

printf("Enter Number A & B = ");

scanf("%d%d", &a,&b);

if(a>b)

{

    printf("A is Greater than B");

}

else{

    if(b>a)

    {

        printf("B is Greater than A");

    }

    else{

        printf("Numbers are Equal");

    }

}

getch();

}

Output :- 

Explanation :-

First, we declare two integer variable name a and b. After the declaration of the variable name. We take input from the user in variable a and variable b. 

Now, we use nested if-else to check the greater number between a and b. So there are three possibilities that occur among checking the numbers. It should be:-

  • A is greater than B
  • B is greater than A
  • Both Number are Equal 

So, in the first if block of the part,  we check the condition. The condition is whether integer a is Greater than integer B if true then print the Message to the user that “A is greater than B”. if the first condition is true then the program is print the output.  Or if the condition is not true then the program will go on else block. 

Now, here are the two different conditions the first one is to check whether the integer B is Greater than A. If true then print the message to the user that “B is greater than B”. if this condition is not true then the else part is automatically executed by default.

Hope you all understood this. If you have any query then comment it down. For more keep visit here. 

Continue Reading →

4/4/21

If-Else Condition in C Programming Part - II

Hey Friend, till now we have studied about only if statement. If you do not know about IF statement please read the previous tutorial before reading this. In if statement whenever the condition is true a set of instructions will proceed running. But every coin has two faces, till now we only learned about one condition. If the condition is true then the code will execute. In high-level programming, you have to code both situations such as if the first condition is true then a set of instructions will execute & if the condition is not true then the second set of instructions execute. This work is done using if-else statements.

Syntax of IF-Else Condition 

If (condition)

{

Statement 1;

Statement 2;

So on…;

}

Else{

{

Statement 1;

Statement 2 and so on…;

}


Note that:-

1. The Statement inside if and else keyword and generally known as if block and else block respectively.

2. The parenthesis inside the if-else block can be dropped if there is only one condition exists. 

3. You should not use any condition in the else keyword. The statements under else will be executed only if the condition with if statement is false. So it is treated as the default choice.

4.  Notice that the else part or statement of the program is placed just below the if part. And the statement of those blocks has indented to the right. This is a formatting convention that means just to write a program easier or understandable way. Look at the below program to understand in a better way. 


Program to find that the given number is a positive number or a negative number. 

#include <stdio.h>

void main()

{

 int number;

 printf("Enter a number to check if it is negative or positive :");

 scanf("%d",&number);

 if(number<0)

 {

  printf("Number is negative"); 

 } 

 else

 {

  printf("Number is positive");

 }

}

Output :- 


Explanation of the Program

I have already told the meaning of these (include, printf, int main) functions earlier. If you don’t know please check the previous post. In this program, we declare a variable name (number) as an integer value given by the user. 

Now we are going to check the number whether it is a positive number or a negative number.  So in the if block we check, is this number is smaller than zero? If yes then the program of (if block) executes and gives us the output. 

Or if the number is greater than zero then the else block starts to execute and give us the output.


Hope you all understand the program and if you have any query then comment below I will definitely try to explain with another example.  


Continue Reading →

3/30/21

C Program to Convert Fahrenheit to Celsius.


C Program to Convert Fahrenheit to Celsius. 


#include<stdio.h>
#include<conio.h>
void main()
{
float f,c;
printf("Enter the temperature(f)=");
scanf("%f",&f);
c=(f-32)*5/9;
printf("Answer is=%f C",c);
getch();
}

Output :- 





Continue Reading →

3/22/21

C Program to Find ASCII Value of Character.


C program to find out the ASCII code of any Character.

Method 1

#include<stdio.h>

void main()

{

int a;

char ch;

printf("Enter any character:");

scanf("%c",&ch);

a=ch;

printf("ASCII value of %c is %d",ch,a);

getch();

}


Method 2

#include <stdio.h>

void main()

{

char c;

printf("Enter any character =");

scanf("%c", &c);

printf("ASCII Value is = %d",c);

return 0;

}

Output:-





Continue Reading →

3/17/21

C Program to find the average marks of 5 subjects -- C Programming


Program To Find Average of 5 Subjects


 #include<stdio.h>

int main()

{

int a, b, c, d, e, sum;

float ave;

printf("Enter Marks of Subjects 1 =");

scanf("%d",&a);

printf("Enter Marks of Subjects 2 =");

scanf("%d",&b);

printf("Enter Marks of Subjects 3 =");

scanf("%d",&c);

printf("Enter Marks of Subjects 4 =");

scanf("%d",&d);

printf("Enter Marks of Subjects 5 =");

scanf("%d",&e);

sum = a+b+c+d+e;

ave = sum/5;

printf("\nSum of the Marks are :- %d ", sum);

printf("Average of the Marks are :- %f", ave);

getch();

}

Output :- 





Continue Reading →

3/10/21

IF-Else Condition in C Programming Part - 1


If Else Condition in C Programming 

Hey Friends, in day-to-day life people take a lot of decisions by themselves. For ex:- 

1. If it rains today, then I will not go to college

        If not then I will go

2. If the train is late, I will catch the train

        If not, I will not be able to get the train

Taking decisions in programming is an important part of it. C language also uses decision instruction. In C Programming there are mainly 3 types of decision control instruction

1. If 

2. If-else

3. Switch 

Till now we have studied sequence control instruction. In that instruction, Statements are executed in the order in which they have written or appear. But During the high-level projects, we need to execute a set of instructions by conditions. If the first condition is true then code will run or if the condition is not true (false) then the other condition runs or execute. 

So the selection of the condition (true or false) of instructions is called Decision.  

Now, In this article, we gonna learn about decision control instruction. 

If Statement in C programming 

In C programming, (if) is a keyword to execute an instruction if the instruction is true.  In Simple World, if the given condition is true your code will be run. If not then the code didn’t run. 

The Syntax of the if the condition was given below:- 

If (condition)

{

Statement 1;

Statement 2;

Statement 3;

}

Let us Check through an example :- 

#include <stdio.h>

int main()

{

int a;

printf("Enter the Number = ");

scanf("%d", &a);

if (a<=10)

    {

        printf("A is Smaller than 10");

    }

return 0;

}

Output:- 

Look at the function of the code:- 

In this program, we take a numeric input from the user to check whether a number is greater than 10 or smaller than 10.

If the numerical number is smaller than 10. Then the output will display a message to the user that your input is smaller than 10. 

But if the number is greater than 10. Nothing will be shown on the display. Because we give only one statement in this program.

So that’s all for today guys.. we will continue the rest of the function in the next part of the article. if you have any query related to this comment below. 

Continue Reading →

C Program to Add Two Integer Number -- C Programs

In our previous tutorial, we had made a simple program of C language in which we had printed Hello World on the display. Hope you guyz understood that program. Now, today I am going to make another C program which takes the 2 input from the user in the numerical value and gives us the sum of these two numerical value.  So Let’s Begin…

C Program to Add Two Numerical Value. 

#include<stdio.h>

int main()

{

int A,B,C;

printf("Enter the value of A=");

scanf("%d",&a);

printf("Enter the value of B=");

scanf("%d",&b);

c=a+b;

printf("Answer is=%d",c);

getch();

}

Output :- 


Look at the function used in the above code

1. In the first line of code we include a header file named <stdio.h> which is used to add the printf, scanf function in the program. 

2. On the second line of the code we use int main () function. It shows that your program starts executing from here. 

3. After that we declare 3 variable (A, B, C) respectively. The first variable A store the first numerical value and the second variable B store the second numerical value and the sum of these two number are stored on the third variable C. 

4. After the declaration of the variable we give the message to the user to enter the first number. We use printf() function to give the message which is printed on the monitor screen.

5. After the message the value provided by the user was stored in the first variable name A. we assign the value into A variable by using scanf() function. 

6. In scanf() function we use %d on it. %d indicates the compiler that the user gives an integer value to it.

7. You also notice that we use & (and) symbol on both scanf function what are their mean. The & symbol tell the compiler that the input given by the user is stored on the specific location. (The first value stored on A variable and the second value stored on B variable respectively).

8. At the last line of code we use a function name getch(). This function is used to hold the output screen until the user presses any button or click on the output screen. 


Continue Reading →

3/9/21

C Program to Print Hello World -- C Programs


Hello, Friends, Today's tutorials are based on the C programming language. Today we are going to make A simple C program to display “Hello World” on the Screen. It is very simple so that the beginners can understand easily. As we know that if someone (user) wants to learn anything in life. First of all, he has to learn its basic thing. So basically Hello World is a basic of c program in C programming languages. Let’s Begin

Program to display ”Hello World”

#include <stdio.h>

Int main()

{

printf("Hello World!!");

return 0;

}

Now, look at the function of all the above codes.

1. The First line in the program #include <stdio.h> is preprocessor command, which tells the compiler to include the content of <stdio.h> file in the program. The full form of stdio.h is Standard Input and Output. Stdio.h is a header file (Extension of the header file is .h) which contains functions such as Printf() or Scanf() to take input from the user and display the Output respectively.

2. The Next line Int main() is the main function where the program execution starts.

3. The Next line is printf(“…”). It is a function that comes under the <stdio.h> header file to display the several lines which the user wants to see as Output. (Write your messages under the double comma otherwise it can’t display )

4. And the last line of the program returns 0. This line in the program describes that the program returns 0 value at the end. 


Continue Reading →

3/8/21

What is Multimedia ? Different type of multimedia Components.

Hey Friend, Hope you all fine. In Today Era, we use many technologies in our daily life. Today we do many things with messaging apps like Whatsapp, Facebook Messenger, Signal, etc. Just Example:- Chatting, Audio-Video Sharing, Video Calling, Audio Calling, Image Sharing, Stories Sharing, etc Sending these files from one place to another place via the internet. Do you know that we send millions of files from one place to another with the help of the internet.

But Do you know all these files (Audio, Video, GIFs, Images) are generally known as Multim
edia files.

So Friends today we are going to discuss multimedia through this article. So Let’s Begin….

What is Multimedia?

Multimedia is a digital form of communication through different types of media such as text, video, audio, images, etc.  It is a medium of communication between two users.  

Multimedia is a representation of an attractive and interactive manner with the use of the combination of text, audio, videos, animations, etc. In Simple words, Multimedia is a computerized method of representing information through audio, video, images, etc. The Name multimedia is formed by two words is Multi means many and Media means information (image, video, audio). Many types of media are known as multimedia.

Components of Multimedia 

These are the Basic Component of the Multimedia

Audio: - Audio is the file that has some noise, sound in it within the range of the human ear can hear it or capable to hear. In other words, Any digital information that stored sound, noise in a file that is capable of hearing by a normal human. 

Video:- Video is an electronic medium for the recording, copying, and broadcasting of moving visual images.

Animation: - Animation is the art of presenting images with the help of computer technology in the manner that the user thinks that it is running like a film. 

Text: - In all the multimedia production contains some amount of text. The text has generally different fonts, shapes, sizes,s, etc. Text is the character that the user can read. 

Images: - An Image is a visual representation of something that can be stored in electronic form. There are Many images such as- jpg, jpeg, png, etc 

In this tutorial, we have seen multimedia and its components. If you have any issues related to this article. then you can tell us by commenting below.


Continue Reading →

Like us on facebook

blogger templatesblogger widgets

Follow on Twitter

Linkedin

Categories

Blog Archive

Contact Form

Name

Email *

Message *

Mad About Computer. Powered by Blogger.