Week 4 and 5 - HTML STYLES and CSS
Week 4 and 5 - HTML STYLES and CSS
WBDV111
COMPUTER STUDIES
OUR LADY OF FATIMA UNIVERSITY – Q.C
<style>: The Style
Information
element
Deprecated
• <acronym> • <dir> • <menuitem> • <rtc>
• <applet> • <font> • <nobr> • <shadow>
• <bgsound> • <frame> • <noembed> • <spacer>
• <big> • <frameset> • <noframes> • <strike>
• <blink> • <image> • <param> • <tt>
• <center> • <keygen> • <plaintext> • <xmp>
• <content> • <marquee> • <rb>
Introducing CSS
To apply styling to
an element, simply use
the style attribute.
Class selectors are indicated by a period (.) followed by the class name.
Comments is use as reminders of why you chose those styles or assigned such values.
A CSS comment starts with /* and ends with */. Comments are ignored by the browser.
Formatting and
Styling Text
Fonts
The font-family property allows you to change the fonts in HTML.
Color
repeat-x repeat-y
no-repeat
Background Position
✓ top left
✓ center left
✓ bottom left
✓ top right
✓ center right
✓ bottom right
✓ top center
✓ center center
✓ bottom center
Background Size
You can set the width and height of the image
based on pixel values.
This is how it should look in the This is how it should look in the
browser: browser:
Using cover ensures that the background covers
the whole element.
Border-width property determines how thick the element’s border is in px, pt, em,
and cm values. You can also use medium, thin, and thick.
With style
BEFORE AFTER
Padding can take on any length value. Length values in CSS can be absolute
(px, pt, in, and cm) or relative (em and %).
Margins
BEFORE
AFTER
With flex
Flex-wrap
With flex-wrap
Try resizing your browser window.
With flex
THANK YOU FOR
LISTENING!
Don't hesitate to ask any questions!