Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 21

Module 7

Using Internal
CSS
ROSE ANNE G. COCHANCO, MSIT
Agenda

Part 1:

Internal CSS

Part 4:

<div> </div> Element

Part 2:

CSS Selectors

Part 5:

<span></span> Element

Part 3:

Grouping Selectors
INTERNAL CSS
Internal CSS may be used if one single page has a
unique style.
Internal CSS are defined within the <style> and
</style> tags, inside the <head> section of an HTML
page.
INTERNAL CSS
A CSS ruleset should be followed when using Internal
CSS.
A CSS ruleset consists of a selector and a declaration
block.

The selector points to the HTML element you want to


style.
The declaration block contains one or more declarations
separated by semicolons.
A CSS declaration always ends with a semicolon, and
declaration blocks are surrounded by curly braces.
INTERNAL STYLE
CSS Selectors
CSS SELECTORS
CSS Selectors allow us to locate HTML elements by
specifying their element name, id, class or attribute.
ELEMENT SELECTORS
The element selector selects elements based on the
element name.
ELEMENT SELECTORS
ID SELECTOR
The id selector uses the id attribute of an HTML element
to select a specific element.
The id of an element should be unique within a page, so
the id selector is used to select one unique element.
To select an element with specific id, write a hash
character (#), followed by the id of the element.
An id name cannot start with a number.
ID SELECTOR
CLASS SELECTOR
The class selector selects elements with a specific class
attribute.
To select elements with a specific class, write a period (.)
character, followed by the name of the class.
A class name cannot start with a number.
HTML elements can also refer to more than one class
CLASS SELECTOR
GROUPING SELECTORS
Grouping selectors will be ideal if you have elements with
the same style definitions.
Grouping selectors will help minimize the length of the
code.
To group selectors, separate each selector with a
comma.
GROUPING SELECTORS
HTML NonSemantic
Tags
HTML <div> </div> ELEMENT
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.
By default, browsers always place a line break before
and after the <div> element.
HTML <span> </span> ELEMENT
The <span> tag is an inline container used to mark up a
part of a text, or a part of a document.
The <span> tag is easily styled by CSS or manipulated
with JavaScript using the class or id attribute.
The <span> tag is much like the <div> element, but
<div> is a block-level element and <span> is an inline
element.
<div></div> and <span></span> ELEMENT
Thank you!

You might also like