SlideShare a Scribd company logo
Internet Technology
Unit - II
 Cascading Style Sheets, fondly referred to as CSS, is a
simple design language intended to simplify the
process of making web pages presentable.
 CSS handles the look and feel part of a web page.
 Using CSS, can control the color of the text, the style
of fonts, the spacing between paragraphs, how columns
are sized and laid out, what background images or
colors are used, layout designs, variations in display for
different devices and screen sizes as well as a variety of
other effects.
Introduction CSS
 CSS saves time – We can write CSS once and then reuse
same sheet in multiple HTML pages. You can define a
style for each HTML element and apply it to as many Web
pages as you want.
 Pages load faster − If you are using CSS, you do not need
to write HTML tag attributes every time. Just write one
CSS rule of a tag and apply it to all the occurrences of that
tag. So less code means faster download times.
 Easy maintenance − To make a global change, simply
change the style, and all elements in all the web pages will
be updated automatically.
Advantages of CSS
 Superior styles to HTML − CSS has a much wider
array of attributes than HTML, so you can give a far
better look to your HTML page in comparison to
HTML attributes.
 Global web standards − Now HTML attributes are
being deprecated and it is being recommended to use
CSS. So its a good idea to start using CSS in all the
HTML pages to make them compatible to future
browsers.
 CSS is created and maintained through a group of
people within the W3C called the CSS Working Group.
 The CSS Working Group creates documents called
specifications.
 When a specification has been discussed and officially
ratified by the W3C members, it becomes a
recommendation.
Who Creates and Maintains CSS?
A CSS comprises of style rules that are interpreted by the
browser and then applied to the corresponding elements in
your document. A style rule is made of three parts −
 Selector − A selector is an HTML tag at which a style will
be applied. This could be any tag like <h1> or <table> etc.
 Property − A property is a type of attribute of HTML tag.
Put simply, all the HTML attributes are converted into
CSS properties. They could be color, border etc.
 Value − Values are assigned to properties. For example,
color property can have value either red or #F1F1F1 etc.
CSS - Syntax
What is 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
 External stylesheets are stored in CSS files
 Why Use CSS?
 CSS is used to define styles for your web pages,
including the design, layout and variations in
display for different devices and screen sizes.
 body {
background-color: lightblue;
}
h1 {
color: white;
text-align: center;
}
p {
font-family: verdana;
font-size: 20px;
}
CSS Style Rule Syntax as follows −
selector { property: value }
Example − table border as follows
table{ border :1px solid #C00; }
Here table is a selector and border is a property and given value 1px solid
#C00 is the value of that property.
<html>
<head>
<title>This is document title</title>
<style>
h1 {
color: #36CFFF;
}
</style>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
Cascading style sheet, CSS Box model, Table in CSS
Cascading Style Sheet(CSS) is used to set the style in
web pages that contain HTML elements.
It sets the background color, font-size, font-family, color,
etc property of elements on a web page.
There are three types of CSS which are given below:
 Inline CSS
 Internal or Embedded CSS
 External CSS
CSS styling
Inline CSS:
 Inline CSS contains the CSS property in the body
section attached with element is known as inline CSS.
 This kind of style is specified within an HTML tag
using the style attribute.
 Inline styles are defined within the "style" attribute of
the relevant element:
<html>
<body>
<h1 style="color: navy; margin-left: 20px;">Hello, World!</h1>
<p style="font-size: 16px; color: darkgreen; background-color:
lightyellow;">
This is a paragraph styled with inline CSS.
</p>
</body>
</html>
Advantages of Inline CSS:
 You can easily and quickly insert CSS rules to an
HTML page. That’s why this method is useful for
testing or previewing the changes, and performing
quick-fixes to your website.
 You don’t need to create and upload a separate
document as in the external style.
Disadvantages of Inline CSS:
 Adding CSS rules to every HTML element is time-
consuming and makes your HTML structure messy.
 Styling multiple elements can affect your page’s size
and download time.
 An internal style sheet may be used if one single
HTML page has a unique style.
 The internal style is defined inside the <style> element,
inside the head section.
Example
 Internal styles are defined within the <style> element,
inside the <head> section of an HTML page:
Internal CSS
<html>
<head>
<style>
body {
background-color: lightblue;
}
h1 {
color: navy;
margin-left: 20px;
}
p {
font-size: 16px;
color: darkgreen;
background-color: lightyellow;
}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Cascading style sheet, CSS Box model, Table in CSS
 With an external style sheet, you can change the look
of an entire website by changing just one file!
 Each HTML page must include a reference to the
external style sheet file inside the <link> element,
inside the head section.
Example
 External styles are defined within the <link> element,
inside the <head> section of an HTML page:
External CSS
<html>
<head>
<title>External CSS Example</title>
<link rel="stylesheet" href="styles1.css">
</head>
<body>
<h1>Welcome to My Page</h1>
<p>This is a paragraph styled with external CSS.</p>
<button>Click Me</button>
</body>
</html>
body {
background-color: lightblue;
}
h1 {
color: navy;
margin-left: 20px;
}
p {
font-size: 16px;
color: darkgreen;
background-color: lightyellow;
padding: 60px;
border: 1px solid green;
}
button {
background-color: orange;
color: white;
border: none;
padding: 10px;
cursor: pointer;
}
button:hover {
background-color: darkorange;
}
Styles.css
The following text properties of an element −
 The color property is used to set the color of a text.
 The direction property is used to set the text
direction.
 The letter-spacing property is used to add or
subtract space between the letters that make up a
word.
 The word-spacing property is used to add or
subtract space between the words of a sentence.
Controlling text and text formatting
 The text-align property is used to align the text of a
document.
 The text-decoration property is used to underline,
overline, and strikethrough text.
 The text-transform property is used to capitalize text
or convert text to uppercase or lowercase letters
<html>
<head>
<title>Text Properties Example</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="text-example">
This is a simple example of CSS text properties.
</div>
</body>
</html>
Example
.text-example {
color: blue; /* Sets the text color to blue */
direction: rtl; /* Sets the text direction to right-to-left */
letter-spacing: 2px; /* Adds 2px space between each letter
*/
word-spacing: 5px; /* Adds 5px space between each word */
text-align: center; /* Aligns the text to the center of the
container */
text-decoration: underline; /* Underlines the text */
text-transform: uppercase; /* Converts all the text to
uppercase letters */
}
Styles.css
 CSS selectors are used to select the content you want
to style.
 Selectors are the part of CSS rule set.
 CSS selectors select HTML elements according to its
id, class, type, attribute etc.
CSS Selectors
There are several different types of selectors in CSS.
1. CSS Element Selector
2. CSS Id Selector
3. CSS Class Selector
4. CSS Universal Selector
5. CSS Group Selector
1. CSS Element Selector
 The element selector selects HTML elements based on
the element name.
<html>
<head>
<style>
p {
background-color: red;
}
</style>
</head>
<body>
<h1>Demo of the element selector</h1>
<p id="firstname">My name is Donald.</p>
<p id="hometown">I live in Duckburg.</p>
<p>My best friend is Mickey.</p>
</body>
</html>
2. CSS Id Selector
 The id selector selects the id attribute of an HTML
element to select a specific element.
 An id is always unique within the page so it is chosen
to select a single, unique element.
 It is written with the hash character (#), followed by the
id of the element.
<!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>
3. CSS Class Selector
 The class selector selects HTML elements with a
specific class attribute. It is used with a period
character . (full stop symbol) followed by the class
name.
 The class selector is used to apply styles to multiple
elements. You can assign the same class to as many
elements as you want.
<html>
<head>
<style>
p.center {
text-align: center;
color: red;
}
</style>
</head>
<body>
<h1 class="center">This heading will not be affected</h1>
<p class="center">This paragraph will be red and center-aligned.</p>
</body>
</html>
4. CSS Universal Selector
 The universal selector (*) selects all HTML elements
on the page.
 The CSS universal selector is a powerful tool that
applies styles to every element on a webpage.
 When you use the universal selector, it targets all
elements in the document, allowing you to apply global
styles with a single rule.
<html>
<head>
<style>
* {
text-align: center;
color: blue;
}
</style>
</head>
<body>
<h1>Hello world!</h1>
<p>Every element on the page will be affected by the style.</p>
<p id="para1">Me too!</p>
<p>And me!</p>
</body>
</html>
5. CSS Grouping Selector
 The grouping selector selects all the HTML elements with the same
style definitions.
 h1 {
text-align: center;
color: red;
}
h2 {
text-align: center;
color: red;
}
p {
text-align: center;
color: red;
}
 It will be better to group the selectors, to minimize the
code.
 To group selectors, separate each selector with a
comma.
 h1, h2, p {
text-align: center;
color: red;
}
<html>
<head>
<style>
h1, h2, p {
text-align: center;
color: red;
}
</style>
</head>
<body>
<h1>Hello World!</h1>
<h2>Smaller heading!</h2>
<p>This is a paragraph.</p>
</body>
</html>
 CSS box model is a container which contains multiple
properties including borders, margin, padding and the
content itself.
 It is used to create the design and layout of web pages.
 It can be used as a toolkit for customizing the layout of
different elements.
 Box-Model has multiple properties in CSS. Some of
them are given below:
The CSS Box Model
 borders
 margins
 padding
 Content
 The box model allows us to add a border around
elements, and to define space between elements.
 Border Area: It is the area between the box’s padding
and margin. Its dimensions are given by the width and
height of border.
 Margin Area: This area consists of space between
border and margin. The dimensions of Margin area are
the margin-box width and the margin-box height. It is
useful to separate the element from its neighbors.
 Padding Area: It includes the element’s padding. This
area is actually the space around the content area and
within the border box. Its dimensions are given by the
width of the padding-box and the height of the
padding-box.
 Content Area: This area consists of content like text,
image, or other media content. It is bounded by the
content edge and its dimensions are given by content
box width and height.
Table Borders
 To specify table borders in CSS, use the border
property.
 The example below specifies a black border for
<table>, <th>, and <td> elements:
Tables in CSS
<html>
<head>
<style>
table, th, td
{
border: 1px solid black;
}
</style>
</head>
<body>
<h2>Add a border to a table:</h2>
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>Peter</td>
<td>Griffin</td>
</tr>
<tr>
<td>Lois</td>
<td>Griffin</td>
</tr>
</table>
</body>
</html>
 Output:
 Width and height of a table are defined by the width
and height properties.
 The example below sets the width of the table to 100%,
and the height of the <th> elements to 50px:
Table Width and Height
<html>
<head>
<style>
table, td, th {
border: 1px solid black;
}
table {
border-collapse: collapse/separate;
width: 100%;
}
th {
height: 50px;
}
</style>
</head>
<body>
<h2>The width and height Properties</h2>
<p>Set the width of the table, and the height of the table header
row:</p>
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Savings</th>
</tr>
<tr>
<td>Peter</td>
<td>Griffin</td>
<td>$100</td>
</tr>
<tr>
<td>Lois</td>
<td>Griffin</td>
<td>$150</td>
</tr>
<tr>
<td>Joe</td>
<td>Swanson</td>
<td>$300</td>
</tr>
<tr>
<td>Cleveland</td>
<td>Brown</td>
<td>$250</td>
</tr>
</table>
</body>
</html>
Cascading style sheet, CSS Box model, Table in CSS
 A navigation bar needs standard HTML as a
base.
 In our examples we will build the navigation
bar from a standard HTML list.
 A navigation bar is basically a list of links, so
using the <ul> and <li> elements makes perfect
sense:
Navigation Bar = List of Links
<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<p>In this example, we remove the bullets from the list, and its default padding and
margin.</p>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="about.html">About</a></li>
</ul>
</body>
</html>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
width: 200px;
background-color: #f1f1f1;
}
li a {
display: block;
color: #000;
padding: 8px 16px;
text-decoration: none;
}
/* Change the link color on hover */
li a:hover {
background-color: #555;
color: white;
}
</style>
Vertical Navigation Bar
</head>
<body>
<h2>Vertical Navigation Bar</h2>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover {
background-color: #111;
}
</style>
</head>
Horizontal Navigation Bar
<body>
<ul>
<li><a class="active“
href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
</body>
</html>
CSS Website Layout
 Header
 A header is usually located at the top of the website
(or right below a top navigation menu). It often
contains a logo or the website name
.header {
background-color: #F1F1F1;
text-align: center;
padding: 20px;
}
<style>
body {
margin: 0;
}
/* Style the header */
.header {
background-color: #f1f1f1;
padding: 20px;
text-align: center;
}
</style>
</head>
<body>
<div class="header">
<h1>Header</h1>
</div>
</body>
</html>
 Navigation Bar
 A navigation bar contains a list of links to help visitors
navigating through your website:
/* The navbar container */
.topnav {
overflow: hidden;
background-color: #333;
}
<html>
<head>
<title>CSS Website Layout</title>
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
}
/* Style the header */
.header {
background-color: #f1f1f1;
padding: 20px;
text-align: center;
}
/* Style the top navigation bar */
.topnav {
overflow: hidden;
background-color: #333;
}
/* Style the topnav links */
.topnav a {
float: left;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
/* Change color on hover */
.topnav a:hover {
background-color: #ddd;
color: black;
}
</style>
</head>
<body>
<div class="header">
<h1>Header</h1>
</div>
<div class="topnav">
<a href="#">Link</a>
<a href="#">Link</a>
<a href="#">Link</a>
</div>
</body>
</html>
 Content
 The layout in this section, often depends on the target users. The
most common layout is one (or combining them) of the following:
 1-column (often used for mobile browsers)
 2-column (often used for tablets and laptops)
 3-column layout (only used for desktops)
.column {
float: left;
width: 33.33%;
}
Footer
 The footer is placed at the bottom of your page. It often
contains information like copyright and contact info:
Example
 .footer {
background-color: #F1F1F1;
text-align: center;
padding: 10px;
}
Margin
•margin-top
•margin-right
•margin-bottom
•margin-left
 p {
margin-top: 100px;
margin-bottom: 100px;
margin-right: 150px;
margin-left: 80px;
}
 The border-style property specifies what kind of border to display.
 The following values are allowed:
 dotted - Defines a dotted border
 dashed - Defines a dashed border
 solid - Defines a solid border
 double - Defines a double border
 groove - Defines a 3D grooved border. The effect depends on the border-color
value
 ridge - Defines a 3D ridged border. The effect depends on the border-color
value
 inset - Defines a 3D inset border. The effect depends on the border-color
value
 outset - Defines a 3D outset border. The effect depends on the border-color
value
 none - Defines no border
 hidden - Defines a hidden border
 The border-style property can have from one to four values (for the top
border, right border, bottom border, and the left border).
CSS Borders
<!DOCTYPE html>
<html>
<head>
<style>
div {
border: 1px solid black;
background-color: lightblue;
padding-top: 50px;
padding-right: 30px;
padding-bottom: 50px;
padding-left: 80px;
}
</style>
</head>
<body>
<h2>Using individual padding properties</h2>
<div>This div element has a top padding of 50px, a right padding of 30px, a bottom padding of
50px, and a left padding of 80px.</div>
</body>
</html>
CSS Padding
<!DOCTYPE html>
<html>
<head>
<style>
div {
border: 1px solid black;
padding: 25px 50px 75px 100px;
background-color: lightblue;
}
</style>
</head>
<body>
<h2>The padding shorthand property - 4 values</h2>
<div>This div element has a top padding of 25px, a right padding of 50px, a bottom padding of
75px, and a left padding of 100px.</div>
</body>
</html>
Padding short hand

More Related Content

Similar to Cascading style sheet, CSS Box model, Table in CSS (20)

IP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).pptIP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).ppt
kassahungebrie
 
Chapter_1_Web_Technologies_Basics (CSS)_Part_2.pptx
Chapter_1_Web_Technologies_Basics (CSS)_Part_2.pptxChapter_1_Web_Technologies_Basics (CSS)_Part_2.pptx
Chapter_1_Web_Technologies_Basics (CSS)_Part_2.pptx
eyasu6
 
Chapter 3 - CSS.pdf
Chapter 3 - CSS.pdfChapter 3 - CSS.pdf
Chapter 3 - CSS.pdf
wubiederebe1
 
CSS notes
CSS notesCSS notes
CSS notes
Rajendra Prasad
 
Advanced Web Programming Chapter 8
Advanced Web Programming Chapter 8Advanced Web Programming Chapter 8
Advanced Web Programming Chapter 8
RohanMistry15
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
Mukesh Tekwani
 
html-css
html-csshtml-css
html-css
Dhirendra Chauhan
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
Joseph Gabriel
 
v5-introduction to html-css-210321161444.pptx
v5-introduction to html-css-210321161444.pptxv5-introduction to html-css-210321161444.pptx
v5-introduction to html-css-210321161444.pptx
hannahroseline2
 
v5-introduction to html-css-210321161444.pptx
v5-introduction to html-css-210321161444.pptxv5-introduction to html-css-210321161444.pptx
v5-introduction to html-css-210321161444.pptx
hannahroseline2
 
chitra
chitrachitra
chitra
sweet chitra
 
Css introduction
Css introductionCss introduction
Css introduction
Sridhar P
 
Css introduction
Css  introductionCss  introduction
Css introduction
vishnu murthy
 
Web Designing
Web DesigningWeb Designing
Web Designing
R.Karthikeyan - Vivekananda College
 
Css
CssCss
Css
Jahid Blackrose
 
Workshop 2 Slides.pptx
Workshop 2 Slides.pptxWorkshop 2 Slides.pptx
Workshop 2 Slides.pptx
DaniyalSardar
 
Unit iii css and javascript 1
Unit iii css and javascript 1Unit iii css and javascript 1
Unit iii css and javascript 1
Jesus Obenita Jr.
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
Folasade Adedeji
 
Css ms megha
Css ms meghaCss ms megha
Css ms megha
Megha Gupta
 
INTRODUCTIONS OF CSS
INTRODUCTIONS OF CSSINTRODUCTIONS OF CSS
INTRODUCTIONS OF CSS
SURYANARAYANBISWAL1
 

More from SherinRappai (20)

Shells commands, file structure, directory structure.pptx
Shells commands, file structure, directory structure.pptxShells commands, file structure, directory structure.pptx
Shells commands, file structure, directory structure.pptx
SherinRappai
 
Shell Programming Language in Operating System .pptx
Shell Programming Language in Operating System .pptxShell Programming Language in Operating System .pptx
Shell Programming Language in Operating System .pptx
SherinRappai
 
Types of NoSql Database available.pptx
Types of NoSql   Database available.pptxTypes of NoSql   Database available.pptx
Types of NoSql Database available.pptx
SherinRappai
 
Introduction to NoSQL & Features of NoSQL.pptx
Introduction to NoSQL & Features of NoSQL.pptxIntroduction to NoSQL & Features of NoSQL.pptx
Introduction to NoSQL & Features of NoSQL.pptx
SherinRappai
 
Clustering, Types of clustering, Types of data
Clustering, Types of clustering, Types of dataClustering, Types of clustering, Types of data
Clustering, Types of clustering, Types of data
SherinRappai
 
Association rule introduction, Market basket Analysis
Association rule introduction, Market basket AnalysisAssociation rule introduction, Market basket Analysis
Association rule introduction, Market basket Analysis
SherinRappai
 
Introduction to Internet, Domain Name System
Introduction to Internet, Domain Name SystemIntroduction to Internet, Domain Name System
Introduction to Internet, Domain Name System
SherinRappai
 
Numpy in python, Array operations using numpy and so on
Numpy in python, Array operations using numpy and so onNumpy in python, Array operations using numpy and so on
Numpy in python, Array operations using numpy and so on
SherinRappai
 
Functions in python, types of functions in python
Functions in python, types of functions in pythonFunctions in python, types of functions in python
Functions in python, types of functions in python
SherinRappai
 
Extensible markup language ppt as part of Internet Technology
Extensible markup language ppt as part of Internet TechnologyExtensible markup language ppt as part of Internet Technology
Extensible markup language ppt as part of Internet Technology
SherinRappai
 
Java script ppt from students in internet technology
Java script ppt from students in internet technologyJava script ppt from students in internet technology
Java script ppt from students in internet technology
SherinRappai
 
Building Competency and Career in the Open Source World
Building Competency and Career in the Open Source WorldBuilding Competency and Career in the Open Source World
Building Competency and Career in the Open Source World
SherinRappai
 
How to Build a Career in Open Source.pptx
How to Build a Career in Open Source.pptxHow to Build a Career in Open Source.pptx
How to Build a Career in Open Source.pptx
SherinRappai
 
Issues in Knowledge representation for students
Issues in Knowledge representation for studentsIssues in Knowledge representation for students
Issues in Knowledge representation for students
SherinRappai
 
A* algorithm of Artificial Intelligence for BCA students
A* algorithm of Artificial Intelligence for BCA studentsA* algorithm of Artificial Intelligence for BCA students
A* algorithm of Artificial Intelligence for BCA students
SherinRappai
 
Unit 2.pptx
Unit 2.pptxUnit 2.pptx
Unit 2.pptx
SherinRappai
 
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptxCOMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
SherinRappai
 
Clustering.pptx
Clustering.pptxClustering.pptx
Clustering.pptx
SherinRappai
 
neuralnetwork.pptx
neuralnetwork.pptxneuralnetwork.pptx
neuralnetwork.pptx
SherinRappai
 
Rendering Algorithms.pptx
Rendering Algorithms.pptxRendering Algorithms.pptx
Rendering Algorithms.pptx
SherinRappai
 
Shells commands, file structure, directory structure.pptx
Shells commands, file structure, directory structure.pptxShells commands, file structure, directory structure.pptx
Shells commands, file structure, directory structure.pptx
SherinRappai
 
Shell Programming Language in Operating System .pptx
Shell Programming Language in Operating System .pptxShell Programming Language in Operating System .pptx
Shell Programming Language in Operating System .pptx
SherinRappai
 
Types of NoSql Database available.pptx
Types of NoSql   Database available.pptxTypes of NoSql   Database available.pptx
Types of NoSql Database available.pptx
SherinRappai
 
Introduction to NoSQL & Features of NoSQL.pptx
Introduction to NoSQL & Features of NoSQL.pptxIntroduction to NoSQL & Features of NoSQL.pptx
Introduction to NoSQL & Features of NoSQL.pptx
SherinRappai
 
Clustering, Types of clustering, Types of data
Clustering, Types of clustering, Types of dataClustering, Types of clustering, Types of data
Clustering, Types of clustering, Types of data
SherinRappai
 
Association rule introduction, Market basket Analysis
Association rule introduction, Market basket AnalysisAssociation rule introduction, Market basket Analysis
Association rule introduction, Market basket Analysis
SherinRappai
 
Introduction to Internet, Domain Name System
Introduction to Internet, Domain Name SystemIntroduction to Internet, Domain Name System
Introduction to Internet, Domain Name System
SherinRappai
 
Numpy in python, Array operations using numpy and so on
Numpy in python, Array operations using numpy and so onNumpy in python, Array operations using numpy and so on
Numpy in python, Array operations using numpy and so on
SherinRappai
 
Functions in python, types of functions in python
Functions in python, types of functions in pythonFunctions in python, types of functions in python
Functions in python, types of functions in python
SherinRappai
 
Extensible markup language ppt as part of Internet Technology
Extensible markup language ppt as part of Internet TechnologyExtensible markup language ppt as part of Internet Technology
Extensible markup language ppt as part of Internet Technology
SherinRappai
 
Java script ppt from students in internet technology
Java script ppt from students in internet technologyJava script ppt from students in internet technology
Java script ppt from students in internet technology
SherinRappai
 
Building Competency and Career in the Open Source World
Building Competency and Career in the Open Source WorldBuilding Competency and Career in the Open Source World
Building Competency and Career in the Open Source World
SherinRappai
 
How to Build a Career in Open Source.pptx
How to Build a Career in Open Source.pptxHow to Build a Career in Open Source.pptx
How to Build a Career in Open Source.pptx
SherinRappai
 
Issues in Knowledge representation for students
Issues in Knowledge representation for studentsIssues in Knowledge representation for students
Issues in Knowledge representation for students
SherinRappai
 
A* algorithm of Artificial Intelligence for BCA students
A* algorithm of Artificial Intelligence for BCA studentsA* algorithm of Artificial Intelligence for BCA students
A* algorithm of Artificial Intelligence for BCA students
SherinRappai
 
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptxCOMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
SherinRappai
 
neuralnetwork.pptx
neuralnetwork.pptxneuralnetwork.pptx
neuralnetwork.pptx
SherinRappai
 
Rendering Algorithms.pptx
Rendering Algorithms.pptxRendering Algorithms.pptx
Rendering Algorithms.pptx
SherinRappai
 

Recently uploaded (20)

Buckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug LogsBuckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug Logs
Lynda Kane
 
Building Resilience with Energy Management for the Public Sector
Building Resilience with Energy Management for the Public SectorBuilding Resilience with Energy Management for the Public Sector
Building Resilience with Energy Management for the Public Sector
Splunk
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Ai voice agent for customer care | PPT | Presentation
Ai voice agent for customer care | PPT | PresentationAi voice agent for customer care | PPT | Presentation
Ai voice agent for customer care | PPT | Presentation
Codiste
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Kualitatem’s Cybersecurity Risk Assessment
Kualitatem’s Cybersecurity Risk AssessmentKualitatem’s Cybersecurity Risk Assessment
Kualitatem’s Cybersecurity Risk Assessment
Kualitatem Inc
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical DebtBuckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Lynda Kane
 
Digital Experience - Enterprise Data Quadrant Report.pdf
Digital Experience - Enterprise Data Quadrant Report.pdfDigital Experience - Enterprise Data Quadrant Report.pdf
Digital Experience - Enterprise Data Quadrant Report.pdf
EliseoCastroJimenez
 
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5..."Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
Fwdays
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Datastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptxDatastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptx
kaleeswaric3
 
CPMN (Feb-25) - North Star framework (Louise May)
CPMN (Feb-25) - North Star framework (Louise May)CPMN (Feb-25) - North Star framework (Louise May)
CPMN (Feb-25) - North Star framework (Louise May)
Cambridge Product Management Network
 
Automation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From AnywhereAutomation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From Anywhere
Lynda Kane
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Buckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug LogsBuckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug Logs
Lynda Kane
 
Building Resilience with Energy Management for the Public Sector
Building Resilience with Energy Management for the Public SectorBuilding Resilience with Energy Management for the Public Sector
Building Resilience with Energy Management for the Public Sector
Splunk
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Ai voice agent for customer care | PPT | Presentation
Ai voice agent for customer care | PPT | PresentationAi voice agent for customer care | PPT | Presentation
Ai voice agent for customer care | PPT | Presentation
Codiste
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Kualitatem’s Cybersecurity Risk Assessment
Kualitatem’s Cybersecurity Risk AssessmentKualitatem’s Cybersecurity Risk Assessment
Kualitatem’s Cybersecurity Risk Assessment
Kualitatem Inc
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical DebtBuckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Lynda Kane
 
Digital Experience - Enterprise Data Quadrant Report.pdf
Digital Experience - Enterprise Data Quadrant Report.pdfDigital Experience - Enterprise Data Quadrant Report.pdf
Digital Experience - Enterprise Data Quadrant Report.pdf
EliseoCastroJimenez
 
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5..."Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
Fwdays
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Datastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptxDatastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptx
kaleeswaric3
 
Automation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From AnywhereAutomation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From Anywhere
Lynda Kane
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 

Cascading style sheet, CSS Box model, Table in CSS

  • 2.  Cascading Style Sheets, fondly referred to as CSS, is a simple design language intended to simplify the process of making web pages presentable.  CSS handles the look and feel part of a web page.  Using CSS, can control the color of the text, the style of fonts, the spacing between paragraphs, how columns are sized and laid out, what background images or colors are used, layout designs, variations in display for different devices and screen sizes as well as a variety of other effects. Introduction CSS
  • 3.  CSS saves time – We can write CSS once and then reuse same sheet in multiple HTML pages. You can define a style for each HTML element and apply it to as many Web pages as you want.  Pages load faster − If you are using CSS, you do not need to write HTML tag attributes every time. Just write one CSS rule of a tag and apply it to all the occurrences of that tag. So less code means faster download times.  Easy maintenance − To make a global change, simply change the style, and all elements in all the web pages will be updated automatically. Advantages of CSS
  • 4.  Superior styles to HTML − CSS has a much wider array of attributes than HTML, so you can give a far better look to your HTML page in comparison to HTML attributes.  Global web standards − Now HTML attributes are being deprecated and it is being recommended to use CSS. So its a good idea to start using CSS in all the HTML pages to make them compatible to future browsers.
  • 5.  CSS is created and maintained through a group of people within the W3C called the CSS Working Group.  The CSS Working Group creates documents called specifications.  When a specification has been discussed and officially ratified by the W3C members, it becomes a recommendation. Who Creates and Maintains CSS?
  • 6. A CSS comprises of style rules that are interpreted by the browser and then applied to the corresponding elements in your document. A style rule is made of three parts −  Selector − A selector is an HTML tag at which a style will be applied. This could be any tag like <h1> or <table> etc.  Property − A property is a type of attribute of HTML tag. Put simply, all the HTML attributes are converted into CSS properties. They could be color, border etc.  Value − Values are assigned to properties. For example, color property can have value either red or #F1F1F1 etc. CSS - Syntax
  • 7. What is 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  External stylesheets are stored in CSS files
  • 8.  Why Use CSS?  CSS is used to define styles for your web pages, including the design, layout and variations in display for different devices and screen sizes.
  • 9.  body { background-color: lightblue; } h1 { color: white; text-align: center; } p { font-family: verdana; font-size: 20px; }
  • 10. CSS Style Rule Syntax as follows − selector { property: value } Example − table border as follows table{ border :1px solid #C00; } Here table is a selector and border is a property and given value 1px solid #C00 is the value of that property.
  • 11. <html> <head> <title>This is document title</title> <style> h1 { color: #36CFFF; } </style> </head> <body> <h1>Hello World!</h1> </body> </html>
  • 13. Cascading Style Sheet(CSS) is used to set the style in web pages that contain HTML elements. It sets the background color, font-size, font-family, color, etc property of elements on a web page. There are three types of CSS which are given below:  Inline CSS  Internal or Embedded CSS  External CSS CSS styling
  • 14. Inline CSS:  Inline CSS contains the CSS property in the body section attached with element is known as inline CSS.  This kind of style is specified within an HTML tag using the style attribute.  Inline styles are defined within the "style" attribute of the relevant element:
  • 15. <html> <body> <h1 style="color: navy; margin-left: 20px;">Hello, World!</h1> <p style="font-size: 16px; color: darkgreen; background-color: lightyellow;"> This is a paragraph styled with inline CSS. </p> </body> </html>
  • 16. Advantages of Inline CSS:  You can easily and quickly insert CSS rules to an HTML page. That’s why this method is useful for testing or previewing the changes, and performing quick-fixes to your website.  You don’t need to create and upload a separate document as in the external style.
  • 17. Disadvantages of Inline CSS:  Adding CSS rules to every HTML element is time- consuming and makes your HTML structure messy.  Styling multiple elements can affect your page’s size and download time.
  • 18.  An internal style sheet may be used if one single HTML page has a unique style.  The internal style is defined inside the <style> element, inside the head section. Example  Internal styles are defined within the <style> element, inside the <head> section of an HTML page: Internal CSS
  • 19. <html> <head> <style> body { background-color: lightblue; } h1 { color: navy; margin-left: 20px; } p { font-size: 16px; color: darkgreen; background-color: lightyellow; } </style> </head> <body> <h1>This is a heading</h1> <p>This is a paragraph.</p> </body> </html>
  • 21.  With an external style sheet, you can change the look of an entire website by changing just one file!  Each HTML page must include a reference to the external style sheet file inside the <link> element, inside the head section. Example  External styles are defined within the <link> element, inside the <head> section of an HTML page: External CSS
  • 22. <html> <head> <title>External CSS Example</title> <link rel="stylesheet" href="styles1.css"> </head> <body> <h1>Welcome to My Page</h1> <p>This is a paragraph styled with external CSS.</p> <button>Click Me</button> </body> </html>
  • 23. body { background-color: lightblue; } h1 { color: navy; margin-left: 20px; } p { font-size: 16px; color: darkgreen; background-color: lightyellow; padding: 60px; border: 1px solid green; } button { background-color: orange; color: white; border: none; padding: 10px; cursor: pointer; } button:hover { background-color: darkorange; } Styles.css
  • 24. The following text properties of an element −  The color property is used to set the color of a text.  The direction property is used to set the text direction.  The letter-spacing property is used to add or subtract space between the letters that make up a word.  The word-spacing property is used to add or subtract space between the words of a sentence. Controlling text and text formatting
  • 25.  The text-align property is used to align the text of a document.  The text-decoration property is used to underline, overline, and strikethrough text.  The text-transform property is used to capitalize text or convert text to uppercase or lowercase letters
  • 26. <html> <head> <title>Text Properties Example</title> <link rel="stylesheet" href="styles.css"> </head> <body> <div class="text-example"> This is a simple example of CSS text properties. </div> </body> </html> Example
  • 27. .text-example { color: blue; /* Sets the text color to blue */ direction: rtl; /* Sets the text direction to right-to-left */ letter-spacing: 2px; /* Adds 2px space between each letter */ word-spacing: 5px; /* Adds 5px space between each word */ text-align: center; /* Aligns the text to the center of the container */ text-decoration: underline; /* Underlines the text */ text-transform: uppercase; /* Converts all the text to uppercase letters */ } Styles.css
  • 28.  CSS selectors are used to select the content you want to style.  Selectors are the part of CSS rule set.  CSS selectors select HTML elements according to its id, class, type, attribute etc. CSS Selectors
  • 29. There are several different types of selectors in CSS. 1. CSS Element Selector 2. CSS Id Selector 3. CSS Class Selector 4. CSS Universal Selector 5. CSS Group Selector
  • 30. 1. CSS Element Selector  The element selector selects HTML elements based on the element name.
  • 31. <html> <head> <style> p { background-color: red; } </style> </head> <body> <h1>Demo of the element selector</h1> <p id="firstname">My name is Donald.</p> <p id="hometown">I live in Duckburg.</p> <p>My best friend is Mickey.</p> </body> </html>
  • 32. 2. CSS Id Selector  The id selector selects the id attribute of an HTML element to select a specific element.  An id is always unique within the page so it is chosen to select a single, unique element.  It is written with the hash character (#), followed by the id of the element.
  • 33. <!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>
  • 34. 3. CSS Class Selector  The class selector selects HTML elements with a specific class attribute. It is used with a period character . (full stop symbol) followed by the class name.  The class selector is used to apply styles to multiple elements. You can assign the same class to as many elements as you want.
  • 35. <html> <head> <style> p.center { text-align: center; color: red; } </style> </head> <body> <h1 class="center">This heading will not be affected</h1> <p class="center">This paragraph will be red and center-aligned.</p> </body> </html>
  • 36. 4. CSS Universal Selector  The universal selector (*) selects all HTML elements on the page.  The CSS universal selector is a powerful tool that applies styles to every element on a webpage.  When you use the universal selector, it targets all elements in the document, allowing you to apply global styles with a single rule.
  • 37. <html> <head> <style> * { text-align: center; color: blue; } </style> </head> <body> <h1>Hello world!</h1> <p>Every element on the page will be affected by the style.</p> <p id="para1">Me too!</p> <p>And me!</p> </body> </html>
  • 38. 5. CSS Grouping Selector  The grouping selector selects all the HTML elements with the same style definitions.  h1 { text-align: center; color: red; } h2 { text-align: center; color: red; } p { text-align: center; color: red; }
  • 39.  It will be better to group the selectors, to minimize the code.  To group selectors, separate each selector with a comma.  h1, h2, p { text-align: center; color: red; }
  • 40. <html> <head> <style> h1, h2, p { text-align: center; color: red; } </style> </head> <body> <h1>Hello World!</h1> <h2>Smaller heading!</h2> <p>This is a paragraph.</p> </body> </html>
  • 41.  CSS box model is a container which contains multiple properties including borders, margin, padding and the content itself.  It is used to create the design and layout of web pages.  It can be used as a toolkit for customizing the layout of different elements.  Box-Model has multiple properties in CSS. Some of them are given below: The CSS Box Model
  • 42.  borders  margins  padding  Content
  • 43.  The box model allows us to add a border around elements, and to define space between elements.
  • 44.  Border Area: It is the area between the box’s padding and margin. Its dimensions are given by the width and height of border.  Margin Area: This area consists of space between border and margin. The dimensions of Margin area are the margin-box width and the margin-box height. It is useful to separate the element from its neighbors.
  • 45.  Padding Area: It includes the element’s padding. This area is actually the space around the content area and within the border box. Its dimensions are given by the width of the padding-box and the height of the padding-box.  Content Area: This area consists of content like text, image, or other media content. It is bounded by the content edge and its dimensions are given by content box width and height.
  • 46. Table Borders  To specify table borders in CSS, use the border property.  The example below specifies a black border for <table>, <th>, and <td> elements: Tables in CSS
  • 47. <html> <head> <style> table, th, td { border: 1px solid black; } </style> </head>
  • 48. <body> <h2>Add a border to a table:</h2> <table> <tr> <th>Firstname</th> <th>Lastname</th> </tr> <tr> <td>Peter</td> <td>Griffin</td> </tr>
  • 51.  Width and height of a table are defined by the width and height properties.  The example below sets the width of the table to 100%, and the height of the <th> elements to 50px: Table Width and Height
  • 52. <html> <head> <style> table, td, th { border: 1px solid black; } table { border-collapse: collapse/separate; width: 100%; } th { height: 50px; } </style>
  • 53. </head> <body> <h2>The width and height Properties</h2> <p>Set the width of the table, and the height of the table header row:</p> <table> <tr> <th>Firstname</th> <th>Lastname</th> <th>Savings</th> </tr>
  • 57.  A navigation bar needs standard HTML as a base.  In our examples we will build the navigation bar from a standard HTML list.  A navigation bar is basically a list of links, so using the <ul> and <li> elements makes perfect sense: Navigation Bar = List of Links
  • 58. <!DOCTYPE html> <html> <head> <style> ul { list-style-type: none; margin: 0; padding: 0; } </style> </head> <body> <p>In this example, we remove the bullets from the list, and its default padding and margin.</p> <ul> <li><a href="#home">Home</a></li> <li><a href="#news">News</a></li> <li><a href="#contact">Contact</a></li> <li><a href="about.html">About</a></li> </ul> </body> </html>
  • 59. <html> <head> <style> ul { list-style-type: none; margin: 0; padding: 0; width: 200px; background-color: #f1f1f1; } li a { display: block; color: #000; padding: 8px 16px; text-decoration: none; } /* Change the link color on hover */ li a:hover { background-color: #555; color: white; } </style> Vertical Navigation Bar </head> <body> <h2>Vertical Navigation Bar</h2> <ul> <li><a href="#home">Home</a></li> <li><a href="#news">News</a></li> <li><a href="#contact">Contact</a></li> <li><a href="#about">About</a></li> </ul> </body> </html>
  • 60. <!DOCTYPE html> <html> <head> <style> ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #333; } li { float: left; } li a { display: block; color: white; text-align: center; padding: 14px 16px; text-decoration: none; } li a:hover { background-color: #111; } </style> </head> Horizontal Navigation Bar <body> <ul> <li><a class="active“ href="#home">Home</a></li> <li><a href="#news">News</a></li> <li><a href="#contact">Contact</a></li> <li><a href="#about">About</a></li> </ul> </body> </html>
  • 62.  Header  A header is usually located at the top of the website (or right below a top navigation menu). It often contains a logo or the website name .header { background-color: #F1F1F1; text-align: center; padding: 20px; }
  • 63. <style> body { margin: 0; } /* Style the header */ .header { background-color: #f1f1f1; padding: 20px; text-align: center; } </style> </head> <body> <div class="header"> <h1>Header</h1> </div> </body> </html>
  • 64.  Navigation Bar  A navigation bar contains a list of links to help visitors navigating through your website: /* The navbar container */ .topnav { overflow: hidden; background-color: #333; }
  • 65. <html> <head> <title>CSS Website Layout</title> <style> * { box-sizing: border-box; } body { margin: 0; } /* Style the header */ .header { background-color: #f1f1f1; padding: 20px; text-align: center; } /* Style the top navigation bar */ .topnav { overflow: hidden; background-color: #333; } /* Style the topnav links */ .topnav a { float: left; display: block; color: #f2f2f2; text-align: center; padding: 14px 16px; text-decoration: none; } /* Change color on hover */ .topnav a:hover { background-color: #ddd; color: black; } </style> </head> <body> <div class="header"> <h1>Header</h1> </div> <div class="topnav"> <a href="#">Link</a> <a href="#">Link</a> <a href="#">Link</a> </div> </body> </html>
  • 66.  Content  The layout in this section, often depends on the target users. The most common layout is one (or combining them) of the following:  1-column (often used for mobile browsers)  2-column (often used for tablets and laptops)  3-column layout (only used for desktops) .column { float: left; width: 33.33%; }
  • 67. Footer  The footer is placed at the bottom of your page. It often contains information like copyright and contact info: Example  .footer { background-color: #F1F1F1; text-align: center; padding: 10px; }
  • 68. Margin •margin-top •margin-right •margin-bottom •margin-left  p { margin-top: 100px; margin-bottom: 100px; margin-right: 150px; margin-left: 80px; }
  • 69.  The border-style property specifies what kind of border to display.  The following values are allowed:  dotted - Defines a dotted border  dashed - Defines a dashed border  solid - Defines a solid border  double - Defines a double border  groove - Defines a 3D grooved border. The effect depends on the border-color value  ridge - Defines a 3D ridged border. The effect depends on the border-color value  inset - Defines a 3D inset border. The effect depends on the border-color value  outset - Defines a 3D outset border. The effect depends on the border-color value  none - Defines no border  hidden - Defines a hidden border  The border-style property can have from one to four values (for the top border, right border, bottom border, and the left border). CSS Borders
  • 70. <!DOCTYPE html> <html> <head> <style> div { border: 1px solid black; background-color: lightblue; padding-top: 50px; padding-right: 30px; padding-bottom: 50px; padding-left: 80px; } </style> </head> <body> <h2>Using individual padding properties</h2> <div>This div element has a top padding of 50px, a right padding of 30px, a bottom padding of 50px, and a left padding of 80px.</div> </body> </html> CSS Padding
  • 71. <!DOCTYPE html> <html> <head> <style> div { border: 1px solid black; padding: 25px 50px 75px 100px; background-color: lightblue; } </style> </head> <body> <h2>The padding shorthand property - 4 values</h2> <div>This div element has a top padding of 25px, a right padding of 50px, a bottom padding of 75px, and a left padding of 100px.</div> </body> </html> Padding short hand

Editor's Notes

  • #60: The overflow property specifies what should happen if content overflows an element's box. Hidden : The overflow is clipped, and the rest of the content will be invisible. Content can be scrolled programmatically (e.g. by setting scrollLeft or scrollTo()) The overflow property has the following values: visible - Default. The overflow is not clipped. The content renders outside the element's box hidden - The overflow is clipped, and the rest of the content will be invisible scroll - The overflow is clipped, and a scrollbar is added to see the rest of the content auto - Similar to scroll, but it adds scrollbars only when necessary