SlideShare a Scribd company logo
Swapnali Pawar 1
Swapnali R. Pawar
2
Swapnali Pawar
Lab Session 3
1. CSS-Cascading Style Sheets-
1.1. CSS Selectors
1.2. Html divs & css
2. CSS-Box Model
3. CSS Font & Size-
CSS Dimension Properties
Swapnali Pawar 3
3. CSS-Cascading Style Sheets
• CSS is the language we use to style an HTML document.
• CSS describes how HTML elements should be displayed.
Swapnali Pawar 4
3. CSS-Cascading Style Sheets
Inline
Styles
External
Styles
Internal /
Embedded
Styles
Swapnali Pawar 5
CSS-Selectors
Swapnali Pawar
A CSS selector selects the HTML elements you want
to style.
CSS Selectors
CSS selectors are used to find or select the HTML elements you want to
style.
We can divide CSS selectors into five categories:
1. Simple selectors - (select elements based on name, id, class)
2. Combinator selectors - (select elements based on a specific
relationship between them)
3. Pseudo-class selectors - (select elements based on a certain state)
4. Pseudo-elements selectors - (select and style a part of an
element)
5. Attribute selectors - (select elements based on an attribute or
attribute value)
6
Swapnali Pawar 7
1
Simple selectors
Swapnali Pawar 8
The CSS element Selector
The element selector selects HTML elements
based on the element name.
Example
Here, all <p> elements on the page will be center-
aligned, with a red text color:
p {
text-align: center;
color: red;
}
Swapnali Pawar 9
The CSS id Selector
The id selector uses the id attribute of an HTML element to
select a specific element.
The id of an element is unique within a page, so the id
selector is used to select one unique element!
To select an element with a specific id, write a hash (#)
character, followed by the id of the element.
Example
The CSS rule below will be applied to the HTML element
with id="pid1":
#pid1{
text-align: center;
color: red;
}
Note: An id name cannot start with a number !
Swapnali Pawar 10
• The class selector selects HTML elements with a specific
class attribute.
• To select elements with a specific class, write a period (.)
character, followed by the class name.
• Example
In this example all HTML elements with class="center" will
be red and center-aligned:
.center {
text-align: center;
color: red;
}
You can also specify that only specific HTML elements
should be affected by a class
The CSS class Selector
Swapnali Pawar 11
In this example only <p> elements with class="center" will be red and center-
aligned:
p.center {
text-align: center;
color: red;
}
HTML elements can also refer to more than one class.
Example
In this example the <p> element will be styled according to class="center" and to
class="large":
<p class="center large">This paragraph refers to two classes.</p>
Class selector Examples
Swapnali Pawar 12
CSS Universal Selector
• The universal selector (*) selects all HTML
elements on the page.
• Example
The CSS rule below will affect every HTML
element on the page:
* {
text-align: center;
color: blue;
}
Swapnali Pawar 13
The CSS Grouping Selector
The grouping selector selects all the HTML elements with the same style
definitions.
Look at the following CSS code (the h1, h2, and p elements have the same
style definitions):
h1 {
text-align: center;
color: red;
}
h2 {
text-align: center;
color: red;
}
p {
text-align: center;
color: red;
}
Swapnali Pawar 14
Selector Example Example description
#id #firstname Selects the element with
id="firstname"
.class .intro Selects all elements with
class="intro"
element.class p.intro Selects only <p> elements with
class="intro"
* * Selects all elements
element p Selects all <p> elements
element,element,.. div, p Selects all <div> elements and all
<p> elements
All CSS Simple Selectors
Swapnali Pawar 15
What is Favicon ?
Favicons are the small image icons that appear next to
a website's title in the tab of a browser window. ... Because
you can also use them as desktop app icons, you need at least
a few different sizes that can be included in a favicon
ICO file type.
A favicon short for favorite icon, also known as a shortcut
icon, website icon, tab icon, URL icon, or bookmark icon, is a file
containing one or more small icons,associated with a particular website
or web page.A web designer can create such an icon and upload it to a
website (or web page) by several means, and graphical web browsers will
then make use of it.Browsers that provide favicon support typically display
a page's favicon in the browser's address bar (sometimes in the history as
well) and next to the page's name in a list of bookmarks.Browsers that
support a tabbed document interface typically show a page's favicon next
to the page's title on the tab, and site-specific browsers use the favicon as
a desktop icon
Swapnali Pawar 16
What is Favicon ?
Swapnali Pawar 17
To create Your Own Favicon Visit- www.favicon.cc
Favicon Example
Swapnali Pawar 18
<head>
<link rel=“icon” href=“favicon.ico”>
</head>
Adding Favicon to Webpage
Swapnali Pawar 19
Div
{
background-color:red;
}
Body
{
margin:0;
}
H1
{
Margin-top:0;
}
<body>
<div>
<h1>Hi I am Swapnali </h1>
<p>Welcome to WPS Lab 3 </p>
</div>
</body>
HTML DIVS & CSS
Swapnali Pawar 20
• In CSS, the term "box model" is used
when talking about design and layout.
• The CSS box model is essentially a box
that wraps around every HTML element.
• It consists of: margins, borders, padding,
and the actual content. The image below
illustrates the box model:
CSS BOX MODEL
Swapnali Pawar 21
CSS BOX MODEL
• Content - The content of the box, where text and images appear
• Padding - Clears an area around the content. The padding is transparent
• Border - A border that goes around the padding and content
• Margin - Clears an area outside the border. The margin is transparent
Swapnali Pawar 22
Here is the calculation:
320px (width)
+ 20px (left + right padding)
+ 10px (left + right border)
+ 0px (left + right margin)
= 350px
The total width of an element should be calculated like this:
Total element width = width + left padding + right padding + left border +
right border + left margin + right margin
The total height of an element should be calculated like this:
Total element height = height + top padding + bottom padding + top border +
bottom border + top margin + bottom margin
This <div> element will have a total width of 350px:
div {
width: 320px;
padding: 10px;
border: 5px solid gray;
margin: 0;
}
Example
BoxModel
Swapnali Pawar 23
CSS Font Families
Serif fonts have a small stroke at the edges of each letter. They create a
sense of formality and elegance.
Sans-serif fonts have clean lines (no small strokes attached). They
create a modern and minimalistic look.
Monospace fonts - here all the letters have the same fixed width. They
create a mechanical look.
Cursive fonts imitate human handwriting.
Fantasy fonts are decorative/playful fonts.
Swapnali Pawar 24
CSS Fonts Example
Specify some different fonts for three paragraphs:
.p1
{
font-family: "Times New Roman", Times,
serif;
}
.p2
{
font-family: Arial, Helvetica, sans-serif;
}
.p3
{
font-family: "Lucida Console", "Courier
New", monospace;
}
Swapnali Pawar 25
Property Description
height Sets the height of an element
max-height Sets the maximum height of an element
max-width Sets the maximum width of an element
min-height Sets the minimum height of an element
min-width Sets the minimum width of an element
width Sets the width of an element
CSS Dimension Properties
Swapnali Pawar 26
div
{
height: 200px;
width: 50%;
background-color: powderblue;
}
Example
This <div> element has a height of 100 pixels and a max-width of 500 pixels:
div {
max-width: 500px;
height: 100px;
background-color: powderblue;
}
CSS height and width
The CSS height and width properties are used to set the height
and width of an element.
The CSS max-width property is used to set the maximum width of
an element.
Swapnali Pawar 27
<html>
<head>
<title>Swapnali-101</title>
</head>
<body style="background-color:#F9F9F9;">
<center>
<h1 style="color:#54436B;background-color:F6C6EA">Government College Of Engineering Karad</h1>
<h2 style="color:red; background-color:#CDF0EA;">Web Programming And Scripting Experiments</h2>
<hr>
<h3>Roll Number :101</h3>
<h3>Student Name: Swapnali Pawar</h3>
<hr>
<table border=1>
<thead>
<th>Experiment No</th>
<th>Experiment Name</th>
<th>Experiment Link</th>
</thead>
<tr>
<td>1</td>
<td>Create Your Personal Site</td>
<td><a href="dataExperiment1.html">MySite1</a></td>
</tr>
<tr>
<td>2</td>
<td>Create Site Using Button Link Map</td>
<td><a href="dataExperiment2.html">MySite2</a></td>
</tr>
</table>
</center>
</body>
</html>
Host Experiments on Live Hosting Site
Swapnali Pawar 28
Student Activity
Swapnali Pawar 29
Student Activity
Experiment 3-
To create Web Page Using table & Multimedia Tags
Experiment 4-
To create Webpage using css
Swapnali Pawar 30
Ad

More Related Content

What's hot (20)

Microsoft Power Point
Microsoft Power PointMicrosoft Power Point
Microsoft Power Point
Owly Eyes
 
Database Management System Part-1.pptx
Database Management System Part-1.pptxDatabase Management System Part-1.pptx
Database Management System Part-1.pptx
ArshveerSinghDhillon
 
Introduction to Photoshop
Introduction to PhotoshopIntroduction to Photoshop
Introduction to Photoshop
Rhosebe Gaudia
 
CS106 Lab 6 - While and Do..While loop
CS106 Lab 6 - While and Do..While loopCS106 Lab 6 - While and Do..While loop
CS106 Lab 6 - While and Do..While loop
Nada Kamel
 
Introduction to Scratch Programming
Introduction to Scratch ProgrammingIntroduction to Scratch Programming
Introduction to Scratch Programming
StorytimeSteph
 
Responsive Webdesign
Responsive WebdesignResponsive Webdesign
Responsive Webdesign
avenit AG
 
Microsoft power point 2010 publish
Microsoft power point 2010 publishMicrosoft power point 2010 publish
Microsoft power point 2010 publish
Razif Rahman
 
Learning Power Point
Learning Power PointLearning Power Point
Learning Power Point
rmorriss
 
Html list
Html listHtml list
Html list
sayed fathey
 
Snake Game Report
Snake Game ReportSnake Game Report
Snake Game Report
Abhishek Jaisingh
 
Working with tables
Working with tablesWorking with tables
Working with tables
Wan Nurhidayati Wan Johari
 
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
Eliran Eliassy
 
Graphics & Animation with HTML5
Graphics & Animation with HTML5Graphics & Animation with HTML5
Graphics & Animation with HTML5
Knoldus Inc.
 
XML - Parte 2
XML - Parte 2XML - Parte 2
XML - Parte 2
Aldo de Queiroz Jr
 
Adobe Photoshop Basics - Session 1
Adobe Photoshop Basics - Session 1Adobe Photoshop Basics - Session 1
Adobe Photoshop Basics - Session 1
xneptune
 
Java Script
Java ScriptJava Script
Java Script
husbancom
 
Css borders
Css bordersCss borders
Css borders
AbhishekMondal42
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
Larry King
 
Basic-CSS-tutorial
Basic-CSS-tutorialBasic-CSS-tutorial
Basic-CSS-tutorial
tutorialsruby
 
Corel draw 12 notes
Corel draw 12 notesCorel draw 12 notes
Corel draw 12 notes
SirajRock
 
Microsoft Power Point
Microsoft Power PointMicrosoft Power Point
Microsoft Power Point
Owly Eyes
 
Database Management System Part-1.pptx
Database Management System Part-1.pptxDatabase Management System Part-1.pptx
Database Management System Part-1.pptx
ArshveerSinghDhillon
 
Introduction to Photoshop
Introduction to PhotoshopIntroduction to Photoshop
Introduction to Photoshop
Rhosebe Gaudia
 
CS106 Lab 6 - While and Do..While loop
CS106 Lab 6 - While and Do..While loopCS106 Lab 6 - While and Do..While loop
CS106 Lab 6 - While and Do..While loop
Nada Kamel
 
Introduction to Scratch Programming
Introduction to Scratch ProgrammingIntroduction to Scratch Programming
Introduction to Scratch Programming
StorytimeSteph
 
Responsive Webdesign
Responsive WebdesignResponsive Webdesign
Responsive Webdesign
avenit AG
 
Microsoft power point 2010 publish
Microsoft power point 2010 publishMicrosoft power point 2010 publish
Microsoft power point 2010 publish
Razif Rahman
 
Learning Power Point
Learning Power PointLearning Power Point
Learning Power Point
rmorriss
 
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
Eliran Eliassy
 
Graphics & Animation with HTML5
Graphics & Animation with HTML5Graphics & Animation with HTML5
Graphics & Animation with HTML5
Knoldus Inc.
 
Adobe Photoshop Basics - Session 1
Adobe Photoshop Basics - Session 1Adobe Photoshop Basics - Session 1
Adobe Photoshop Basics - Session 1
xneptune
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
Larry King
 
Corel draw 12 notes
Corel draw 12 notesCorel draw 12 notes
Corel draw 12 notes
SirajRock
 

Similar to Web Programming& Scripting Lab (20)

Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...
JebaRaj26
 
Css
CssCss
Css
Doeun KOCH
 
WT CSS
WT  CSSWT  CSS
WT CSS
Mohan186867
 
Casecading Style Sheets for Hyper Text Transfer Protocol.pptx
Casecading Style Sheets for Hyper Text Transfer Protocol.pptxCasecading Style Sheets for Hyper Text Transfer Protocol.pptx
Casecading Style Sheets for Hyper Text Transfer Protocol.pptx
usmanahmadawan
 
Cascading style sheets - CSS
Cascading style sheets - CSSCascading style sheets - CSS
Cascading style sheets - CSS
iFour Institute - Sustainable Learning
 
CSS for basic learner
CSS for basic learnerCSS for basic learner
CSS for basic learner
Yoeung Vibol
 
Css
CssCss
Css
Er. Nawaraj Bhandari
 
Web 102 INtro to CSS
Web 102  INtro to CSSWeb 102  INtro to CSS
Web 102 INtro to CSS
Hawkman Academy
 
CSS Overview
CSS OverviewCSS Overview
CSS Overview
Doncho Minkov
 
Basic css
Basic cssBasic css
Basic css
Gopinath Ambothi
 
css v1 guru
css v1 gurucss v1 guru
css v1 guru
GuruPada Das
 
Web Engineering - Introduction to CSS
Web Engineering - Introduction to CSSWeb Engineering - Introduction to CSS
Web Engineering - Introduction to CSS
Nosheen Qamar
 
CSS Foundations, pt 2
CSS Foundations, pt 2CSS Foundations, pt 2
CSS Foundations, pt 2
Shawn Calvert
 
Lecture2
Lecture2Lecture2
Lecture2
Lee Lundrigan
 
Web topic 15 1 basic css layout
Web topic 15 1  basic css layoutWeb topic 15 1  basic css layout
Web topic 15 1 basic css layout
CK Yang
 
Understanding CSS for web development by software outsourcing company india
Understanding CSS for web development by software outsourcing company indiaUnderstanding CSS for web development by software outsourcing company india
Understanding CSS for web development by software outsourcing company india
Jignesh Aakoliya
 
Cascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshCascading Style Sheets By Mukesh
Cascading Style Sheets By Mukesh
Mukesh Kumar
 
CSS
CSSCSS
CSS
Akila Iroshan
 
Web Development - Lecture 5
Web Development - Lecture 5Web Development - Lecture 5
Web Development - Lecture 5
Syed Shahzaib Sohail
 
CSS Cascade Style Sheet
CSS Cascade Style SheetCSS Cascade Style Sheet
CSS Cascade Style Sheet
Adeel Rasheed
 
Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...
JebaRaj26
 
Casecading Style Sheets for Hyper Text Transfer Protocol.pptx
Casecading Style Sheets for Hyper Text Transfer Protocol.pptxCasecading Style Sheets for Hyper Text Transfer Protocol.pptx
Casecading Style Sheets for Hyper Text Transfer Protocol.pptx
usmanahmadawan
 
CSS for basic learner
CSS for basic learnerCSS for basic learner
CSS for basic learner
Yoeung Vibol
 
Web Engineering - Introduction to CSS
Web Engineering - Introduction to CSSWeb Engineering - Introduction to CSS
Web Engineering - Introduction to CSS
Nosheen Qamar
 
CSS Foundations, pt 2
CSS Foundations, pt 2CSS Foundations, pt 2
CSS Foundations, pt 2
Shawn Calvert
 
Web topic 15 1 basic css layout
Web topic 15 1  basic css layoutWeb topic 15 1  basic css layout
Web topic 15 1 basic css layout
CK Yang
 
Understanding CSS for web development by software outsourcing company india
Understanding CSS for web development by software outsourcing company indiaUnderstanding CSS for web development by software outsourcing company india
Understanding CSS for web development by software outsourcing company india
Jignesh Aakoliya
 
Cascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshCascading Style Sheets By Mukesh
Cascading Style Sheets By Mukesh
Mukesh Kumar
 
CSS Cascade Style Sheet
CSS Cascade Style SheetCSS Cascade Style Sheet
CSS Cascade Style Sheet
Adeel Rasheed
 
Ad

More from Swapnali Pawar (19)

Unit 3 introduction to android
Unit 3 introduction to android Unit 3 introduction to android
Unit 3 introduction to android
Swapnali Pawar
 
Unit 1-Introduction to Mobile Computing
Unit 1-Introduction to Mobile ComputingUnit 1-Introduction to Mobile Computing
Unit 1-Introduction to Mobile Computing
Swapnali Pawar
 
Unit 2.design mobile computing architecture
Unit 2.design mobile computing architectureUnit 2.design mobile computing architecture
Unit 2.design mobile computing architecture
Swapnali Pawar
 
Introduction to ios
Introduction to iosIntroduction to ios
Introduction to ios
Swapnali Pawar
 
Fresher interview tips demo
Fresher interview tips demoFresher interview tips demo
Fresher interview tips demo
Swapnali Pawar
 
View & index in SQL
View & index in SQLView & index in SQL
View & index in SQL
Swapnali Pawar
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
Swapnali Pawar
 
Android Introduction
Android IntroductionAndroid Introduction
Android Introduction
Swapnali Pawar
 
SQL JOINS
SQL JOINSSQL JOINS
SQL JOINS
Swapnali Pawar
 
Unit 2.design computing architecture 2.1
Unit 2.design computing architecture 2.1Unit 2.design computing architecture 2.1
Unit 2.design computing architecture 2.1
Swapnali Pawar
 
Unit 2 Design mobile computing architecture MC1514
Unit 2 Design mobile computing architecture MC1514Unit 2 Design mobile computing architecture MC1514
Unit 2 Design mobile computing architecture MC1514
Swapnali Pawar
 
Design computing architecture ~ Mobile Technologies
Design computing architecture ~ Mobile TechnologiesDesign computing architecture ~ Mobile Technologies
Design computing architecture ~ Mobile Technologies
Swapnali Pawar
 
Exception Handling
Exception Handling Exception Handling
Exception Handling
Swapnali Pawar
 
Mobile technology-Unit 1
Mobile technology-Unit 1Mobile technology-Unit 1
Mobile technology-Unit 1
Swapnali Pawar
 
Mobile Technology 3
Mobile Technology 3Mobile Technology 3
Mobile Technology 3
Swapnali Pawar
 
Mobile Technology
Mobile TechnologyMobile Technology
Mobile Technology
Swapnali Pawar
 
Mobile Technology
Mobile TechnologyMobile Technology
Mobile Technology
Swapnali Pawar
 
Database Management System 1
Database Management System 1Database Management System 1
Database Management System 1
Swapnali Pawar
 
web programming & scripting
web programming & scriptingweb programming & scripting
web programming & scripting
Swapnali Pawar
 
Unit 3 introduction to android
Unit 3 introduction to android Unit 3 introduction to android
Unit 3 introduction to android
Swapnali Pawar
 
Unit 1-Introduction to Mobile Computing
Unit 1-Introduction to Mobile ComputingUnit 1-Introduction to Mobile Computing
Unit 1-Introduction to Mobile Computing
Swapnali Pawar
 
Unit 2.design mobile computing architecture
Unit 2.design mobile computing architectureUnit 2.design mobile computing architecture
Unit 2.design mobile computing architecture
Swapnali Pawar
 
Fresher interview tips demo
Fresher interview tips demoFresher interview tips demo
Fresher interview tips demo
Swapnali Pawar
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
Swapnali Pawar
 
Unit 2.design computing architecture 2.1
Unit 2.design computing architecture 2.1Unit 2.design computing architecture 2.1
Unit 2.design computing architecture 2.1
Swapnali Pawar
 
Unit 2 Design mobile computing architecture MC1514
Unit 2 Design mobile computing architecture MC1514Unit 2 Design mobile computing architecture MC1514
Unit 2 Design mobile computing architecture MC1514
Swapnali Pawar
 
Design computing architecture ~ Mobile Technologies
Design computing architecture ~ Mobile TechnologiesDesign computing architecture ~ Mobile Technologies
Design computing architecture ~ Mobile Technologies
Swapnali Pawar
 
Mobile technology-Unit 1
Mobile technology-Unit 1Mobile technology-Unit 1
Mobile technology-Unit 1
Swapnali Pawar
 
Database Management System 1
Database Management System 1Database Management System 1
Database Management System 1
Swapnali Pawar
 
web programming & scripting
web programming & scriptingweb programming & scripting
web programming & scripting
Swapnali Pawar
 
Ad

Recently uploaded (20)

2025 The Senior Landscape and SET plan preparations.pptx
2025 The Senior Landscape and SET plan preparations.pptx2025 The Senior Landscape and SET plan preparations.pptx
2025 The Senior Landscape and SET plan preparations.pptx
mansk2
 
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptxU3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
Mayuri Chavan
 
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
Celine George
 
CNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscessCNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscess
Mohamed Rizk Khodair
 
Cultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptxCultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptx
UmeshTimilsina1
 
How to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo SlidesHow to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo Slides
Celine George
 
How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18
Celine George
 
What is the Philosophy of Statistics? (and how I was drawn to it)
What is the Philosophy of Statistics? (and how I was drawn to it)What is the Philosophy of Statistics? (and how I was drawn to it)
What is the Philosophy of Statistics? (and how I was drawn to it)
jemille6
 
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
Dr. Nasir Mustafa
 
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Association for Project Management
 
Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...
parmarjuli1412
 
Drugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdfDrugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdf
crewot855
 
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptxANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
Mayuri Chavan
 
Form View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo SlidesForm View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo Slides
Celine George
 
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon DolabaniHistory Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
fruinkamel7m
 
Ajanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of HistoryAjanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of History
Virag Sontakke
 
The role of wall art in interior designing
The role of wall art in interior designingThe role of wall art in interior designing
The role of wall art in interior designing
meghaark2110
 
UPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guideUPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guide
abmerca
 
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Leonel Morgado
 
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales moduleHow To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
Celine George
 
2025 The Senior Landscape and SET plan preparations.pptx
2025 The Senior Landscape and SET plan preparations.pptx2025 The Senior Landscape and SET plan preparations.pptx
2025 The Senior Landscape and SET plan preparations.pptx
mansk2
 
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptxU3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
Mayuri Chavan
 
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
Celine George
 
CNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscessCNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscess
Mohamed Rizk Khodair
 
Cultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptxCultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptx
UmeshTimilsina1
 
How to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo SlidesHow to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo Slides
Celine George
 
How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18
Celine George
 
What is the Philosophy of Statistics? (and how I was drawn to it)
What is the Philosophy of Statistics? (and how I was drawn to it)What is the Philosophy of Statistics? (and how I was drawn to it)
What is the Philosophy of Statistics? (and how I was drawn to it)
jemille6
 
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
Dr. Nasir Mustafa
 
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Association for Project Management
 
Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...
parmarjuli1412
 
Drugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdfDrugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdf
crewot855
 
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptxANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
Mayuri Chavan
 
Form View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo SlidesForm View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo Slides
Celine George
 
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon DolabaniHistory Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
fruinkamel7m
 
Ajanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of HistoryAjanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of History
Virag Sontakke
 
The role of wall art in interior designing
The role of wall art in interior designingThe role of wall art in interior designing
The role of wall art in interior designing
meghaark2110
 
UPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guideUPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guide
abmerca
 
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Leonel Morgado
 
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales moduleHow To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
Celine George
 

Web Programming& Scripting Lab

  • 3. Lab Session 3 1. CSS-Cascading Style Sheets- 1.1. CSS Selectors 1.2. Html divs & css 2. CSS-Box Model 3. CSS Font & Size- CSS Dimension Properties Swapnali Pawar 3
  • 4. 3. CSS-Cascading Style Sheets • CSS is the language we use to style an HTML document. • CSS describes how HTML elements should be displayed. Swapnali Pawar 4
  • 5. 3. CSS-Cascading Style Sheets Inline Styles External Styles Internal / Embedded Styles Swapnali Pawar 5
  • 6. CSS-Selectors Swapnali Pawar A CSS selector selects the HTML elements you want to style. CSS Selectors CSS selectors are used to find or select the HTML elements you want to style. We can divide CSS selectors into five categories: 1. Simple selectors - (select elements based on name, id, class) 2. Combinator selectors - (select elements based on a specific relationship between them) 3. Pseudo-class selectors - (select elements based on a certain state) 4. Pseudo-elements selectors - (select and style a part of an element) 5. Attribute selectors - (select elements based on an attribute or attribute value) 6
  • 8. Swapnali Pawar 8 The CSS element Selector The element selector selects HTML elements based on the element name. Example Here, all <p> elements on the page will be center- aligned, with a red text color: p { text-align: center; color: red; }
  • 9. Swapnali Pawar 9 The CSS id Selector The id selector uses the id attribute of an HTML element to select a specific element. The id of an element is unique within a page, so the id selector is used to select one unique element! To select an element with a specific id, write a hash (#) character, followed by the id of the element. Example The CSS rule below will be applied to the HTML element with id="pid1": #pid1{ text-align: center; color: red; } Note: An id name cannot start with a number !
  • 10. Swapnali Pawar 10 • The class selector selects HTML elements with a specific class attribute. • To select elements with a specific class, write a period (.) character, followed by the class name. • Example In this example all HTML elements with class="center" will be red and center-aligned: .center { text-align: center; color: red; } You can also specify that only specific HTML elements should be affected by a class The CSS class Selector
  • 11. Swapnali Pawar 11 In this example only <p> elements with class="center" will be red and center- aligned: p.center { text-align: center; color: red; } HTML elements can also refer to more than one class. Example In this example the <p> element will be styled according to class="center" and to class="large": <p class="center large">This paragraph refers to two classes.</p> Class selector Examples
  • 12. Swapnali Pawar 12 CSS Universal Selector • The universal selector (*) selects all HTML elements on the page. • Example The CSS rule below will affect every HTML element on the page: * { text-align: center; color: blue; }
  • 13. Swapnali Pawar 13 The CSS Grouping Selector The grouping selector selects all the HTML elements with the same style definitions. Look at the following CSS code (the h1, h2, and p elements have the same style definitions): h1 { text-align: center; color: red; } h2 { text-align: center; color: red; } p { text-align: center; color: red; }
  • 14. Swapnali Pawar 14 Selector Example Example description #id #firstname Selects the element with id="firstname" .class .intro Selects all elements with class="intro" element.class p.intro Selects only <p> elements with class="intro" * * Selects all elements element p Selects all <p> elements element,element,.. div, p Selects all <div> elements and all <p> elements All CSS Simple Selectors
  • 15. Swapnali Pawar 15 What is Favicon ? Favicons are the small image icons that appear next to a website's title in the tab of a browser window. ... Because you can also use them as desktop app icons, you need at least a few different sizes that can be included in a favicon ICO file type. A favicon short for favorite icon, also known as a shortcut icon, website icon, tab icon, URL icon, or bookmark icon, is a file containing one or more small icons,associated with a particular website or web page.A web designer can create such an icon and upload it to a website (or web page) by several means, and graphical web browsers will then make use of it.Browsers that provide favicon support typically display a page's favicon in the browser's address bar (sometimes in the history as well) and next to the page's name in a list of bookmarks.Browsers that support a tabbed document interface typically show a page's favicon next to the page's title on the tab, and site-specific browsers use the favicon as a desktop icon
  • 16. Swapnali Pawar 16 What is Favicon ?
  • 17. Swapnali Pawar 17 To create Your Own Favicon Visit- www.favicon.cc Favicon Example
  • 18. Swapnali Pawar 18 <head> <link rel=“icon” href=“favicon.ico”> </head> Adding Favicon to Webpage
  • 19. Swapnali Pawar 19 Div { background-color:red; } Body { margin:0; } H1 { Margin-top:0; } <body> <div> <h1>Hi I am Swapnali </h1> <p>Welcome to WPS Lab 3 </p> </div> </body> HTML DIVS & CSS
  • 20. Swapnali Pawar 20 • In CSS, the term "box model" is used when talking about design and layout. • The CSS box model is essentially a box that wraps around every HTML element. • It consists of: margins, borders, padding, and the actual content. The image below illustrates the box model: CSS BOX MODEL
  • 21. Swapnali Pawar 21 CSS BOX MODEL • Content - The content of the box, where text and images appear • Padding - Clears an area around the content. The padding is transparent • Border - A border that goes around the padding and content • Margin - Clears an area outside the border. The margin is transparent
  • 22. Swapnali Pawar 22 Here is the calculation: 320px (width) + 20px (left + right padding) + 10px (left + right border) + 0px (left + right margin) = 350px The total width of an element should be calculated like this: Total element width = width + left padding + right padding + left border + right border + left margin + right margin The total height of an element should be calculated like this: Total element height = height + top padding + bottom padding + top border + bottom border + top margin + bottom margin This <div> element will have a total width of 350px: div { width: 320px; padding: 10px; border: 5px solid gray; margin: 0; } Example BoxModel
  • 23. Swapnali Pawar 23 CSS Font Families Serif fonts have a small stroke at the edges of each letter. They create a sense of formality and elegance. Sans-serif fonts have clean lines (no small strokes attached). They create a modern and minimalistic look. Monospace fonts - here all the letters have the same fixed width. They create a mechanical look. Cursive fonts imitate human handwriting. Fantasy fonts are decorative/playful fonts.
  • 24. Swapnali Pawar 24 CSS Fonts Example Specify some different fonts for three paragraphs: .p1 { font-family: "Times New Roman", Times, serif; } .p2 { font-family: Arial, Helvetica, sans-serif; } .p3 { font-family: "Lucida Console", "Courier New", monospace; }
  • 25. Swapnali Pawar 25 Property Description height Sets the height of an element max-height Sets the maximum height of an element max-width Sets the maximum width of an element min-height Sets the minimum height of an element min-width Sets the minimum width of an element width Sets the width of an element CSS Dimension Properties
  • 26. Swapnali Pawar 26 div { height: 200px; width: 50%; background-color: powderblue; } Example This <div> element has a height of 100 pixels and a max-width of 500 pixels: div { max-width: 500px; height: 100px; background-color: powderblue; } CSS height and width The CSS height and width properties are used to set the height and width of an element. The CSS max-width property is used to set the maximum width of an element.
  • 27. Swapnali Pawar 27 <html> <head> <title>Swapnali-101</title> </head> <body style="background-color:#F9F9F9;"> <center> <h1 style="color:#54436B;background-color:F6C6EA">Government College Of Engineering Karad</h1> <h2 style="color:red; background-color:#CDF0EA;">Web Programming And Scripting Experiments</h2> <hr> <h3>Roll Number :101</h3> <h3>Student Name: Swapnali Pawar</h3> <hr> <table border=1> <thead> <th>Experiment No</th> <th>Experiment Name</th> <th>Experiment Link</th> </thead> <tr> <td>1</td> <td>Create Your Personal Site</td> <td><a href="dataExperiment1.html">MySite1</a></td> </tr> <tr> <td>2</td> <td>Create Site Using Button Link Map</td> <td><a href="dataExperiment2.html">MySite2</a></td> </tr> </table> </center> </body> </html> Host Experiments on Live Hosting Site
  • 29. Swapnali Pawar 29 Student Activity Experiment 3- To create Web Page Using table & Multimedia Tags Experiment 4- To create Webpage using css
  翻译: