SlideShare a Scribd company logo
INTRODUCTION TO
CASCADING STYLE
SHEETS
Quarter 4
BLESILDA B. VOCAL
LEARNING
OBJECTIVES
◦understand what a CSS is,
◦identify the ways on how to
apply CSS to HTML, and;
◦ understand what selectors,
properties and values are.
What is Cascading Style Sheet(CSS)?
1.HTML
2.JAVASCRIPT
3.CSS
Defines the behavior
Defines the appearance and style
Defines the structure
What is CSS?
Cascadin
g
Style Sheet
CSS
Fonts Colors Positioning Animation
What is CSS?
◦Cascading Styles Sheets (CSS) is a way to style and
present HTML.
◦Whereas the HTML is the meaning or content, the
style sheet is the presentation of that document.
◦It is a styling language used to add style, layout, and
visual presentation to web pages written in HTML or
XML markup languages
Cascading Style Sheet
◦Cascading Style Sheets, fondly referred to as CSS, is a
simple design language intended to simplify the process of
making web pages presentable.
◦CSS handles the look and feel part of a web page.
◦CSS is easy to learn and understand but it provides
powerful control over the presentation of an HTML
document. Most commonly, CSS is combined with the
markup languages HTML or XHTML.
Why Use CSS?
◦CSS is used to define styles for
your web pages, including the
design, layout and variations in
display for different devices
and screen sizes.
Example of CSS coding
CSS Syntax
Parts of Style Rule
◦Selector − A selector is an HTML tag at which a style will be
applied. This could be any tag like <h1> or <table> etc.
◦Property − A property is a type of attribute of HTML tag. Put
simply, all the HTML attributes are converted into CSS
properties. They could be color, border etc.
◦ Value − Values are assigned to properties. For example,
color property can have value either red or #F1F1F1 etc.
EXAMPLE
◦ In this example all <p> elements will be center-aligned, with a red text color:
Advantages of CSS
◦ CSS saves time − You can write CSS once and then reuse same sheet
in multiple HTML pages. You can define a style for each HTML element
and apply it to as many Web pages as you want.
◦ • Pages load faster − If you are using CSS, you do not need to write
HTML tag attributes every time. Just write one CSS rule of a tag and
apply it to all the occurrences of that tag. So less code means faster
download time.
◦ • Easy maintenance − To make a global change, simply change the
style, and all elements in all the web pages will be updated automatically.
Advantages of CSS
◦ Superior styles to HTML − CSS has a much wider array of attributes than
HTML, so you can give a far better look to your HTML page in comparison to
HTML attributes.
◦ • Multiple device compatibility − Style sheets allow content to be
optimized for more than one type of device. By using the same HTML
document, different versions of a website can be presented for handheld
devices such as PDAs and cell phones or for printing.
◦ • Global web standards − Now HTML attributes are being deprecated and it
is being recommended to use CSS. So, it is a good idea to start using CSS
in all the HTML pages to make them compatible to future browsers
HTML-CSS-QUARTER4 COMPUTER PROGRAMMING SSC
You can put CSS Style Rule Syntax as follows
selector { property: value }
Table { border: 1 px solid #C00 }
•table is a selector that selects the HTML element(s) that you want to style. In this case, it's selecting all the
<table> elements.
•{} brackets are used to enclose the declaration block that contains the property-value pairs for the selected
element(s).
•border is the CSS property being applied to the selected element(s). It sets the border around the table.
•1px is the value of the border-width property, which sets the width of the border to 1 pixel.
•solid is the value of the border-style property, which sets the style of the border to a solid line.
•#C00 is the value of the border-color property, which sets the color of the border to a shade of red.
The Type Selectors
◦ This is the same selector we have seen above. Again, one more example to give a color to all
level 1 headings.
h1 { color: #36CFFF; }
The selector h1 is targeting all the <h1> elements in
the HTML document and applying the color property
with a value of #36CFFF. This means that all <h1>
elements will have their text color set to the specified
value, which in this case is a shade of blue.
The Universal Selectors
◦Rather than selecting elements of a specific type, the
universal selector quite simply matches the name of
any element type
* {
color: #000000;
}
The Descendant Selectors
◦ Suppose you want to apply a style rule to a particular element only when it lies inside a particular element. As
given in the following example, style rule will apply to <em> element only when it lies inside <ul> tag.
◦ This is a CSS rule that sets the text color of all <em> elements that
are descendants of <ul> elements to black (#000000).
◦ <ul> is the selector for an unordered list element, and <em> is the
selector for an emphasized text element. The space between them
indicates that <em> is a descendant element of <ul>. By setting the
color property to #000000 (which is black), this CSS rule will change
the text color of all <em> elements within a <ul> element to black.
◦<ul>
◦ <li><em>Item 1</em></li>
◦ <li><em>Item 2</em></li>
◦</ul>
The Class Selectors
Applying CSS
Create a webpage and apply the following below;
1. Black as background color.
2. Add Heading 1 and write the title of this module with white as text color.
3. For the content add paragraph use 20 pixel for text size and then write your
reflection/generalization about this lesson. Minimum of 5 sentences. 4. Use Yellow for text
color content. 5. Use Forte as style of the text
CSS COLORS,
COMMENTS
Quarter 4
Learning Objectives
◦understand the different CSS
measurement units, use
comments to explain codes and
identify the different color values
to specify a color.
CSS units
◦Pixels -The most widely used
measurement unit. A pixel
does not actually correlate to
a physical pixel on your
screen, as that varies, a lot,
by device (think high-DPI
devices vs non-retina
devices).
◦Percentages -let you specify
values in percentages of that
parent element’s
corresponding property.
Relative units
◦em is the value assigned to that element’s font-size,
therefore its exact value changes between elements.
◦rem is similar to em, but instead of varying on the current
element font size, it uses the root element (html) font size.
◦ex is like em, but inserted of measuring the width of m, it
measures the height of the x letter.
◦ch is like ex but instead of measuring the height of x it
measures the width of 0 (zero).
CSS Comments
◦ Comments are used to
explain the code and may
help when you edit the
source code at a later
date. Comments are
ignored by browsers.
◦ A CSS comment is
placed inside the <style>
element, and starts with /*
and ends with */:
HTML and
CSS
Comments
CSS Colors
◦CSS uses color values to specify a
color. Typically, these are used to
set a color either for the foreground
of an element or else for the
background of the element.
Following table lists all the possible formats
1. CSS Colors - Hex Codes
◦A hexadecimal is a 6-digit representation of a
color. The first two digits(RR) represent a red
value, the next two are a green value(GG),
and the last are the blue value(BB). Colors
are specified using predefined color names,
or RGB, HEX, HSL, RGBA, HSLA values.
Following are the examples to use Hexadecimal notation.
2. CSS Colors - Short Hex Codes
3. CSS Colors - RGB Values
4. CSS Color Names
HTML-CSS-QUARTER4 COMPUTER PROGRAMMING SSC
CSS Background Color You can set the
background color for HTML elements
<!DOCTYPE html>
<html> <body> <h1 style="background-color:DodgerBlue;">Hello
World</h1> <p style="background-color:Tomato;"> The quick brown fox
jumps over the lazy dog. </p> </body> </html>
CSS Text Color
CSS Border Color
<!DOCTYPE html>
<html>
<body>
<h1 style="border: 2px solid Tomato;">Hello World</h1>
<h1 style="border: 2px solid DodgerBlue;">Hello World</h1>
<h1 style="border: 2px solid Violet;">Hello World</h1>
</body> </html>
DO YOU
HAVE ANY
QUESTION/S?
EVALUATION:
Hands on Activity: Create the CSS / HTML code for the
given output.
CSS BACKGROUND
PROPERTIES
Learning Objectives
At the end of the lesson
◦you will be able to learn
the CSS background
properties and apply how
to set backgrounds of
various HTML elements.
The background color of an element is specified by the background-
color property. The background color of a page is defined in the
body selector:
body {
background-color: #338844;
}
Background Properties
◦ background-image property is used to set the background image of an element.
◦ background-color property is used to set the background color of an element.
◦ background-repeat property is used to control the repetition of an image in the background.
◦ background-position property is used to control the position of an image in the background.
◦ background-attachment property is used to control the scrolling of an image in the
background.
◦ background-property is used as a shorthand to specify the number of other background
properties.
Background Image
We can set the background image by calling local stored images as shown below.
<html>
<head>
<style>
body {
background-image: url("html.png");
background-color: #cccccc;
}
</style>
</head>
<body>
<h1>Hello World!</h1>
</body>
<html>
Background Color
background-color: color | transparent |
inherit;
For example:
body {
background-color: #338844;
}
Color values in CSS are most often specified in the following
formats:
a color name - like "red"
a HEX value - like "#ff0000"
an RGB value - like "rgb(255, 0, 0)"
Opacity / Transparency
Example
div {
background-color: green;
opacity: 0.3;
}
Transparency using RGBA
An RGBA color value is specified with: rgba(red, green, blue, alpha). The alpha
parameter is a number between 0.0 (fully transparent) and 1.0 (fully opaque).
Example
div {
background: rgba(0, 128, 0, 0.3) /* Green background with 30% opacity */
}
Background Repeat
The background-repeat property allows you to control how a
background image is repeated or tiled in the background of an
element. You can set a background image to repeat vertically (y-axis),
horizontally (x-axis), in both directions, or in neither direction.
Syntax:
background-repeat: repeat | repeat-x | repeat-y | no-repeat | inherit;
Values Repeat
The image is repeated both horizontally and
vertically.
body {
background-image: url("images.jpg");
background-repeat:repeat;
}
repeat-y: The image is repeated vertically
only.
body {
background-image: url("images.jpg");
background-repeat:repeat-y;
}
repeat-x: The image is repeated horizontally only.
body {
background-image: url("images.jpg");
background-repeat:repeat-x;
}
no-repeat: the image is not repeated: only one copy of the
image is drawn.
body {
background-image: url("images.jpg");
background-repeat:no-repeat;
}
inherit: Takes the same specified value as the property for
the element's parent.
body {
background-image: url("images.jpg");
background-repeat:inherit;
}
Background Position
◦ The background-position property is used to control the
position of the background image. If no background position
has been specified, the background image is placed at the
default top-left position of the element i.e. at (0,0), let's try out
the following example:
Syntax: background-position: value
body {
background-image: url("images/robot.png");
background-repeat: no-repeat;
background-position: right top;
}
HTML-CSS-QUARTER4 COMPUTER PROGRAMMING SSC
<html>
<head>
<style>
body {
background-image: url("lebron.jpg");
background-position:100px;
}
</style>
</head>
<body>
<p><b>LEBRON JAMES</b></p>
</body>
</html>
<html>
<head>
<style>
body {
background-image: url("lebron.jpg");
background-position:100px 200px;
}
</style>
</head>
<body>
<p><b>LEBRON JAMES</b></p>
</body>
</html>
Background-attachment
◦ The background-attachment property specifies whether a background image is fixed with regard to
the viewport or scrolls along with the containing block.
Syntax:
background-attachment: scroll | fixed | local | inherit;
Values scroll :
If specified, the background image scrolls with the element.
body {
background-image: url("img.jpg");
background-attachment: scroll;
}
Background-attachment
◦ The background-attachment property specifies whether a background image is fixed with regard to the
viewport or scrolls along with the containing block.
Syntax:
background-attachment: scroll | fixed | local | inherit;
fixed :
If specified, the background image does not scrolls with the element.
body {
background-image: url("bg.jpg");
background-attachment: fixed;
}
Background-attachment
◦ The background-attachment property specifies whether a background image is fixed with regard
to the viewport or scrolls along with the containing block.
Syntax:
background-attachment: scroll | fixed | local | inherit;
inherit: Takes the same specified value as the property for the element's parent.
body {
background-image: url("bg.jpg");
background-attachment: inherit;
}
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-image: url('lebron.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
}
</style>
</head>
<body>
<p>LEBRON JAMES</p>
<p> LEBRON JAMES </p>
<p> LEBRON JAMES </p>
<p> LEBRON JAMES </p>
<p> LEBRON JAMES </p>
<p> LEBRON JAMES </p>
<p> LEBRON JAMES </p>
<p> LEBRON JAMES </p>
</body>
</html>
DO YOU
HAVE ANY
QUESTION/S?
Create the CSS / HTML Codes using background properties for the given output. Write
them in your answer sheet.
Output:
Hint:
*Background color is blue
*p color is #FFFFFF
CSS FONTS
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.
Difference Between Serif and Sans-serif Fonts
Some Font Examples
Font properties of an
element:
• The font-family property is used to change the face of a font.
• The font-style property is used to make a font italic or oblique.
• The font-variant property is used to create a small-caps effect.
• The font-weight property is used to increase or decrease how bold or light a font
appears
• The font-size property is used to increase or decrease the size of a font.
• The font property is used as shorthand to specify a number of other font properties.
Set the Font Family
◦ <html>
◦ <head>
◦ </head>
◦ <body>
◦ <p style = "font-family:georgia,garamond,serif;"> This text is rendered in either georgia,
garamond, or the default serif font depending on which font you have at your system. </p>
◦ </body>
◦ </html>
Set the Font Style
◦ Following is the example, which demonstrates how to set the font style of an element. Possible values are normal,
italic and oblique.
<html>
<head>
</head>
<body>
<p style = "font-style:italic;"> This text will be rendered in italic style </p>
</body>
</html>
Set the Font Variant
◦ The following example demonstrates how to set the font variant of an element. Possible values are normal and small-
caps.
<html>
<head>
</head>
<body>
<p style = "font-variant:small-caps;"> This text will be rendered as small caps </p>
</body>
</html>
Set the Font Weight
◦ The font-weight property provides the functionality to specify how bold a font is. Possible values could be normal,
bold, bolder, lighter, 100, 200, 300, 400, 500, 600, 700, 800, 900.
<html>
<head>
</head>
<body>
<p style = "font-weight:bold;"> This font is bold. </p>
<p style = "font-weight:bolder;"> This font is bolder. </p>
<p style = "font-weight:500;"> This font is 500 weight. </p>
</body>
</html>
Set the Font Size
◦ The font- size property is used to control the size of fonts. Possible values could be xx-small, x-small, small,
medium, large, x-large, xx-large, smaller, larger, size in pixels or in %.
<html>
<head>
</head>
<body>
<p style = "font-size:20px;"> This font size is 20 pixels </p>
<p style = "font-size:small;"> This font size is small </p>
<p style = "font-size:large;"> This font size is large </p>
</body>
</html>
Set the Font Size Adjust
◦ This property enables you to adjust the x-height to make fonts more legible. Possible value could be any number.
<html>
<head>
</head>
<body>
<p style = "font-size-adjust:0.61;"> This text is using a font-size-adjust value.
</p>
</body>
</html>
Set the Font Stretch
◦ This property relies on the user's computer to have an expanded or condensed version of the font being used.
Possible values could be normal, wider, narrower, ultra-condensed, extra-condensed, condensed, semi-
condensed, semi-expanded, expanded, extra-expanded, ultra-expanded.
<html>
<head>
</head>
<body>
<p style = "font-stretch:ultra-expanded;"> If this doesn't appear to work, it is likely that your computer
doesn't have a <br>condensed or expanded version of the font being used. </p>
</body>
</html>
Shorthand Property
◦ <html>
◦ <head>
◦ </head>
◦ <body>
◦ <p style = "font:italic small-caps bold 15px georgia;"> Applying all the properties on the text at once.
◦ </p>
◦ </body> </html>
• The font-family property is used to change the face of a font.
• The font-style property is used to make a font italic or oblique.
• The font-variant property is used to create a small-caps effect.
• The font-weight property is used to increase or decrease how
bold or light a font appears
• The font-size property is used to increase or decrease the size of a font.
• The font property is used as shorthand to specify a number of other
font properties.
HTML-CSS-QUARTER4 COMPUTER PROGRAMMING SSC
CSS TEXT
Learning Objectives:
◦At the end of the lesson you
will be able to understand
how to manipulate text using
CSS properties.
You can set following text properties of an element:
Set the Text Color
<html>
<head>
</head>
<body>
<p style = "color:red;"> This text will be written in red. </p>
</body>
</html>
Set the Text Direction
◦ The following example demonstrates how to set the direction of a text. Possible values are ltr or rtl.
<html>
<head>
</head>
<body>
<p style = "direction:rtl;"> This text will be rendered from right to left </p>
</body>
</html>
Set the Space between Characters
◦ <html>
◦ <head>
◦ </head>
◦ <body>
◦ <p style = "letter-spacing:5px;"> This text is having space between letters. </p> </body
◦ </html>
Set the Space between Words
◦ <html>
◦ <head>
◦ </head>
◦ <body>
◦ <p style = "word-spacing:5px;"> This text is having space between words.
◦ </p>
◦ </body>
◦ </html>
Set the Text Indent
◦ <html>
◦ <head>
◦ </head>
◦ <body>
◦ <p style = "text-indent:1cm;"> This text will have first line indented by 1cm and this line will
remain at its actual position this is done by CSS text-indent property. </p> </body>
◦ </html>
Set the Text Alignment
Decorating the Text
Set the Text Cases
Set the Text Shadow
Performance Task No.1
◦Design a personal blog or website with a
color scheme that reflects your personality
or interests using css
Choose a color scheme that reflects your personality or
interests.
For example, if you are a nature lover, you may want to use
shades of green and brown. If you are a music enthusiast, you
may want to use bold and vibrant colors like red, yellow, and
blue.
For the additional content add paragraph use 20 pixel for text size and then write
your reflection/generalization about this lesson. Minimum of 5 sentences.
Rubrics:
My Blog
HTML-CSS-QUARTER4 COMPUTER PROGRAMMING SSC
HTML-CSS-QUARTER4 COMPUTER PROGRAMMING SSC
HTML-CSS-QUARTER4 COMPUTER PROGRAMMING SSC
CSS BORDERS
Learning
Objectives
◦At the end of the lesson, you
will be able to learn the CSS
border properties that allow you
to define the border area of an
element's box.
BORDER PROPERTIES
• The border-color specifies the color of a border.
• The border-style specifies whether a border should
be solid, dashed line, double line, or one of the other
possible values.
• The border-width specifies the width of a border.
The border-color Property
◦ The border-color property allows you to change the color of the border surrounding an element. You can
individually change the color of the bottom, left, top and right sides of an element's border using the
properties.
• border-bottom-color changes the color of bottom border.
• border-top-color changes the color of top border.
• border-left-color changes the color of left border.
• border-right-color changes the color of right border.
HTML-CSS-QUARTER4 COMPUTER PROGRAMMING SSC
The border-style Property
• none − No border. (Equivalent of border-width:0;)
• solid − Border is a single solid line.
• dotted − Border is a series of dots.
• dashed − Border is a series of short lines.
• double − Border is two solid lines.
• groove − Border looks as though it is carved into the page.
• ridge − Border looks the opposite of groove.
• inset − Border makes the box look like it is embedded in the page.
• outset − Border makes the box look like it is coming out of the canvas.
• hidden − Same as none, except in terms of border-conflict resolution for table elements
• border-bottom-style changes the style of bottom border.
• border-top-style changes the style of top border.
• border-left-style changes the style of left border.
• border-right-style changes the style of right border.
HTML-CSS-QUARTER4 COMPUTER PROGRAMMING SSC
HTML-CSS-QUARTER4 COMPUTER PROGRAMMING SSC
HTML-CSS-QUARTER4 COMPUTER PROGRAMMING SSC
CSS
IMAGES
The image has 9 different style. This is the following
The Rounded images
The thumbnail images
The Responsive images
The Transparent images
The Image Filter
The Image Hoverlay
◦ The overlay-image class container encapsulates all the necessary structure:
◦ -original image,
◦ -original overlay text block,
◦ -image/text overlay block
◦ With a builder, it can be replaced by an existing container block (for example it could be the Divi "code" module, to which we simply add
the overlay-image class). displayed on mouse hover.
EXAMPLE
HTML-CSS-QUARTER4 COMPUTER PROGRAMMING SSC
The following example shows all flip
images properties:
The Responsive Image
◦ A responsive, mobile friendly image gallery. You can use it
as is or you can modify it how you want. It doesn't have to
be full width either. Give the gallery element a width and
it will fit to that making it easy to be right aligned or
centered within a page.
The Image Modal
◦ A modal is a dialog box/popup window that is displayed on top of the current page.
Example
PERFORMANCE
TASK
WEBSITE DESIGN
TASK: CREATE A SCHOOL WEBSITE
USING HTML AND CSS THAT INCLUDES
THE FOLLOWING PAGES AND
FEATURES:
Homepage
•Design an engaging homepage
that represents your school.
•Include a header with the school
logo and a navigation menu
with links to other pages.
•Add a hero section with a
captivating image or slideshow
and a brief welcome message.
About Us
• Create a page that provides information
about your school.
• Include the school's history, mission, vision,
and core values.
• Add relevant images or videos to enhance
the content.
Academics:
• Design a page that highlights the academic programs
and courses offered at your school.
• Include a description of each program, its benefits,
and any unique features.
• Present the information in an organized and visually
appealing manner.
Faculty and Staff:
• Create a page that introduces the faculty and
staff members at your school.
• Include their names, roles, qualifications, and
a brief bio.
• Optionally, add their profile pictures for a
personal touch.
Student Life:
• Design a page that showcases the
vibrant student life at your school.
• Include information about clubs,
sports teams, extracurricular
activities, and events.
• Add images, videos, or
testimonials to highlight student
achievements and experiences.
Admissions:
• Create a page with all the necessary information for
prospective students and parents.
• Include admission requirements, procedures,
deadlines, and contact details.
• Optionally, provide a downloadable application
form.
Contact Us:
• Design a page that includes contact information
for your school.
• Include the school's address, phone number,
email, and social media links.
• Optionally, include a contact form for visitors to
send messages or inquiries.
Styling and Visual
Design
• Use CSS to style your website and make it
visually appealing.
• Choose appropriate fonts, colors, and layouts
that align with your school's brand.
• Ensure consistency in design elements such as
headers, buttons, and forms.
Rubrics
Criteria Points
Design and Layout
Effective use of color, typography, and layout
Consistent design elements throughout the website
Attention to detail in design and aesthetics
25 Points
Content and Structure
Clear and concise information on each page
Well-organized structure and navigation
Relevant and engaging content for each section
25 Points
CSS Styling
Effective use of CSS to style the website
Consistent and appropriate use of fonts, colors, and layout
CSS code is clean and well-structured
25 Points
Interactivity
Implementation of interactive elements such as forms, buttons, or animations
Interactive elements are functional and enhance the user experience
10 Points
Timeliness
Completion of the project within the specified deadline
5 Points (DEADLINE: APRIL 30, 2024)
Work Ethics
Active participation and contribution to the group project
accountability for assigned tasks and responsibilities
10 Points
CSS LINKS
MODULE 5
Learning Objective:
◦you will be able to learn the
how to use link using CSS
Properties of Links
◦The link signifies unvisited hyperlinks.
◦ The :visited signifies visited hyperlinks.
◦The :hover signifies an element that currently has the user's
mouse pointer hovering over it
◦The :active signifies an element on which the user is
currently clicking.
You can set following font properties of
an element:
◦ The font-family property is used to change the face of a font.
◦ The font-style property is used to make a font italic or oblique.
◦ The font-variant property is used to create a small-caps effect.
◦ The font-weight property is used to increase or decrease how bold or light
a font appears.
◦ The font-size property is used to increase or decrease the size of a font.
◦ The font property is used as shorthand to specify a number of other font
properties.
Ad

More Related Content

Similar to HTML-CSS-QUARTER4 COMPUTER PROGRAMMING SSC (20)

Web Programming-css.pptx
Web Programming-css.pptxWeb Programming-css.pptx
Web Programming-css.pptx
MarwaAnany1
 
Unit 2 Internet and web technology CSS report
Unit 2 Internet and web technology CSS reportUnit 2 Internet and web technology CSS report
Unit 2 Internet and web technology CSS report
ajaysahusistec
 
Cascading style sheet, CSS Box model, Table in CSS
Cascading style sheet, CSS Box model, Table in CSSCascading style sheet, CSS Box model, Table in CSS
Cascading style sheet, CSS Box model, Table in CSS
SherinRappai
 
Lecture-6.pptx
Lecture-6.pptxLecture-6.pptx
Lecture-6.pptx
vishal choudhary
 
Csstutorial
CsstutorialCsstutorial
Csstutorial
Ankit Rana
 
Css
CssCss
Css
Balakumaran Arunachalam
 
WEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptxWEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptx
karthiksmart21
 
CSS - LinkedIn
CSS - LinkedInCSS - LinkedIn
CSS - LinkedIn
Gino Louie Peña, ITIL®,MOS®
 
Css
CssCss
Css
NIRMAL FELIX
 
CSS.pptx
CSS.pptxCSS.pptx
CSS.pptx
PushpaLatha551681
 
Web application is an application that is accessed by web visitor over intern...
Web application is an application that is accessed by web visitor over intern...Web application is an application that is accessed by web visitor over intern...
Web application is an application that is accessed by web visitor over intern...
MdAmreen
 
Cascading Style Sheets for web browser.pptx
Cascading Style Sheets for web browser.pptxCascading Style Sheets for web browser.pptx
Cascading Style Sheets for web browser.pptx
alvindalejoyosa1
 
Workshop 2 Slides.pptx
Workshop 2 Slides.pptxWorkshop 2 Slides.pptx
Workshop 2 Slides.pptx
DaniyalSardar
 
Css
CssCss
Css
Abhishek Kesharwani
 
Css
CssCss
Css
Yudha Arif Budiman
 
Css
CssCss
Css
Er. Nawaraj Bhandari
 
CSS
CSSCSS
CSS
People Strategists
 
Css basics
Css basicsCss basics
Css basics
mirza asif haider
 
CSS
CSSCSS
CSS
ARJUN
 
uptu web technology unit 2 Css
uptu web technology unit 2 Cssuptu web technology unit 2 Css
uptu web technology unit 2 Css
Abhishek Kesharwani
 

Recently uploaded (20)

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)
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
THE STG QUIZ GROUP D.pptx quiz by Ridip Hazarika
THE STG QUIZ GROUP D.pptx   quiz by Ridip HazarikaTHE STG QUIZ GROUP D.pptx   quiz by Ridip Hazarika
THE STG QUIZ GROUP D.pptx quiz by Ridip Hazarika
Ridip Hazarika
 
Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
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
 
dynastic art of the Pallava dynasty south India
dynastic art of the Pallava dynasty south Indiadynastic art of the Pallava dynasty south India
dynastic art of the Pallava dynasty south India
PrachiSontakke5
 
Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...
Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...
Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...
TechSoup
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
"Basics of Heterocyclic Compounds and Their Naming Rules"
"Basics of Heterocyclic Compounds and Their Naming Rules""Basics of Heterocyclic Compounds and Their Naming Rules"
"Basics of Heterocyclic Compounds and Their Naming Rules"
rupalinirmalbpharm
 
Sugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptxSugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptx
Dr. Renu Jangid
 
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
 
Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
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
 
Real GitHub Copilot Exam Dumps for Success
Real GitHub Copilot Exam Dumps for SuccessReal GitHub Copilot Exam Dumps for Success
Real GitHub Copilot Exam Dumps for 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
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
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
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
Debunking the Myths behind AI - v1, Carl Dalby
Debunking the Myths behind AI -  v1, Carl DalbyDebunking the Myths behind AI -  v1, Carl Dalby
Debunking the Myths behind AI - v1, Carl Dalby
Association for Project Management
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
THE STG QUIZ GROUP D.pptx quiz by Ridip Hazarika
THE STG QUIZ GROUP D.pptx   quiz by Ridip HazarikaTHE STG QUIZ GROUP D.pptx   quiz by Ridip Hazarika
THE STG QUIZ GROUP D.pptx quiz by Ridip Hazarika
Ridip Hazarika
 
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
 
dynastic art of the Pallava dynasty south India
dynastic art of the Pallava dynasty south Indiadynastic art of the Pallava dynasty south India
dynastic art of the Pallava dynasty south India
PrachiSontakke5
 
Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...
Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...
Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...
TechSoup
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
"Basics of Heterocyclic Compounds and Their Naming Rules"
"Basics of Heterocyclic Compounds and Their Naming Rules""Basics of Heterocyclic Compounds and Their Naming Rules"
"Basics of Heterocyclic Compounds and Their Naming Rules"
rupalinirmalbpharm
 
Sugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptxSugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptx
Dr. Renu Jangid
 
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
 
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
 
Real GitHub Copilot Exam Dumps for Success
Real GitHub Copilot Exam Dumps for SuccessReal GitHub Copilot Exam Dumps for Success
Real GitHub Copilot Exam Dumps for 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
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
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
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
Ad

HTML-CSS-QUARTER4 COMPUTER PROGRAMMING SSC

  • 2. LEARNING OBJECTIVES ◦understand what a CSS is, ◦identify the ways on how to apply CSS to HTML, and; ◦ understand what selectors, properties and values are.
  • 3. What is Cascading Style Sheet(CSS)? 1.HTML 2.JAVASCRIPT 3.CSS
  • 4. Defines the behavior Defines the appearance and style Defines the structure
  • 7. What is CSS? ◦Cascading Styles Sheets (CSS) is a way to style and present HTML. ◦Whereas the HTML is the meaning or content, the style sheet is the presentation of that document. ◦It is a styling language used to add style, layout, and visual presentation to web pages written in HTML or XML markup languages
  • 8. Cascading Style Sheet ◦Cascading Style Sheets, fondly referred to as CSS, is a simple design language intended to simplify the process of making web pages presentable. ◦CSS handles the look and feel part of a web page. ◦CSS is easy to learn and understand but it provides powerful control over the presentation of an HTML document. Most commonly, CSS is combined with the markup languages HTML or XHTML.
  • 9. Why Use CSS? ◦CSS is used to define styles for your web pages, including the design, layout and variations in display for different devices and screen sizes.
  • 10. Example of CSS coding
  • 12. Parts of Style Rule ◦Selector − A selector is an HTML tag at which a style will be applied. This could be any tag like <h1> or <table> etc. ◦Property − A property is a type of attribute of HTML tag. Put simply, all the HTML attributes are converted into CSS properties. They could be color, border etc. ◦ Value − Values are assigned to properties. For example, color property can have value either red or #F1F1F1 etc.
  • 13. EXAMPLE ◦ In this example all <p> elements will be center-aligned, with a red text color:
  • 14. Advantages of CSS ◦ CSS saves time − You can write CSS once and then reuse same sheet in multiple HTML pages. You can define a style for each HTML element and apply it to as many Web pages as you want. ◦ • Pages load faster − If you are using CSS, you do not need to write HTML tag attributes every time. Just write one CSS rule of a tag and apply it to all the occurrences of that tag. So less code means faster download time. ◦ • Easy maintenance − To make a global change, simply change the style, and all elements in all the web pages will be updated automatically.
  • 15. Advantages of CSS ◦ Superior styles to HTML − CSS has a much wider array of attributes than HTML, so you can give a far better look to your HTML page in comparison to HTML attributes. ◦ • Multiple device compatibility − Style sheets allow content to be optimized for more than one type of device. By using the same HTML document, different versions of a website can be presented for handheld devices such as PDAs and cell phones or for printing. ◦ • Global web standards − Now HTML attributes are being deprecated and it is being recommended to use CSS. So, it is a good idea to start using CSS in all the HTML pages to make them compatible to future browsers
  • 17. You can put CSS Style Rule Syntax as follows selector { property: value } Table { border: 1 px solid #C00 } •table is a selector that selects the HTML element(s) that you want to style. In this case, it's selecting all the <table> elements. •{} brackets are used to enclose the declaration block that contains the property-value pairs for the selected element(s). •border is the CSS property being applied to the selected element(s). It sets the border around the table. •1px is the value of the border-width property, which sets the width of the border to 1 pixel. •solid is the value of the border-style property, which sets the style of the border to a solid line. •#C00 is the value of the border-color property, which sets the color of the border to a shade of red.
  • 18. The Type Selectors ◦ This is the same selector we have seen above. Again, one more example to give a color to all level 1 headings. h1 { color: #36CFFF; } The selector h1 is targeting all the <h1> elements in the HTML document and applying the color property with a value of #36CFFF. This means that all <h1> elements will have their text color set to the specified value, which in this case is a shade of blue.
  • 19. The Universal Selectors ◦Rather than selecting elements of a specific type, the universal selector quite simply matches the name of any element type * { color: #000000; }
  • 20. The Descendant Selectors ◦ Suppose you want to apply a style rule to a particular element only when it lies inside a particular element. As given in the following example, style rule will apply to <em> element only when it lies inside <ul> tag. ◦ This is a CSS rule that sets the text color of all <em> elements that are descendants of <ul> elements to black (#000000). ◦ <ul> is the selector for an unordered list element, and <em> is the selector for an emphasized text element. The space between them indicates that <em> is a descendant element of <ul>. By setting the color property to #000000 (which is black), this CSS rule will change the text color of all <em> elements within a <ul> element to black.
  • 21. ◦<ul> ◦ <li><em>Item 1</em></li> ◦ <li><em>Item 2</em></li> ◦</ul>
  • 23. Applying CSS Create a webpage and apply the following below; 1. Black as background color. 2. Add Heading 1 and write the title of this module with white as text color. 3. For the content add paragraph use 20 pixel for text size and then write your reflection/generalization about this lesson. Minimum of 5 sentences. 4. Use Yellow for text color content. 5. Use Forte as style of the text
  • 25. Learning Objectives ◦understand the different CSS measurement units, use comments to explain codes and identify the different color values to specify a color.
  • 26. CSS units ◦Pixels -The most widely used measurement unit. A pixel does not actually correlate to a physical pixel on your screen, as that varies, a lot, by device (think high-DPI devices vs non-retina devices). ◦Percentages -let you specify values in percentages of that parent element’s corresponding property.
  • 27. Relative units ◦em is the value assigned to that element’s font-size, therefore its exact value changes between elements. ◦rem is similar to em, but instead of varying on the current element font size, it uses the root element (html) font size. ◦ex is like em, but inserted of measuring the width of m, it measures the height of the x letter. ◦ch is like ex but instead of measuring the height of x it measures the width of 0 (zero).
  • 28. CSS Comments ◦ Comments are used to explain the code and may help when you edit the source code at a later date. Comments are ignored by browsers. ◦ A CSS comment is placed inside the <style> element, and starts with /* and ends with */:
  • 30. CSS Colors ◦CSS uses color values to specify a color. Typically, these are used to set a color either for the foreground of an element or else for the background of the element.
  • 31. Following table lists all the possible formats
  • 32. 1. CSS Colors - Hex Codes ◦A hexadecimal is a 6-digit representation of a color. The first two digits(RR) represent a red value, the next two are a green value(GG), and the last are the blue value(BB). Colors are specified using predefined color names, or RGB, HEX, HSL, RGBA, HSLA values.
  • 33. Following are the examples to use Hexadecimal notation.
  • 34. 2. CSS Colors - Short Hex Codes
  • 35. 3. CSS Colors - RGB Values
  • 36. 4. CSS Color Names
  • 38. CSS Background Color You can set the background color for HTML elements <!DOCTYPE html> <html> <body> <h1 style="background-color:DodgerBlue;">Hello World</h1> <p style="background-color:Tomato;"> The quick brown fox jumps over the lazy dog. </p> </body> </html>
  • 40. CSS Border Color <!DOCTYPE html> <html> <body> <h1 style="border: 2px solid Tomato;">Hello World</h1> <h1 style="border: 2px solid DodgerBlue;">Hello World</h1> <h1 style="border: 2px solid Violet;">Hello World</h1> </body> </html>
  • 43. Hands on Activity: Create the CSS / HTML code for the given output.
  • 45. Learning Objectives At the end of the lesson ◦you will be able to learn the CSS background properties and apply how to set backgrounds of various HTML elements.
  • 46. The background color of an element is specified by the background- color property. The background color of a page is defined in the body selector: body { background-color: #338844; }
  • 47. Background Properties ◦ background-image property is used to set the background image of an element. ◦ background-color property is used to set the background color of an element. ◦ background-repeat property is used to control the repetition of an image in the background. ◦ background-position property is used to control the position of an image in the background. ◦ background-attachment property is used to control the scrolling of an image in the background. ◦ background-property is used as a shorthand to specify the number of other background properties.
  • 49. We can set the background image by calling local stored images as shown below. <html> <head> <style> body { background-image: url("html.png"); background-color: #cccccc; } </style> </head> <body> <h1>Hello World!</h1> </body> <html>
  • 50. Background Color background-color: color | transparent | inherit; For example: body { background-color: #338844; } Color values in CSS are most often specified in the following formats: a color name - like "red" a HEX value - like "#ff0000" an RGB value - like "rgb(255, 0, 0)"
  • 51. Opacity / Transparency Example div { background-color: green; opacity: 0.3; }
  • 52. Transparency using RGBA An RGBA color value is specified with: rgba(red, green, blue, alpha). The alpha parameter is a number between 0.0 (fully transparent) and 1.0 (fully opaque). Example div { background: rgba(0, 128, 0, 0.3) /* Green background with 30% opacity */ }
  • 53. Background Repeat The background-repeat property allows you to control how a background image is repeated or tiled in the background of an element. You can set a background image to repeat vertically (y-axis), horizontally (x-axis), in both directions, or in neither direction. Syntax: background-repeat: repeat | repeat-x | repeat-y | no-repeat | inherit;
  • 54. Values Repeat The image is repeated both horizontally and vertically. body { background-image: url("images.jpg"); background-repeat:repeat; } repeat-y: The image is repeated vertically only. body { background-image: url("images.jpg"); background-repeat:repeat-y; } repeat-x: The image is repeated horizontally only. body { background-image: url("images.jpg"); background-repeat:repeat-x; } no-repeat: the image is not repeated: only one copy of the image is drawn. body { background-image: url("images.jpg"); background-repeat:no-repeat; } inherit: Takes the same specified value as the property for the element's parent. body { background-image: url("images.jpg"); background-repeat:inherit; }
  • 55. Background Position ◦ The background-position property is used to control the position of the background image. If no background position has been specified, the background image is placed at the default top-left position of the element i.e. at (0,0), let's try out the following example: Syntax: background-position: value body { background-image: url("images/robot.png"); background-repeat: no-repeat; background-position: right top; }
  • 58. <html> <head> <style> body { background-image: url("lebron.jpg"); background-position:100px 200px; } </style> </head> <body> <p><b>LEBRON JAMES</b></p> </body> </html>
  • 59. Background-attachment ◦ The background-attachment property specifies whether a background image is fixed with regard to the viewport or scrolls along with the containing block. Syntax: background-attachment: scroll | fixed | local | inherit; Values scroll : If specified, the background image scrolls with the element. body { background-image: url("img.jpg"); background-attachment: scroll; }
  • 60. Background-attachment ◦ The background-attachment property specifies whether a background image is fixed with regard to the viewport or scrolls along with the containing block. Syntax: background-attachment: scroll | fixed | local | inherit; fixed : If specified, the background image does not scrolls with the element. body { background-image: url("bg.jpg"); background-attachment: fixed; }
  • 61. Background-attachment ◦ The background-attachment property specifies whether a background image is fixed with regard to the viewport or scrolls along with the containing block. Syntax: background-attachment: scroll | fixed | local | inherit; inherit: Takes the same specified value as the property for the element's parent. body { background-image: url("bg.jpg"); background-attachment: inherit; }
  • 62. <!DOCTYPE html> <html> <head> <style> body { background-image: url('lebron.jpg'); background-repeat: no-repeat; background-attachment: fixed; } </style> </head> <body> <p>LEBRON JAMES</p> <p> LEBRON JAMES </p> <p> LEBRON JAMES </p> <p> LEBRON JAMES </p> <p> LEBRON JAMES </p> <p> LEBRON JAMES </p> <p> LEBRON JAMES </p> <p> LEBRON JAMES </p> </body> </html>
  • 64. Create the CSS / HTML Codes using background properties for the given output. Write them in your answer sheet. Output: Hint: *Background color is blue *p color is #FFFFFF
  • 66. 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.
  • 67. Difference Between Serif and Sans-serif Fonts
  • 69. Font properties of an element: • The font-family property is used to change the face of a font. • The font-style property is used to make a font italic or oblique. • The font-variant property is used to create a small-caps effect. • The font-weight property is used to increase or decrease how bold or light a font appears • The font-size property is used to increase or decrease the size of a font. • The font property is used as shorthand to specify a number of other font properties.
  • 70. Set the Font Family ◦ <html> ◦ <head> ◦ </head> ◦ <body> ◦ <p style = "font-family:georgia,garamond,serif;"> This text is rendered in either georgia, garamond, or the default serif font depending on which font you have at your system. </p> ◦ </body> ◦ </html>
  • 71. Set the Font Style ◦ Following is the example, which demonstrates how to set the font style of an element. Possible values are normal, italic and oblique. <html> <head> </head> <body> <p style = "font-style:italic;"> This text will be rendered in italic style </p> </body> </html>
  • 72. Set the Font Variant ◦ The following example demonstrates how to set the font variant of an element. Possible values are normal and small- caps. <html> <head> </head> <body> <p style = "font-variant:small-caps;"> This text will be rendered as small caps </p> </body> </html>
  • 73. Set the Font Weight ◦ The font-weight property provides the functionality to specify how bold a font is. Possible values could be normal, bold, bolder, lighter, 100, 200, 300, 400, 500, 600, 700, 800, 900. <html> <head> </head> <body> <p style = "font-weight:bold;"> This font is bold. </p> <p style = "font-weight:bolder;"> This font is bolder. </p> <p style = "font-weight:500;"> This font is 500 weight. </p> </body> </html>
  • 74. Set the Font Size ◦ The font- size property is used to control the size of fonts. Possible values could be xx-small, x-small, small, medium, large, x-large, xx-large, smaller, larger, size in pixels or in %. <html> <head> </head> <body> <p style = "font-size:20px;"> This font size is 20 pixels </p> <p style = "font-size:small;"> This font size is small </p> <p style = "font-size:large;"> This font size is large </p> </body> </html>
  • 75. Set the Font Size Adjust ◦ This property enables you to adjust the x-height to make fonts more legible. Possible value could be any number. <html> <head> </head> <body> <p style = "font-size-adjust:0.61;"> This text is using a font-size-adjust value. </p> </body> </html>
  • 76. Set the Font Stretch ◦ This property relies on the user's computer to have an expanded or condensed version of the font being used. Possible values could be normal, wider, narrower, ultra-condensed, extra-condensed, condensed, semi- condensed, semi-expanded, expanded, extra-expanded, ultra-expanded. <html> <head> </head> <body> <p style = "font-stretch:ultra-expanded;"> If this doesn't appear to work, it is likely that your computer doesn't have a <br>condensed or expanded version of the font being used. </p> </body> </html>
  • 77. Shorthand Property ◦ <html> ◦ <head> ◦ </head> ◦ <body> ◦ <p style = "font:italic small-caps bold 15px georgia;"> Applying all the properties on the text at once. ◦ </p> ◦ </body> </html>
  • 78. • The font-family property is used to change the face of a font. • The font-style property is used to make a font italic or oblique. • The font-variant property is used to create a small-caps effect. • The font-weight property is used to increase or decrease how bold or light a font appears • The font-size property is used to increase or decrease the size of a font. • The font property is used as shorthand to specify a number of other font properties.
  • 81. Learning Objectives: ◦At the end of the lesson you will be able to understand how to manipulate text using CSS properties.
  • 82. You can set following text properties of an element:
  • 83. Set the Text Color <html> <head> </head> <body> <p style = "color:red;"> This text will be written in red. </p> </body> </html>
  • 84. Set the Text Direction ◦ The following example demonstrates how to set the direction of a text. Possible values are ltr or rtl. <html> <head> </head> <body> <p style = "direction:rtl;"> This text will be rendered from right to left </p> </body> </html>
  • 85. Set the Space between Characters ◦ <html> ◦ <head> ◦ </head> ◦ <body> ◦ <p style = "letter-spacing:5px;"> This text is having space between letters. </p> </body ◦ </html>
  • 86. Set the Space between Words ◦ <html> ◦ <head> ◦ </head> ◦ <body> ◦ <p style = "word-spacing:5px;"> This text is having space between words. ◦ </p> ◦ </body> ◦ </html>
  • 87. Set the Text Indent ◦ <html> ◦ <head> ◦ </head> ◦ <body> ◦ <p style = "text-indent:1cm;"> This text will have first line indented by 1cm and this line will remain at its actual position this is done by CSS text-indent property. </p> </body> ◦ </html>
  • 88. Set the Text Alignment
  • 90. Set the Text Cases
  • 91. Set the Text Shadow
  • 92. Performance Task No.1 ◦Design a personal blog or website with a color scheme that reflects your personality or interests using css Choose a color scheme that reflects your personality or interests. For example, if you are a nature lover, you may want to use shades of green and brown. If you are a music enthusiast, you may want to use bold and vibrant colors like red, yellow, and blue. For the additional content add paragraph use 20 pixel for text size and then write your reflection/generalization about this lesson. Minimum of 5 sentences.
  • 99. Learning Objectives ◦At the end of the lesson, you will be able to learn the CSS border properties that allow you to define the border area of an element's box.
  • 100. BORDER PROPERTIES • The border-color specifies the color of a border. • The border-style specifies whether a border should be solid, dashed line, double line, or one of the other possible values. • The border-width specifies the width of a border.
  • 101. The border-color Property ◦ The border-color property allows you to change the color of the border surrounding an element. You can individually change the color of the bottom, left, top and right sides of an element's border using the properties. • border-bottom-color changes the color of bottom border. • border-top-color changes the color of top border. • border-left-color changes the color of left border. • border-right-color changes the color of right border.
  • 103. The border-style Property • none − No border. (Equivalent of border-width:0;) • solid − Border is a single solid line. • dotted − Border is a series of dots. • dashed − Border is a series of short lines. • double − Border is two solid lines. • groove − Border looks as though it is carved into the page. • ridge − Border looks the opposite of groove. • inset − Border makes the box look like it is embedded in the page. • outset − Border makes the box look like it is coming out of the canvas. • hidden − Same as none, except in terms of border-conflict resolution for table elements
  • 104. • border-bottom-style changes the style of bottom border. • border-top-style changes the style of top border. • border-left-style changes the style of left border. • border-right-style changes the style of right border.
  • 109. The image has 9 different style. This is the following
  • 115. The Image Hoverlay ◦ The overlay-image class container encapsulates all the necessary structure: ◦ -original image, ◦ -original overlay text block, ◦ -image/text overlay block ◦ With a builder, it can be replaced by an existing container block (for example it could be the Divi "code" module, to which we simply add the overlay-image class). displayed on mouse hover.
  • 118. The following example shows all flip images properties:
  • 119. The Responsive Image ◦ A responsive, mobile friendly image gallery. You can use it as is or you can modify it how you want. It doesn't have to be full width either. Give the gallery element a width and it will fit to that making it easy to be right aligned or centered within a page.
  • 120. The Image Modal ◦ A modal is a dialog box/popup window that is displayed on top of the current page. Example
  • 122. TASK: CREATE A SCHOOL WEBSITE USING HTML AND CSS THAT INCLUDES THE FOLLOWING PAGES AND FEATURES:
  • 123. Homepage •Design an engaging homepage that represents your school. •Include a header with the school logo and a navigation menu with links to other pages. •Add a hero section with a captivating image or slideshow and a brief welcome message.
  • 124. About Us • Create a page that provides information about your school. • Include the school's history, mission, vision, and core values. • Add relevant images or videos to enhance the content.
  • 125. Academics: • Design a page that highlights the academic programs and courses offered at your school. • Include a description of each program, its benefits, and any unique features. • Present the information in an organized and visually appealing manner.
  • 126. Faculty and Staff: • Create a page that introduces the faculty and staff members at your school. • Include their names, roles, qualifications, and a brief bio. • Optionally, add their profile pictures for a personal touch.
  • 127. Student Life: • Design a page that showcases the vibrant student life at your school. • Include information about clubs, sports teams, extracurricular activities, and events. • Add images, videos, or testimonials to highlight student achievements and experiences.
  • 128. Admissions: • Create a page with all the necessary information for prospective students and parents. • Include admission requirements, procedures, deadlines, and contact details. • Optionally, provide a downloadable application form.
  • 129. Contact Us: • Design a page that includes contact information for your school. • Include the school's address, phone number, email, and social media links. • Optionally, include a contact form for visitors to send messages or inquiries.
  • 130. Styling and Visual Design • Use CSS to style your website and make it visually appealing. • Choose appropriate fonts, colors, and layouts that align with your school's brand. • Ensure consistency in design elements such as headers, buttons, and forms.
  • 132. Criteria Points Design and Layout Effective use of color, typography, and layout Consistent design elements throughout the website Attention to detail in design and aesthetics 25 Points Content and Structure Clear and concise information on each page Well-organized structure and navigation Relevant and engaging content for each section 25 Points CSS Styling Effective use of CSS to style the website Consistent and appropriate use of fonts, colors, and layout CSS code is clean and well-structured 25 Points Interactivity Implementation of interactive elements such as forms, buttons, or animations Interactive elements are functional and enhance the user experience 10 Points Timeliness Completion of the project within the specified deadline 5 Points (DEADLINE: APRIL 30, 2024) Work Ethics Active participation and contribution to the group project accountability for assigned tasks and responsibilities 10 Points
  • 134. Learning Objective: ◦you will be able to learn the how to use link using CSS
  • 135. Properties of Links ◦The link signifies unvisited hyperlinks. ◦ The :visited signifies visited hyperlinks. ◦The :hover signifies an element that currently has the user's mouse pointer hovering over it ◦The :active signifies an element on which the user is currently clicking.
  • 136. You can set following font properties of an element: ◦ The font-family property is used to change the face of a font. ◦ The font-style property is used to make a font italic or oblique. ◦ The font-variant property is used to create a small-caps effect. ◦ The font-weight property is used to increase or decrease how bold or light a font appears. ◦ The font-size property is used to increase or decrease the size of a font. ◦ The font property is used as shorthand to specify a number of other font properties.

Editor's Notes

  • #3: What is CSS and how does it work? A modern day Website is made of 3 files. An this files are called HTML
  • #4: HTML-defines the structure of a website, Javascript defines the behavior of a website and CSS defines the overall appearance and style of a website
  • #5: And CSS refers to Cascading Style Sheet-
  • #6: It helps determine things like fonts, colors, positioning of certain elements and even a little bit of animation
  • #7: . CSS provides web developers with a way to separate the content of a web page from its presentation, making it easier to control the layout, typography, colors, and other visual aspects of the web page. By using CSS, designers can create attractive and visually appealing websites that are easy to maintain and update.
  • #8: Using CSS, you can control the color of the text, the style of fonts, the spacing between paragraphs, how columns are sized and laid out, what background images or colors are used, layout designs, variations in display for different devices and screen sizes as well as a variety of other effects.
  • #10: In this example, we have a simple HTML page with a title, a link to an external CSS file, and two elements: an <h1> heading and a <p> paragraph. The CSS file defines styles for these elements, including the font family and background color for the body, the color for the h1 heading, and the font size, line height, and color for the p paragraph.
  • #11: A CSS comprises of style rules that are interpreted by the browser and then applied to the corresponding elements in your document. A style rule is made of three parts:
  • #12: A CSS comprises of style rules that are interpreted by the browser and then applied to the corresponding elements in your document. A style rule is made of three parts:
  • #13: Example Explained p is a selector in CSS (it points to the HTML element you want to style: <p>). color is a property, and red is the property value text-align is a property, and center is the property value
  • #17: Here table is a selector and border is a property and given value 1px solid #C00 is the value of that property. You can define selectors in various simple ways based on your comfort. Let me put these selectors one by one.
  • #18: In CSS, a type select Type selectors are one of the simplest and most commonly used selector types in CSS, and they allow you to easily apply styles to all instances of a particular HTML element on your page.or is used to apply styles to an HTML element based on its tag name. The syntax for a type selector is simply the name of the tag that you want to select.
  • #19: This rule renders the content of every element in our document in black. This means that every element, such as paragraphs, headings, images, and other HTML tags, will be affected by this style rule. The Universal Selector is often used to apply a common style to all elements on a web page, as it saves time from having to individually specify the style of every single element.
  • #21: This CSS rule will change the color of "Item 1" and "Item 2" to black.
  • #22: 1. You can define style rules based on the class attribute of the elements. All the elements having that class will be formatted according to the defined rule. 2. You can make it a bit more particular. For example 3. You can apply more than one class selectors to given element. Consider the following example
  • #23: You can apply more than one class selectors to given element. Consider the following example
  • #25: Every property used in CSS has a value type defining the set of values that are allowed for that property. Taking a look at any property page on your CSS codes will help you understand the values associated with a value type that are valid for any particular property. In this module we will take a look at some of the most frequently used value types, and their most common values and units.
  • #26: One of the things you will use every day in CSS are units. They are used to set lengths, paddings, margins, align elements and so on. Things like px, em, rem, or percentages. They are everywhere. 1. DPI stands for Dots per Inch, referring to the number of ink droplets a printer will produce per inch while printing an image. The more dots of ink per inch the picture has, the more detail you will see when printed.
  • #27: Em- It does not change depending on the font used, just on the font size. In typography this measures the width of the m letter. rem -You set that font size once, and rem will be a consistent measure across all the page. Ex- It can change depending on the font used, and on the font size.
  • #28: CSS comments are used to add notes or explanations to a CSS code. Comments in CSS are not interpreted by the browser and do not affect the styling of the page. They are intended for developers to add notes, explanations, or reminders about the code they have written.
  • #29: In the following example, we use a combination of HTML and CSS comments:
  • #30: They can also be used to affect the color of borders and other decorative effects.
  • #31: You can specify your color values in various formats
  • #33: A hexadecimal value can be taken from any graphics. Each hexadecimal code will be preceded by a pound or hash sign '#'. software like Adobe Photoshop, Jasc Paintshop Pro, or even using Advanced Paint Brush.
  • #34: This is a shorter form of the six-digit notation. In this format, each digit is replicated to arrive at an equivalent six-digit value. For example: #6A7 becomes #66AA77. A hexadecimal value can be taken from any graphics software like Adobe Photoshop, Jasc Paintshop Pro, or even using Advanced Paint Brush
  • #35: This color value is specified using the rgb( ) property. This property takes three values, one each for red, green, and blue. The value can be an integer between 0 and 255 or a percentage.
  • #36: In CSS, a color can be specified by using a predefined color name:
  • #39: You can set the color of text:
  • #40: CSS Border Color You can set the color of borders
  • #45: Background plays an important role in the visual presentation of a web page. CSS provide several properties for styling the background of an element, including coloring the background, placing images in the background and managing their positioning, etc. The background properties are background-color, background-image, background-repeat, background-attachment and background-position.
  • #47: 1. background-color: This property is used to set the background color of an element. It takes any valid CSS color value as its parameter. background-image: This property is used to set an image as the background of an element. It takes the URL of the image as its parameter. background-repeat: This property is used to specify whether the background image should be repeated or not. It can take values like repeat, no-repeat, repeat-x, repeat-y, etc. background-position: This property is used to specify the position of the background image. It takes two values, one for horizontal position and one for vertical position. For example, background-position: left top; will place the image at the top left corner of the element. background-size: This property is used to specify the size of the background image. It can take values like auto, cover, contain, or specific pixel values. background-attachment: This property is used to specify whether the background image should be fixed or scroll with the rest of the page. It can take values like fixed, scroll, or local. These properties can be combined together to create various background effects for an HTML element. Regenerate response
  • #48: The This value is used to inherit the background-image property from the parent element. This is useful when you want a child element to have the same background image as its parent. background-image property specifies an image to use as the background of an element. By default, the image is repeated so it covers the entire element.
  • #52: If you do not want to apply opacity to child elements, like in our example above, use RGBA color values. The following example sets the opacity for the background color and not the text
  • #54: Let's take a look at the following illustration to understand how this property actually works. By default background-repeat property will have repeat value.
  • #56: Note: If two values are specified for the background-position property, the first value represents the horizontal position, and the second represents the vertical position. If only one value is specified, the second value is assumed to be center. Besides keywords, you can also use percentage or length values, such as px or em for this property.
  • #57: It will produce the following result The following example demonstrates how to set the background image position 100 pixels away from the left side.
  • #58: The following example demonstrates how to set the background image position 100 pixels away from the left side and 200 pixels down from the top.
  • #65: 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.
  • #67: Note: On computer screens, sans-serif fonts are considered easier to read than serif fonts.
  • #68: If the font name is more than one word, it must be in quotation marks, like: "Times New Roman".
  • #69: I
  • #71: Following is the example, which demonstrates how to set the font family of an element. Possible value could be any font family name.
  • #74: The following example demonstrates how to set the font weight of an element.
  • #75: The following example demonstrates how to set the font size of an element.
  • #76: The following example demonstrates how to set the font size adjust of an element.
  • #77: The following example demonstrates how to set the font stretch of an element.
  • #78: You can use the font property to set all the font properties at once. For example: applying all properties at once.
  • #82: CSS provides several properties that allows you to define various text styles such as color, alignment, spacing, decoration, transformation, etc. very easily and effectively. The commonly used text properties are: text-align, text-decoration, text-transform, text-indent, line- height, letter-spacing, word-spacing, and more. These properties give you precise control over the visual appearance of the characters, words, spaces, and so on.
  • #84: The following example demonstrates how to set the text color. Possible value could be any color name in any valid format.
  • #85: The following example demonstrates how to set the direction of a text. Possible values are ltr or rtl.
  • #86: The following example demonstrates how to set the space between characters. Possible values are normal or a number specifying space.
  • #87: The following example demonstrates how to set the space between words. Possible values are normal or a number specifying space.
  • #88: The following example demonstrates how to indent the first line of a paragraph. Possible values are % or a number specifying indent space.
  • #89: The following example demonstrates how to align a text. Possible values are left, right, center, justify.
  • #90: The following example demonstrates how to decorate a text. Possible values are none, underline, overline, line-through, blink. The following example demonstrates how to decorate a text. Possible values are none, underline, overline, line-through, blink.
  • #91: The following example demonstrates how to set the cases for a text. Possible values are none, capitalize, uppercase, lowercase.
  • #92: The following example demonstrates how to set the shadow around a text. This may not be supported by all the browsers.
  • #100: Borders appear directly between the margin and padding of an element. The border can either be a predefined style like, solid line, dotted line, double line, etc. or an image.
  • #101: The border properties allow you to specify how the border of the box representing an element should look. There are three properties of a border you can change.
  • #102: The following example shows the effect of all these properties:
  • #103: The following example shows the effect of all these properties:
  • #104: The border-style Property The border-style property allows you to select one of the following styles of border. You can individually change the style of the bottom, left, top, and right borders of an
  • #109: you will be able to learn the how to style image using CSS. Images comes in different format. Webpage accepted file format are .bmp, .gif, .svg,
  • #111: The CSS property border-radius adds rounded corners on images. You can round all of the image's corners or just select corners, vary the radius on different corners or display an image in the shape of an oval or a circle. The following example shows the effect of all rounded images properties:
  • #112: The basic idea of the thumbnail is that you can offer a page full of small images, and each one is linked to the full version of the image, giving your readers the option to preview any images they think they'd like to see in their full splendour, thus reducing hugely the download time of a page. The following example shows all thumbnails image styles:
  • #113: Making an image fluid, or responsive, is actually pretty simple. When you upload an image to your website, it has a default width and height. You can change them both with CSS. To make an image responsive, you need to give a new value to its width property. Then the height of the image will adjust itself automatically. The important thing to know is that you should always use relative units for the width property like percentage, rather than absolute ones like pixels. The following example shows all these responsive images properties:
  • #114: Transparency using RGBA In addition to RGB, you can use an RGB color value with an alpha channel (RGBA) - which specifies the opacity for a color. An RGBA color value is specified with: rgba(red, green, blue, alpha). The alpha parameter is a number between 0.0 (fully transparent) and 1.0 . The following example shows all these transparent image properties:
  • #115: The Image Filter CSS Filters are a powerful tool that authors can use to achieve varying visual effects (sort of like Photoshop filters for the browser). The CSS filter property provides access to effects like blur or color shifting on an element’s rendering before the element is displayed. Filters are commonly used to adjust the rendering of an image, a background, or a border The following example shows all these image filter properties:
  • #116: On a page written without a page builder (HTML page or simple WordPress theme), for instance like this article, it is essential to define it in order to properly include original content and overlay within the page.
  • #117: The following example shows all image hoverlay properties:
  • #118: The CSS flipping techniques only alter the presentation of an image, not the actual pixel data. We can flip the pixel data using the canvas element. This might be useful if for example we want to flip an image before it’s uploaded to a server
  • #120: The following example shows all responsive image properties:
  • #134: This lesson teaches you how to set different properties of a hyper link using CSS. You can set following properties of a hyper link.
  • #136: We will revisit the same properties when we discuss Pseudo-Classes of CSS.