SlideShare a Scribd company logo
CSS
CSS Fonts
 Choosing the right font has a huge impact on how
the readers experience a website.
 The right font can create a strong identity for your
brand.
 Using a font that is easy to read is important. The
font adds value to your text. It is also important to
choose the correct color and text size for the font.
Generic Font Families
In CSS there are five generic font families:
1. Serif fonts have a small stroke at the edges of
each letter. They create a sense of formality and
elegance.
2. Sans-serif fonts have clean lines (no small
strokes attached). They create a modern and
minimalistic look.
3. Monospace fonts - here all the letters have the
same fixed width. They create a mechanical
look.
4. Cursive fonts imitate human handwriting.
5. Fantasy fonts are decorative/playful fonts.
All the different font names belong to one
of the generic font families.
The CSS font-family Property
The font-family property should hold several font
names as a "fallback" system, to ensure
maximum compatibility between
browsers/operating systems. Start with the font
you want, and end with a generic family (to let the
browser pick a similar font in the generic family, if
no other fonts are available). The font names
should be separated with comma
If the font name is more than one word, it must be in
quotation marks, like: "Times New Roman".
.p1 {
font-family: "Times New Roman", Times, serif;
}
.p2 {
font-family: Arial, Helvetica, sans-serif;
}
.p3 {
font-family: "Lucida Console", "Courier New",
monospace;
}
<div> tag
The <div> tag defines a division or a section in
an HTML document. The <div> tag is used as a
container for HTML elements - which is then
styled with CSS or manipulated with JavaScript.
The <div> tag is easily styled by using the class
or id attribute. Any sort of content can be put
inside the <div> tag!
<!DOCTYPE html>
<html>
<head>
<style>
div {
border: 1px solid gray;
padding: 8px;
}
h1 {
text-align: center;
text-transform: uppercase;
color: #4CAF50;
}
p {
text-indent: 50px;
text-align: justify;
letter-spacing: 3px;
}
</style>
</head>
<body>
<div>
<h1>text formatting</h1>
<p>This text is styled with some of the text
formatting properties. The heading uses the text-
align, text-transform, and color properties.
The paragraph is indented, aligned, and the
space between characters is specified. The
underline is removed from this colored
</p>
</div>
</body>
</html>
What are browser developer
tools?
 Every modern web browser includes a powerful
suite of developer tools. These tools do a range
of things, from inspecting currently-loaded HTML,
CSS and JavaScript to showing which assets the
page has requested and how long they took to
load.
Lecture-7.pptx
The HTML DOM (Document Object Model)
 When a web page is loaded, the browser creates
a Document Object Model of the page.
 The HTML DOM model is constructed as a tree
of Objects:
What is the DOM?
 DOM defines a standard for accessing documents:
 "The Document Object Model (DOM) is a platform
and language-neutral interface that allows programs
and scripts to dynamically access and update the
content, structure, and style of a document."
The DOM standard is separated into 3 different parts:
 Core DOM - standard model for all document types
 XML DOM - standard model for XML documents
 HTML DOM - standard model for HTML documents
HTML DOM
HTML DOM is a standard object model
and programming interface for HTML. It defines:
 The HTML elements as objects
 The properties of all HTML elements
 The methods to access all HTML elements
 The events for all HTML elements
In other words: The HTML DOM is a standard for how
to get, change, add, or delete HTML elements.
HTML and debugging
 HTML is not as complicated to understand as
Rust. HTML is not compiled into a different form
before the browser parses it and shows the result
(it is interpreted, not compiled). And
HTML's element syntax is arguably a lot easier to
understand than a "real programming language"
like Rust, JavaScript, or Python.
Permissive code
 generally when you do something wrong in code,
there are two main types of error that you'll come
across:
Syntax errors: These are spelling or punctuation errors in your code
that actually cause the program not to run, like the Rust error shown
above. These are usually easy to fix as long as you are familiar with
the language's syntax and know what the error messages mean.
Logic errors: These are errors where the syntax is actually correct,
but the code is not what you intended it to be, meaning that the
program runs incorrectly. These are often harder to fix than syntax
errors, as there isn't an error message to direct you to the source of
the error.
HTML itself doesn't suffer from syntax errors because browsers parse it
permissively, meaning that the page still displays even if there are
syntax errors. Browsers have built-in rules to state how to interpret
incorrectly written markup, so you'll get something running, even if it is
not what you expected. This, of course, can still be a problem!
Note: HTML is parsed permissively because when the web was first created, it
was decided that allowing people to get their content published was more
important than making sure the syntax was absolutely correct. The web would
probably not be as popular as it is today, if it had been more strict from the very
Lecture-7.pptx
 <h1>HTML debugging examples</h1>
 <p>What causes errors in HTML?
 <ul>
<li>Unclosed elements: If an element is <strong>not closed properly,
then its effect can spread to areas you didn't intend
<li>Badly nested elements: Nesting elements properly is also very
important
for code behaving correctly. <strong>strong <em>strong
emphasized?</strong>
what is this?</em>
<li>Unclosed attributes: Another common source of HTML problems.
Let's
look at an example: <a href="https://www.mozilla.org/>link to Mozilla
homepage</a>
 </ul>
 The paragraph and list item elements have no closing
tags. Looking at the image above, this doesn't seem
to have affected the markup rendering too badly, as it
is easy to infer where one element should end and
another should begin.
 The first <strong> element has no closing tag. This is
a bit more problematic, as it isn't easy to tell where
the element is supposed to end. In fact, the whole of
the rest of the text has been strongly emphasized.
 This section is badly nested: <strong>strong
<em>strong emphasized?</strong> what is
this?</em>. It is not easy to tell how this has been
interpreted because of the previous problem.
 The href attribute value is missing a closing double
quote. This seems to have caused the biggest
problem — the link has not rendered at all.
CSS Debugging
 Debugging in CSS means figuring out what might
be the problem when you have unexpected layout
results.
Common Causes Of CSS Bugs
CSS layout issues often fall out of one of the following
categories:
Overflow of content from its parent resulting in extra or unexpected
scrollbars and content being pushed out of the regular viewport area.
Inheriting browser inconsistencies leading to mixed results across
browsers and devices.
Unexpected inheritance from the cascade where multiple styles override
one another, which may cause alignment and spacing issues, among other
things.
CSS resiliency failures from DOM changes, including when child elements
have gained wrapping divs or additional elements are unexpectedly added.
Debugging Overflow
 Overflow is usually one of the most apparent
issues and can be pretty frustrating. It’s not
always evident at a glance which element is
causing overflow, and it can be tedious to try to
comb through elements using dev tools
inspectors.
 A tried and true method to begin figuring out
which element is responsible for overflow is to
add the following CSS:
* {
outline: 1px solid red;
}
Why outline instead of border? Because it will not add to the element’s computed DOM size.
Adding borders will change element appearances if they’re already using a border and may
falsely cause additional overflow issues.
 The intent of using outline is to reveal element
boundaries and visualize how elements are nested.
For example, if overflow is causing unexpected
scrollbars, an outline can help point out which
element is pushing out of the viewport.
 In addition to this manual method, Firefox reveals
scrolling elements and specify which elements have
children causing overflow, as seen in this
COMMON CAUSES OF
OVERFLOW #
 Typically when we’re concerned about overflow
problems, it’s from a mismatch of width
allowances between a parent element and its
children.
 One of the first things to check is if an element
has set an absolute width without a responsive
method to allow it to fully resize downwards. For
example, a 600px box will trigger overflow on
viewports narrower than 600px. Instead, you may
be able to adjust to add in a max-width: 100% so
that the element will also responsively resize:
.wide-element {
width: 600px;
max-width: 100%;
}
we can account for that margin by using the CSS math function calc to subtract the total area
used by the horizontal margins:
p:first-of-type {
width: 800px;
max-width: calc(100% - 6rem);
margin: 3rem;
}
Ad

More Related Content

Similar to Lecture-7.pptx (20)

Lesson 8 Computer Creating your Website.pdf
Lesson 8 Computer Creating your Website.pdfLesson 8 Computer Creating your Website.pdf
Lesson 8 Computer Creating your Website.pdf
AshleyJovelClavecill
 
ARTICULOENINGLES
ARTICULOENINGLESARTICULOENINGLES
ARTICULOENINGLES
Mónica Sánchez Crisostomo
 
Presentation 1 [autosaved]
Presentation 1 [autosaved]Presentation 1 [autosaved]
Presentation 1 [autosaved]
AbdulrahmaanDhagacad
 
Css
CssCss
Css
NIRMAL FELIX
 
An Seo’s Intro to Web Dev, HTML, CSS and JavaScript
An Seo’s Intro to Web Dev, HTML, CSS and JavaScriptAn Seo’s Intro to Web Dev, HTML, CSS and JavaScript
An Seo’s Intro to Web Dev, HTML, CSS and JavaScript
Troyfawkes
 
HTML Bootcamp
HTML BootcampHTML Bootcamp
HTML Bootcamp
MayeCreate Design
 
Css basics
Css basicsCss basics
Css basics
Franc Santos
 
Css basics
Css basicsCss basics
Css basics
Franc Santos
 
Making Your Site Look Great in IE7
Making Your Site Look Great in IE7Making Your Site Look Great in IE7
Making Your Site Look Great in IE7
goodfriday
 
Css 2010
Css 2010Css 2010
Css 2010
Cathie101
 
Css 2010
Css 2010Css 2010
Css 2010
guest0f1e7f
 
Sitepoint.com a basic-html5_template
Sitepoint.com a basic-html5_templateSitepoint.com a basic-html5_template
Sitepoint.com a basic-html5_template
Daniel Downs
 
What is html xml and xhtml
What is html xml and xhtmlWhat is html xml and xhtml
What is html xml and xhtml
FkdiMl
 
GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1
Heather Rock
 
Class13
Class13Class13
Class13
Jiyeon Lee
 
Organize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS TricksOrganize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS Tricks
Andolasoft Inc
 
Html
HtmlHtml
Html
G.C Reddy
 
01 Introduction To CSS
01 Introduction To CSS01 Introduction To CSS
01 Introduction To CSS
crgwbr
 
Module 5-Positioning and Navigation(Chapters 5 & 6).pptx
Module 5-Positioning and Navigation(Chapters 5 & 6).pptxModule 5-Positioning and Navigation(Chapters 5 & 6).pptx
Module 5-Positioning and Navigation(Chapters 5 & 6).pptx
kamalsmail1
 
The Language of the Web - HTML and CSS
The Language of the Web - HTML and CSSThe Language of the Web - HTML and CSS
The Language of the Web - HTML and CSS
kcasavale
 
Lesson 8 Computer Creating your Website.pdf
Lesson 8 Computer Creating your Website.pdfLesson 8 Computer Creating your Website.pdf
Lesson 8 Computer Creating your Website.pdf
AshleyJovelClavecill
 
An Seo’s Intro to Web Dev, HTML, CSS and JavaScript
An Seo’s Intro to Web Dev, HTML, CSS and JavaScriptAn Seo’s Intro to Web Dev, HTML, CSS and JavaScript
An Seo’s Intro to Web Dev, HTML, CSS and JavaScript
Troyfawkes
 
Making Your Site Look Great in IE7
Making Your Site Look Great in IE7Making Your Site Look Great in IE7
Making Your Site Look Great in IE7
goodfriday
 
Sitepoint.com a basic-html5_template
Sitepoint.com a basic-html5_templateSitepoint.com a basic-html5_template
Sitepoint.com a basic-html5_template
Daniel Downs
 
What is html xml and xhtml
What is html xml and xhtmlWhat is html xml and xhtml
What is html xml and xhtml
FkdiMl
 
GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1
Heather Rock
 
Organize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS TricksOrganize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS Tricks
Andolasoft Inc
 
01 Introduction To CSS
01 Introduction To CSS01 Introduction To CSS
01 Introduction To CSS
crgwbr
 
Module 5-Positioning and Navigation(Chapters 5 & 6).pptx
Module 5-Positioning and Navigation(Chapters 5 & 6).pptxModule 5-Positioning and Navigation(Chapters 5 & 6).pptx
Module 5-Positioning and Navigation(Chapters 5 & 6).pptx
kamalsmail1
 
The Language of the Web - HTML and CSS
The Language of the Web - HTML and CSSThe Language of the Web - HTML and CSS
The Language of the Web - HTML and CSS
kcasavale
 

More from vishal choudhary (20)

Pixel to Percentage conversion Convert left and right padding of a div to per...
Pixel to Percentage conversion Convert left and right padding of a div to per...Pixel to Percentage conversion Convert left and right padding of a div to per...
Pixel to Percentage conversion Convert left and right padding of a div to per...
vishal choudhary
 
esponsive web design means that your website (
esponsive web design means that your website (esponsive web design means that your website (
esponsive web design means that your website (
vishal choudhary
 
function in php using like three type of function
function in php using  like three type of functionfunction in php using  like three type of function
function in php using like three type of function
vishal choudhary
 
data base connectivity in php using msql database
data base connectivity in php using msql databasedata base connectivity in php using msql database
data base connectivity in php using msql database
vishal choudhary
 
software evelopment life cycle model and example of water fall model
software evelopment life cycle model and example of water fall modelsoftware evelopment life cycle model and example of water fall model
software evelopment life cycle model and example of water fall model
vishal choudhary
 
software Engineering lecture on development life cycle
software Engineering lecture on development life cyclesoftware Engineering lecture on development life cycle
software Engineering lecture on development life cycle
vishal choudhary
 
strings in php how to use different data types in string
strings in php how to use different data types in stringstrings in php how to use different data types in string
strings in php how to use different data types in string
vishal choudhary
 
OPEN SOURCE WEB APPLICATION DEVELOPMENT question
OPEN SOURCE WEB APPLICATION DEVELOPMENT  questionOPEN SOURCE WEB APPLICATION DEVELOPMENT  question
OPEN SOURCE WEB APPLICATION DEVELOPMENT question
vishal choudhary
 
web performnace optimization using css minification
web performnace optimization using css minificationweb performnace optimization using css minification
web performnace optimization using css minification
vishal choudhary
 
web performance optimization using style
web performance optimization using styleweb performance optimization using style
web performance optimization using style
vishal choudhary
 
Data types and variables in php for writing and databse
Data types and variables in php for writing  and databseData types and variables in php for writing  and databse
Data types and variables in php for writing and databse
vishal choudhary
 
Data types and variables in php for writing
Data types and variables in php for writingData types and variables in php for writing
Data types and variables in php for writing
vishal choudhary
 
Data types and variables in php for writing
Data types and variables in php for writingData types and variables in php for writing
Data types and variables in php for writing
vishal choudhary
 
sofwtare standard for test plan it execution
sofwtare standard for test plan it executionsofwtare standard for test plan it execution
sofwtare standard for test plan it execution
vishal choudhary
 
Software test policy and test plan in development
Software test policy and test plan in developmentSoftware test policy and test plan in development
Software test policy and test plan in development
vishal choudhary
 
function in php like control loop and its uses
function in php like control loop and its usesfunction in php like control loop and its uses
function in php like control loop and its uses
vishal choudhary
 
introduction to php and its uses in daily
introduction to php and its uses in dailyintroduction to php and its uses in daily
introduction to php and its uses in daily
vishal choudhary
 
data type in php and its introduction to use
data type in php and its introduction to usedata type in php and its introduction to use
data type in php and its introduction to use
vishal choudhary
 
PHP introduction how to create and start php
PHP introduction how to create and start phpPHP introduction how to create and start php
PHP introduction how to create and start php
vishal choudhary
 
SE-Lecture1.ppt
SE-Lecture1.pptSE-Lecture1.ppt
SE-Lecture1.ppt
vishal choudhary
 
Pixel to Percentage conversion Convert left and right padding of a div to per...
Pixel to Percentage conversion Convert left and right padding of a div to per...Pixel to Percentage conversion Convert left and right padding of a div to per...
Pixel to Percentage conversion Convert left and right padding of a div to per...
vishal choudhary
 
esponsive web design means that your website (
esponsive web design means that your website (esponsive web design means that your website (
esponsive web design means that your website (
vishal choudhary
 
function in php using like three type of function
function in php using  like three type of functionfunction in php using  like three type of function
function in php using like three type of function
vishal choudhary
 
data base connectivity in php using msql database
data base connectivity in php using msql databasedata base connectivity in php using msql database
data base connectivity in php using msql database
vishal choudhary
 
software evelopment life cycle model and example of water fall model
software evelopment life cycle model and example of water fall modelsoftware evelopment life cycle model and example of water fall model
software evelopment life cycle model and example of water fall model
vishal choudhary
 
software Engineering lecture on development life cycle
software Engineering lecture on development life cyclesoftware Engineering lecture on development life cycle
software Engineering lecture on development life cycle
vishal choudhary
 
strings in php how to use different data types in string
strings in php how to use different data types in stringstrings in php how to use different data types in string
strings in php how to use different data types in string
vishal choudhary
 
OPEN SOURCE WEB APPLICATION DEVELOPMENT question
OPEN SOURCE WEB APPLICATION DEVELOPMENT  questionOPEN SOURCE WEB APPLICATION DEVELOPMENT  question
OPEN SOURCE WEB APPLICATION DEVELOPMENT question
vishal choudhary
 
web performnace optimization using css minification
web performnace optimization using css minificationweb performnace optimization using css minification
web performnace optimization using css minification
vishal choudhary
 
web performance optimization using style
web performance optimization using styleweb performance optimization using style
web performance optimization using style
vishal choudhary
 
Data types and variables in php for writing and databse
Data types and variables in php for writing  and databseData types and variables in php for writing  and databse
Data types and variables in php for writing and databse
vishal choudhary
 
Data types and variables in php for writing
Data types and variables in php for writingData types and variables in php for writing
Data types and variables in php for writing
vishal choudhary
 
Data types and variables in php for writing
Data types and variables in php for writingData types and variables in php for writing
Data types and variables in php for writing
vishal choudhary
 
sofwtare standard for test plan it execution
sofwtare standard for test plan it executionsofwtare standard for test plan it execution
sofwtare standard for test plan it execution
vishal choudhary
 
Software test policy and test plan in development
Software test policy and test plan in developmentSoftware test policy and test plan in development
Software test policy and test plan in development
vishal choudhary
 
function in php like control loop and its uses
function in php like control loop and its usesfunction in php like control loop and its uses
function in php like control loop and its uses
vishal choudhary
 
introduction to php and its uses in daily
introduction to php and its uses in dailyintroduction to php and its uses in daily
introduction to php and its uses in daily
vishal choudhary
 
data type in php and its introduction to use
data type in php and its introduction to usedata type in php and its introduction to use
data type in php and its introduction to use
vishal choudhary
 
PHP introduction how to create and start php
PHP introduction how to create and start phpPHP introduction how to create and start php
PHP introduction how to create and start php
vishal choudhary
 
Ad

Recently uploaded (20)

Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Ad

Lecture-7.pptx

  • 1. CSS
  • 2. CSS Fonts  Choosing the right font has a huge impact on how the readers experience a website.  The right font can create a strong identity for your brand.  Using a font that is easy to read is important. The font adds value to your text. It is also important to choose the correct color and text size for the font.
  • 3. Generic Font Families In CSS there are five generic font families: 1. Serif fonts have a small stroke at the edges of each letter. They create a sense of formality and elegance. 2. Sans-serif fonts have clean lines (no small strokes attached). They create a modern and minimalistic look. 3. Monospace fonts - here all the letters have the same fixed width. They create a mechanical look. 4. Cursive fonts imitate human handwriting. 5. Fantasy fonts are decorative/playful fonts. All the different font names belong to one of the generic font families.
  • 4. The CSS font-family Property The font-family property should hold several font names as a "fallback" system, to ensure maximum compatibility between browsers/operating systems. Start with the font you want, and end with a generic family (to let the browser pick a similar font in the generic family, if no other fonts are available). The font names should be separated with comma If the font name is more than one word, it must be in quotation marks, like: "Times New Roman".
  • 5. .p1 { font-family: "Times New Roman", Times, serif; } .p2 { font-family: Arial, Helvetica, sans-serif; } .p3 { font-family: "Lucida Console", "Courier New", monospace; }
  • 6. <div> tag The <div> tag defines a division or a section in an HTML document. The <div> tag is used as a container for HTML elements - which is then styled with CSS or manipulated with JavaScript. The <div> tag is easily styled by using the class or id attribute. Any sort of content can be put inside the <div> tag!
  • 7. <!DOCTYPE html> <html> <head> <style> div { border: 1px solid gray; padding: 8px; } h1 { text-align: center; text-transform: uppercase; color: #4CAF50; } p { text-indent: 50px; text-align: justify; letter-spacing: 3px; } </style> </head> <body> <div> <h1>text formatting</h1> <p>This text is styled with some of the text formatting properties. The heading uses the text- align, text-transform, and color properties. The paragraph is indented, aligned, and the space between characters is specified. The underline is removed from this colored </p> </div> </body> </html>
  • 8. What are browser developer tools?  Every modern web browser includes a powerful suite of developer tools. These tools do a range of things, from inspecting currently-loaded HTML, CSS and JavaScript to showing which assets the page has requested and how long they took to load.
  • 10. The HTML DOM (Document Object Model)  When a web page is loaded, the browser creates a Document Object Model of the page.  The HTML DOM model is constructed as a tree of Objects:
  • 11. What is the DOM?  DOM defines a standard for accessing documents:  "The Document Object Model (DOM) is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document." The DOM standard is separated into 3 different parts:  Core DOM - standard model for all document types  XML DOM - standard model for XML documents  HTML DOM - standard model for HTML documents
  • 12. HTML DOM HTML DOM is a standard object model and programming interface for HTML. It defines:  The HTML elements as objects  The properties of all HTML elements  The methods to access all HTML elements  The events for all HTML elements In other words: The HTML DOM is a standard for how to get, change, add, or delete HTML elements.
  • 13. HTML and debugging  HTML is not as complicated to understand as Rust. HTML is not compiled into a different form before the browser parses it and shows the result (it is interpreted, not compiled). And HTML's element syntax is arguably a lot easier to understand than a "real programming language" like Rust, JavaScript, or Python.
  • 14. Permissive code  generally when you do something wrong in code, there are two main types of error that you'll come across: Syntax errors: These are spelling or punctuation errors in your code that actually cause the program not to run, like the Rust error shown above. These are usually easy to fix as long as you are familiar with the language's syntax and know what the error messages mean. Logic errors: These are errors where the syntax is actually correct, but the code is not what you intended it to be, meaning that the program runs incorrectly. These are often harder to fix than syntax errors, as there isn't an error message to direct you to the source of the error. HTML itself doesn't suffer from syntax errors because browsers parse it permissively, meaning that the page still displays even if there are syntax errors. Browsers have built-in rules to state how to interpret incorrectly written markup, so you'll get something running, even if it is not what you expected. This, of course, can still be a problem! Note: HTML is parsed permissively because when the web was first created, it was decided that allowing people to get their content published was more important than making sure the syntax was absolutely correct. The web would probably not be as popular as it is today, if it had been more strict from the very
  • 16.  <h1>HTML debugging examples</h1>  <p>What causes errors in HTML?  <ul> <li>Unclosed elements: If an element is <strong>not closed properly, then its effect can spread to areas you didn't intend <li>Badly nested elements: Nesting elements properly is also very important for code behaving correctly. <strong>strong <em>strong emphasized?</strong> what is this?</em> <li>Unclosed attributes: Another common source of HTML problems. Let's look at an example: <a href="https://www.mozilla.org/>link to Mozilla homepage</a>  </ul>
  • 17.  The paragraph and list item elements have no closing tags. Looking at the image above, this doesn't seem to have affected the markup rendering too badly, as it is easy to infer where one element should end and another should begin.  The first <strong> element has no closing tag. This is a bit more problematic, as it isn't easy to tell where the element is supposed to end. In fact, the whole of the rest of the text has been strongly emphasized.  This section is badly nested: <strong>strong <em>strong emphasized?</strong> what is this?</em>. It is not easy to tell how this has been interpreted because of the previous problem.  The href attribute value is missing a closing double quote. This seems to have caused the biggest problem — the link has not rendered at all.
  • 18. CSS Debugging  Debugging in CSS means figuring out what might be the problem when you have unexpected layout results. Common Causes Of CSS Bugs CSS layout issues often fall out of one of the following categories: Overflow of content from its parent resulting in extra or unexpected scrollbars and content being pushed out of the regular viewport area. Inheriting browser inconsistencies leading to mixed results across browsers and devices. Unexpected inheritance from the cascade where multiple styles override one another, which may cause alignment and spacing issues, among other things. CSS resiliency failures from DOM changes, including when child elements have gained wrapping divs or additional elements are unexpectedly added.
  • 19. Debugging Overflow  Overflow is usually one of the most apparent issues and can be pretty frustrating. It’s not always evident at a glance which element is causing overflow, and it can be tedious to try to comb through elements using dev tools inspectors.  A tried and true method to begin figuring out which element is responsible for overflow is to add the following CSS: * { outline: 1px solid red; } Why outline instead of border? Because it will not add to the element’s computed DOM size. Adding borders will change element appearances if they’re already using a border and may falsely cause additional overflow issues.
  • 20.  The intent of using outline is to reveal element boundaries and visualize how elements are nested. For example, if overflow is causing unexpected scrollbars, an outline can help point out which element is pushing out of the viewport.  In addition to this manual method, Firefox reveals scrolling elements and specify which elements have children causing overflow, as seen in this
  • 21. COMMON CAUSES OF OVERFLOW #  Typically when we’re concerned about overflow problems, it’s from a mismatch of width allowances between a parent element and its children.  One of the first things to check is if an element has set an absolute width without a responsive method to allow it to fully resize downwards. For example, a 600px box will trigger overflow on viewports narrower than 600px. Instead, you may be able to adjust to add in a max-width: 100% so that the element will also responsively resize: .wide-element { width: 600px; max-width: 100%; }
  • 22. we can account for that margin by using the CSS math function calc to subtract the total area used by the horizontal margins: p:first-of-type { width: 800px; max-width: calc(100% - 6rem); margin: 3rem; }