Skip to main content

HTML & CSS

 





HTML & CSS:

                CSS Stands for “Cascading Style Sheet”. It was introduced in late 1996.

            CSS saves a lot of work and time.

With CSS, you can control the color, font, the size of text, the spacing between elements,  what background images or background colors are to be used, different displays for different devices and screen sizes, how elements are positioned and laid out, and much more!

 It is used to control the layout of various

            Web pages all at once.

Types of CSS:

            There are three types of the style sheet

1.      Inline styling

2.      Internal styling

3.      External styling

Inline Styling:

                An inline CSS is used to apply a style to a single HTML element.

An inline CSS uses the "style" attribute of an HTML element.

 

Example:

                Following are some examples of inline CSS.

1.         <h1 style="color:red;">A Red Heading</h1>

2.         <p style="color:green;">A Green paragraph.</p>

Internal Styling:

               

An internal CSS is defined in the <head> section of an HTML page, within a <style> element. Used to apply a style for a single HTML page.

Example:

The following example sets the text color of ALL the <h1> elements (on that page) to “silver” and the text color of ALL the <p> elements to red. In addition, the page will be displayed with a "powderBlue"

<html>

<head>

<style>

body {background-color: powderblue;}

h1   {color: selver;}

p    {color: red;}

</style>

</head>

<body>

 

<h1>This is a heading</h1>

<p>This is a paragraph.</p>

 

</body>

</html>

External Styling:

            An external style sheet is defined in a separate file saved with “.css” extension.

            To use an external style sheet, add a link to it in the <head> section of each HTML page by using <link> tag.

It is useful when the style is applied to many web pages

Example:

           

 

<html>

<head>

                        <link rel=”stylesheet” type=”text/css” href=”mystyle.css”>

</head>

<body>

 

<h1>This is a heading</h1>

<p>This is a paragraph.</p>

 

</body>

</html>

 

The file must not contain any HTML code and must be saved with a .css extension.

The external style sheet can be written in any text editor.

 

The "styles.css" file looks like:

 

"styles.css":

 

body {

 

  background-color: silver;

}

h1 {

  color: red;

}

p {

  color: blue;

}

Comments

Popular posts from this blog

Computer Network Architecture

Computer Network Architecture  PC Network Architecture is characterized as the physical and sensible plan of the product, equipment, conventions, and media of the transmission of information. Essentially we can say that how PCs are coordinated and how assignments are apportioned to the PC.  Types of network architectures are used: Peer-To-Peer network Client/Server network Peer-To-Peer network: A Peer-To-Peer network is an organization wherein every one of the PCs is connected along with equivalent advantages and obligations regarding preparing the information.  The Peer-To-Peer network is helpful for little conditions, generally up to 10 PCs.  The distributed organization has no devoted workers.  Extraordinary consents are appointed to every PC for sharing the assets, yet this can prompt an issue if the PC with the asset is down.  Computer Network Architecture  Computer Network Architecture is characterized as the physical and sensible plan of the pro...

Basics of Automata Theory

 Basics of Automata Theory  What is Automata Theory?  Introduction Automata Theory is an energizing, hypothetical part of software engineering. It set up its foundations during the twentieth Century, as mathematicians started creating - both hypothetically and in a real sense - machines that imitated certain highlights of man, finishing estimations all the more rapidly and dependably. The word machine itself, firmly identified with "mechanization", signifies programmed measures doing the creation of explicit cycles. Essentially expressed, the automata hypothesis manages the rationale of calculation concerning straightforward machines, alluded to as automata. Through automata, PC researchers can see how machines figure works and tackle issues and all the more significantly, how it affects a capacity to be characterized as calculable or for an inquiry to be depicted as decidable.  Robots are unique models of machines that perform calculations on a contribution by trave...

Highlights/Features Of Computer Network

 Highlights/Features Of Computer Network Highlights Of Computer organization  In this article guide, we will talk about the highlights of a Computer Network  A rundown Of Computer network highlights is given underneath.  Execution  communication speed  Document sharing  Back up and Rollback is simple  Programming and Hardware sharing  Security  Versatility  Unwavering quality  Execution:  The performance of a Computer network is estimated as far as reaction time. The reaction season of sending and getting information from one hub (PC in a PC network regularly alludes to a hub) to another ought to be negligible.  Information Sharing: One of the motivations behind why we utilize a PC network is to divide the information among various frameworks associated with one another through transmission media.  Reinforcement:  A PC network should have a focal worker that keeps the reinforcement of all the information tha...