SlideShare ist ein Scribd-Unternehmen logo
1 von 30
1
Web Engineering
Lecture 06
Basic CSS Properties
University of Lahore
Nosheen Qamar
CSS background Properties
• You can set background of various HTML
elements:
 The background-color property is used to set the
background color of an element.
 The background-image property is used to set the
background image of an element.
 The background-repeat property is used to
control the repetition of an image in the
background.
 The background-position property is used to
control the position of an image in the background.
 The background-attachment property is used to
control the scrolling of an image in the background.
3
background-color
• <p style=“background-color: yellow;” >
This text has a yellow background. </p>
• Output:
• Possible values:
any color in a valid format.
4
background-image
• <table style=“background-image:url(images/css.gif);” >
<tr><td>
this table has background image which repeats
multiple times.
</td></tr>
</table>
• Output:
• Possible values:
any image with valid format
5
background-repeat
• <table style=“background-image: url(images/cat.gif);
background-repeat: no-repeat; ” >
<tr><td>
by default background-repeat property have repeat
value.
</td></tr>
</table>
• Output:
• Possible values:
repeat, repeat-y, repeat-x, no-repeat
6
background-size
• <table style=“background-image: url(images/cat.gif);
background-repeat: no-repeat;
background-size: 200px 200px; ” >
<tr><td>
background-size property is used to expand the
background image.
</td></tr>
</table>
• Output:
• Possible values:
repeat, repeat-y, repeat-x, no-repeat
7
background-position
• <table style=“background-image: url(images/css.gif);
background-position: 100px 200px; ” >
<tr><td>
this table has background image positioned 100 pixels
away from the left and 200 pixels from the top.
</td></tr>
</table>
• Output:
• Possible values:
X% Y%, top left, Xpx Ypx
left
top
center
top
left
bottom
center
bottom
right
bottom
8
background-attachment
• <p style=“background-image:url(images/css.gif);
background-attachment: fixed; ” >
This paragraph has fixed background image.
</p>
• Output:
• Possible values:
fixed, scroll
CSS Borders
• You can set following border properties of
an element:
 The border-color property is used to set the
color of the border.
 The border-style property is used to set the
style of border.
 The border-width property is used to set .
 The border property is used to set the width,
style and color of the border in one declaration.
border-style
• <p style=“border-style: none”>
This is a border with none width.</p>
<p style=“border-style: solid”>
This is a solid border.</p>
<p style=“border-style: dashed”>
This is a dashed border.</p>
• Output:
• Possible values:
none, solid, dashed, double, groove, ridge, inset, outset
border-color
• <style>
p.example1 {
border-style: solid;
border-bottom-color: #009900;
border-top-color: #FF0000;
border-left-color: #330000;
border-right-color: #0000CC;
}
</style>
<p class=“example1”>
This example is showing all borders in different colors.
</p>
• Output:
• Possible values:
any color with valid format
border-color
• <style>
p.example1 {
border-style: solid;
border-color: #FF0000;
}
</style>
<p class=“example1”>
This example is showing all borders in same color.
</p>
• Output:
• Possible values:
any color with valid format
border-width
• <p style=“border-width: 4px; border-style:
solid;”>
This is a solid border whose width is
4px.</p>
• Output:
• Possible values:
length in px, pt or cm or it should be thin,
medium or thick.
• You can individually change the width of
the bottom, top, left and right borders of an
element. Using the following properties:
 border-bottom-width changes the width of
bottom border.
 border-top-width changes the width of top
border.
 border-left-width changes the width of left
border.
 border-right-width changes the width of right
border.
14
border-width
• <style>
p.example1 {
border-style: solid;
border-bottom-width: 6pt;
border-top-width: 6pt;
border-left-width: 4pt;
border-right-width: 4pt;
}
</style>
<p class=“example1”>
This example is showing all borders in different widths.
</p>
• Output:
• Possible values:
any color with valid format
This example is showing all borders in different widths.
border
• <p style=“border: 4px solid red;”>
This example is showing shorthand
property for border.</p>
• Output:
CSS Margins
• You can set following margin properties of
an element:
 The margin-bottom property specify the
bottom margin of an element.
 The margin-top property specify the top
margin of an element.
 The margin-left property specify the left margin
of an element.
 The margin-right property specify the right
margin of an element.
 The margin shorthand property for setting
margin properties in one declaration.
margin
• <div style=“margin: 20px;”>
This is a paragraph with a specified margin
from all sides.</div>
• Output:
• Possible values:
auto, length in px, %.
margin-top
• <div style=“margin-top: 10px;”>
This is a paragraph with a specified top
margin.</div>
• Output:
• Possible values:
auto, length in px, %.
margin-bottom
• <div style=“margin-bottom: 10px;”>
This is a paragraph with a specified bottom
margin.</div>
• Output:
• Possible values:
auto, length in px, %.
margin-left
• <div style=“margin-left: 10%;”>
This is a paragraph with a specified left
margin.</div>
• Output:
• Possible values:
auto, length in px, %.
margin-right
• <div style=“margin-right: 10%;”>
This is a paragraph with a specified right
margin.</div>
• Output:
• Possible values:
auto, length in px, %.
23
Margin property
• <style>
p {margin: 15px; }
all four margins will be 15px
p {margin: 10px 5px; }
top and bottom margin will be 10px, left and right
will be 2% of the total width of doc.
p {margin: 10px 8px 20px 15px; }
top margin will be 10px, right margin will be 2%,
bottom
margin will be -10px, left margin will be set by the
browser
</style>
CSS Padding
• Padding property allows you to specify how
much space should appear between the
content of an element and its border :
 The padding-bottom property specify the bottom
padding of an element.
 The padding-top property specify the top padding
of an element.
 The padding-left property specify the left padding
of an element.
 The padding-right property specify the right
padding of an element.
 The padding shorthand property serves as the
preceding properties.
padding-bottom
• <p style=“padding-bottom: 15px; border-
width: 1px solid black;”>
This is a paragraph with a specified bottom
padding.</p>
• Output:
This is a paragraph with a specified bottom
padding.
• Possible values:
length in px, %.
padding-top
• <p style=“padding-top: 15px; border-width:
1px solid black;”>
This is a paragraph with a specified top
padding.</p>
• Output:
This is a paragraph with a specified top
padding.
• Possible values:
length in px, %.
padding-left
• <p style=“padding-left: 15px; border-width: 1px
solid black;”>
This is a paragraph with a specified left
padding.</p>
• Output:
This is a paragraph with a specified top
padding.
• Possible values:
length in px, %.
padding-right
• <p style=“padding-right: 15px; border-width:
1px solid black;”>
This is a paragraph with a specified right
padding.</p>
• Output:
This is a paragraph with a specified top
padding.
• Possible values:
length in px, %.
padding
• <p style=“padding: 15px; border-width: 1px
solid black;”>
This is a paragraph with a specified right
padding.</p>
• Output:
This is a paragraph with a specified
top padding.
• Possible values:
length in px, %.
Padding and Margin Properties
• Values for both the padding and the margin
properties can be expressed using:
• em (em values)
• px (pixels)
• mm (millimeters)
• cm (centimeters)
• in (inches)
• % (percentage of the container element)

Weitere ähnliche Inhalte

Was ist angesagt?

Cascading Style Sheets - CSS
Cascading Style Sheets - CSSCascading Style Sheets - CSS
Cascading Style Sheets - CSSSun Technlogies
 
Web Design Course: CSS lecture 5
Web Design Course: CSS  lecture 5Web Design Course: CSS  lecture 5
Web Design Course: CSS lecture 5Gheyath M. Othman
 
Css Complete Notes
Css Complete NotesCss Complete Notes
Css Complete NotesEPAM Systems
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSSLarry King
 
Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)Reshmi Rajan
 
Css3 Complete Reference
Css3 Complete ReferenceCss3 Complete Reference
Css3 Complete ReferenceEPAM Systems
 
Cascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshCascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshMukesh Kumar
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksAmit Tyagi
 
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 indiaJignesh Aakoliya
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet pptabhilashagupta
 
Make Css easy : easy tips for css
Make Css easy : easy tips for cssMake Css easy : easy tips for css
Make Css easy : easy tips for cssshabab shihan
 
Pemrograman Web 3 - CSS Basic Part 2
Pemrograman Web 3 - CSS Basic Part 2Pemrograman Web 3 - CSS Basic Part 2
Pemrograman Web 3 - CSS Basic Part 2Nur Fadli Utomo
 

Was ist angesagt? (20)

Kick start @ css
Kick start @ cssKick start @ css
Kick start @ css
 
Cascading Style Sheets - CSS
Cascading Style Sheets - CSSCascading Style Sheets - CSS
Cascading Style Sheets - CSS
 
Cascading style sheets - CSS
Cascading style sheets - CSSCascading style sheets - CSS
Cascading style sheets - CSS
 
Web Design Course: CSS lecture 5
Web Design Course: CSS  lecture 5Web Design Course: CSS  lecture 5
Web Design Course: CSS lecture 5
 
Css Complete Notes
Css Complete NotesCss Complete Notes
Css Complete Notes
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)
 
Css3 Complete Reference
Css3 Complete ReferenceCss3 Complete Reference
Css3 Complete Reference
 
Cascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshCascading Style Sheets By Mukesh
Cascading Style Sheets By Mukesh
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) Works
 
Basic-CSS-tutorial
Basic-CSS-tutorialBasic-CSS-tutorial
Basic-CSS-tutorial
 
CSS ppt
CSS pptCSS ppt
CSS ppt
 
CSS for Beginners
CSS for BeginnersCSS for Beginners
CSS for Beginners
 
CSS Selectors
CSS SelectorsCSS Selectors
CSS Selectors
 
Css
CssCss
Css
 
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
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
 
Make Css easy : easy tips for css
Make Css easy : easy tips for cssMake Css easy : easy tips for css
Make Css easy : easy tips for css
 
Pemrograman Web 3 - CSS Basic Part 2
Pemrograman Web 3 - CSS Basic Part 2Pemrograman Web 3 - CSS Basic Part 2
Pemrograman Web 3 - CSS Basic Part 2
 
Pemrograman Web 2 - CSS
Pemrograman Web 2 - CSSPemrograman Web 2 - CSS
Pemrograman Web 2 - CSS
 

Andere mochten auch

Need for Web Engineering
Need for Web EngineeringNeed for Web Engineering
Need for Web EngineeringNosheen Qamar
 
Web Engineering - Web Application Testing
Web Engineering - Web Application TestingWeb Engineering - Web Application Testing
Web Engineering - Web Application TestingNosheen Qamar
 
Web engineering - Measuring Effort Prediction Power and Accuracy
Web engineering - Measuring Effort Prediction Power and AccuracyWeb engineering - Measuring Effort Prediction Power and Accuracy
Web engineering - Measuring Effort Prediction Power and AccuracyNosheen Qamar
 
Web engineering - An overview about HTML
Web engineering -  An overview about HTMLWeb engineering -  An overview about HTML
Web engineering - An overview about HTMLNosheen Qamar
 
PROGRESS - CSS BASIC
PROGRESS - CSS BASICPROGRESS - CSS BASIC
PROGRESS - CSS BASICUKM PROGRESS
 
Web engineering - HTML Form
Web engineering -  HTML FormWeb engineering -  HTML Form
Web engineering - HTML FormNosheen Qamar
 
Cascading Style Sheet
Cascading Style SheetCascading Style Sheet
Cascading Style Sheetvijayta
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)AakankshaR
 
Angular js for beginners
Angular js for beginnersAngular js for beginners
Angular js for beginnersMunir Hoque
 
[Basic HTML/CSS] 4. html - form tags
[Basic HTML/CSS] 4. html - form tags[Basic HTML/CSS] 4. html - form tags
[Basic HTML/CSS] 4. html - form tagsHyejin Oh
 
[Basic HTML/CSS] 3. html - table tags
[Basic HTML/CSS] 3. html - table tags[Basic HTML/CSS] 3. html - table tags
[Basic HTML/CSS] 3. html - table tagsHyejin Oh
 
Cascading style sheet
Cascading style sheetCascading style sheet
Cascading style sheetMichael Jhon
 
Tables and Forms in HTML
Tables and Forms in HTMLTables and Forms in HTML
Tables and Forms in HTMLDoncho Minkov
 
Html & Css presentation
Html  & Css presentation Html  & Css presentation
Html & Css presentation joilrahat
 
CSS-Cascading Style Sheets - Introduction
CSS-Cascading Style Sheets - IntroductionCSS-Cascading Style Sheets - Introduction
CSS-Cascading Style Sheets - IntroductionMukesh Tekwani
 
CSS3 notes
CSS3 notesCSS3 notes
CSS3 notesRex Wang
 

Andere mochten auch (20)

Need for Web Engineering
Need for Web EngineeringNeed for Web Engineering
Need for Web Engineering
 
Web Engineering - Web Application Testing
Web Engineering - Web Application TestingWeb Engineering - Web Application Testing
Web Engineering - Web Application Testing
 
Web engineering - Measuring Effort Prediction Power and Accuracy
Web engineering - Measuring Effort Prediction Power and AccuracyWeb engineering - Measuring Effort Prediction Power and Accuracy
Web engineering - Measuring Effort Prediction Power and Accuracy
 
Css
CssCss
Css
 
Web engineering - An overview about HTML
Web engineering -  An overview about HTMLWeb engineering -  An overview about HTML
Web engineering - An overview about HTML
 
PROGRESS - CSS BASIC
PROGRESS - CSS BASICPROGRESS - CSS BASIC
PROGRESS - CSS BASIC
 
Web engineering - HTML Form
Web engineering -  HTML FormWeb engineering -  HTML Form
Web engineering - HTML Form
 
Cascading Style Sheet
Cascading Style SheetCascading Style Sheet
Cascading Style Sheet
 
Week 12 CSS - Review from last week
Week 12 CSS - Review from last weekWeek 12 CSS - Review from last week
Week 12 CSS - Review from last week
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
 
Angular js for beginners
Angular js for beginnersAngular js for beginners
Angular js for beginners
 
[Basic HTML/CSS] 4. html - form tags
[Basic HTML/CSS] 4. html - form tags[Basic HTML/CSS] 4. html - form tags
[Basic HTML/CSS] 4. html - form tags
 
[Basic HTML/CSS] 3. html - table tags
[Basic HTML/CSS] 3. html - table tags[Basic HTML/CSS] 3. html - table tags
[Basic HTML/CSS] 3. html - table tags
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
Css ppt
Css pptCss ppt
Css ppt
 
Cascading style sheet
Cascading style sheetCascading style sheet
Cascading style sheet
 
Tables and Forms in HTML
Tables and Forms in HTMLTables and Forms in HTML
Tables and Forms in HTML
 
Html & Css presentation
Html  & Css presentation Html  & Css presentation
Html & Css presentation
 
CSS-Cascading Style Sheets - Introduction
CSS-Cascading Style Sheets - IntroductionCSS-Cascading Style Sheets - Introduction
CSS-Cascading Style Sheets - Introduction
 
CSS3 notes
CSS3 notesCSS3 notes
CSS3 notes
 

Ähnlich wie Web Engineering - Basic CSS Properties

Ähnlich wie Web Engineering - Basic CSS Properties (20)

Css presentation lecture 4
Css presentation lecture 4Css presentation lecture 4
Css presentation lecture 4
 
Css margins
Css marginsCss margins
Css margins
 
Dimensions of elements.pdf
Dimensions of elements.pdfDimensions of elements.pdf
Dimensions of elements.pdf
 
Cascading style sheet part 2
Cascading style sheet   part 2Cascading style sheet   part 2
Cascading style sheet part 2
 
Css padding
Css paddingCss padding
Css padding
 
Web Layout
Web LayoutWeb Layout
Web Layout
 
Css3
Css3Css3
Css3
 
CSS Cascade Style Sheet
CSS Cascade Style SheetCSS Cascade Style Sheet
CSS Cascade Style Sheet
 
Web Development - Lecture 6
Web Development - Lecture 6Web Development - Lecture 6
Web Development - Lecture 6
 
Lab#7 CSS Box Model
Lab#7 CSS Box ModelLab#7 CSS Box Model
Lab#7 CSS Box Model
 
basics of css
basics of cssbasics of css
basics of css
 
Simple Blue Blog Template XML 的副本
Simple Blue Blog Template XML 的副本Simple Blue Blog Template XML 的副本
Simple Blue Blog Template XML 的副本
 
Css & css3
Css & css3Css & css3
Css & css3
 
Web - CSS 1.pptx
Web - CSS 1.pptxWeb - CSS 1.pptx
Web - CSS 1.pptx
 
IT2255 Web Essentials - Unit II Web Designing
IT2255 Web Essentials - Unit II  Web DesigningIT2255 Web Essentials - Unit II  Web Designing
IT2255 Web Essentials - Unit II Web Designing
 
Pres
PresPres
Pres
 
Css outlines
Css outlinesCss outlines
Css outlines
 
Css3
Css3Css3
Css3
 
Chapter 14: Box Model
Chapter 14: Box ModelChapter 14: Box Model
Chapter 14: Box Model
 
Document
DocumentDocument
Document
 

Kürzlich hochgeladen

ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinojohnmickonozaleda
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 

Kürzlich hochgeladen (20)

ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipino
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 

Web Engineering - Basic CSS Properties

  • 1. 1 Web Engineering Lecture 06 Basic CSS Properties University of Lahore Nosheen Qamar
  • 2. CSS background Properties • You can set background of various HTML elements:  The background-color property is used to set the background color of an element.  The background-image property is used to set the background image of an element.  The background-repeat property is used to control the repetition of an image in the background.  The background-position property is used to control the position of an image in the background.  The background-attachment property is used to control the scrolling of an image in the background.
  • 3. 3 background-color • <p style=“background-color: yellow;” > This text has a yellow background. </p> • Output: • Possible values: any color in a valid format.
  • 4. 4 background-image • <table style=“background-image:url(images/css.gif);” > <tr><td> this table has background image which repeats multiple times. </td></tr> </table> • Output: • Possible values: any image with valid format
  • 5. 5 background-repeat • <table style=“background-image: url(images/cat.gif); background-repeat: no-repeat; ” > <tr><td> by default background-repeat property have repeat value. </td></tr> </table> • Output: • Possible values: repeat, repeat-y, repeat-x, no-repeat
  • 6. 6 background-size • <table style=“background-image: url(images/cat.gif); background-repeat: no-repeat; background-size: 200px 200px; ” > <tr><td> background-size property is used to expand the background image. </td></tr> </table> • Output: • Possible values: repeat, repeat-y, repeat-x, no-repeat
  • 7. 7 background-position • <table style=“background-image: url(images/css.gif); background-position: 100px 200px; ” > <tr><td> this table has background image positioned 100 pixels away from the left and 200 pixels from the top. </td></tr> </table> • Output: • Possible values: X% Y%, top left, Xpx Ypx left top center top left bottom center bottom right bottom
  • 8. 8 background-attachment • <p style=“background-image:url(images/css.gif); background-attachment: fixed; ” > This paragraph has fixed background image. </p> • Output: • Possible values: fixed, scroll
  • 9. CSS Borders • You can set following border properties of an element:  The border-color property is used to set the color of the border.  The border-style property is used to set the style of border.  The border-width property is used to set .  The border property is used to set the width, style and color of the border in one declaration.
  • 10. border-style • <p style=“border-style: none”> This is a border with none width.</p> <p style=“border-style: solid”> This is a solid border.</p> <p style=“border-style: dashed”> This is a dashed border.</p> • Output: • Possible values: none, solid, dashed, double, groove, ridge, inset, outset
  • 11. border-color • <style> p.example1 { border-style: solid; border-bottom-color: #009900; border-top-color: #FF0000; border-left-color: #330000; border-right-color: #0000CC; } </style> <p class=“example1”> This example is showing all borders in different colors. </p> • Output: • Possible values: any color with valid format
  • 12. border-color • <style> p.example1 { border-style: solid; border-color: #FF0000; } </style> <p class=“example1”> This example is showing all borders in same color. </p> • Output: • Possible values: any color with valid format
  • 13. border-width • <p style=“border-width: 4px; border-style: solid;”> This is a solid border whose width is 4px.</p> • Output: • Possible values: length in px, pt or cm or it should be thin, medium or thick.
  • 14. • You can individually change the width of the bottom, top, left and right borders of an element. Using the following properties:  border-bottom-width changes the width of bottom border.  border-top-width changes the width of top border.  border-left-width changes the width of left border.  border-right-width changes the width of right border. 14
  • 15. border-width • <style> p.example1 { border-style: solid; border-bottom-width: 6pt; border-top-width: 6pt; border-left-width: 4pt; border-right-width: 4pt; } </style> <p class=“example1”> This example is showing all borders in different widths. </p> • Output: • Possible values: any color with valid format This example is showing all borders in different widths.
  • 16. border • <p style=“border: 4px solid red;”> This example is showing shorthand property for border.</p> • Output:
  • 17. CSS Margins • You can set following margin properties of an element:  The margin-bottom property specify the bottom margin of an element.  The margin-top property specify the top margin of an element.  The margin-left property specify the left margin of an element.  The margin-right property specify the right margin of an element.  The margin shorthand property for setting margin properties in one declaration.
  • 18. margin • <div style=“margin: 20px;”> This is a paragraph with a specified margin from all sides.</div> • Output: • Possible values: auto, length in px, %.
  • 19. margin-top • <div style=“margin-top: 10px;”> This is a paragraph with a specified top margin.</div> • Output: • Possible values: auto, length in px, %.
  • 20. margin-bottom • <div style=“margin-bottom: 10px;”> This is a paragraph with a specified bottom margin.</div> • Output: • Possible values: auto, length in px, %.
  • 21. margin-left • <div style=“margin-left: 10%;”> This is a paragraph with a specified left margin.</div> • Output: • Possible values: auto, length in px, %.
  • 22. margin-right • <div style=“margin-right: 10%;”> This is a paragraph with a specified right margin.</div> • Output: • Possible values: auto, length in px, %.
  • 23. 23 Margin property • <style> p {margin: 15px; } all four margins will be 15px p {margin: 10px 5px; } top and bottom margin will be 10px, left and right will be 2% of the total width of doc. p {margin: 10px 8px 20px 15px; } top margin will be 10px, right margin will be 2%, bottom margin will be -10px, left margin will be set by the browser </style>
  • 24. CSS Padding • Padding property allows you to specify how much space should appear between the content of an element and its border :  The padding-bottom property specify the bottom padding of an element.  The padding-top property specify the top padding of an element.  The padding-left property specify the left padding of an element.  The padding-right property specify the right padding of an element.  The padding shorthand property serves as the preceding properties.
  • 25. padding-bottom • <p style=“padding-bottom: 15px; border- width: 1px solid black;”> This is a paragraph with a specified bottom padding.</p> • Output: This is a paragraph with a specified bottom padding. • Possible values: length in px, %.
  • 26. padding-top • <p style=“padding-top: 15px; border-width: 1px solid black;”> This is a paragraph with a specified top padding.</p> • Output: This is a paragraph with a specified top padding. • Possible values: length in px, %.
  • 27. padding-left • <p style=“padding-left: 15px; border-width: 1px solid black;”> This is a paragraph with a specified left padding.</p> • Output: This is a paragraph with a specified top padding. • Possible values: length in px, %.
  • 28. padding-right • <p style=“padding-right: 15px; border-width: 1px solid black;”> This is a paragraph with a specified right padding.</p> • Output: This is a paragraph with a specified top padding. • Possible values: length in px, %.
  • 29. padding • <p style=“padding: 15px; border-width: 1px solid black;”> This is a paragraph with a specified right padding.</p> • Output: This is a paragraph with a specified top padding. • Possible values: length in px, %.
  • 30. Padding and Margin Properties • Values for both the padding and the margin properties can be expressed using: • em (em values) • px (pixels) • mm (millimeters) • cm (centimeters) • in (inches) • % (percentage of the container element)