0% found this document useful (0 votes)
55 views

HTML Styles

The style attribute can be used to set CSS properties for HTML elements. Some common properties that can be set include: - background-color to define the background color of an element. - color to define the text color of an element. - Providing contrast between text and background colors is important for readability.

Uploaded by

Kawaii Glamour
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

HTML Styles

The style attribute can be used to set CSS properties for HTML elements. Some common properties that can be set include: - background-color to define the background color of an element. - color to define the text color of an element. - Providing contrast between text and background colors is important for readability.

Uploaded by

Kawaii Glamour
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

HTML TEXT FORMATTING

ELEMENTS
HTML TEXT FORMATTING
ELEMENTS
Element Description
<b></b> Defines bold text
<em></em> Defines emphasized text
<i></i> Defines italic text
<small></small> Defines smaller text
<strong></strong> Defines important text
HTML TEXT FORMATTING
ELEMENTS
Element Description
<sub></sub> Defines subscripted text
<sup></sup> Defines superscripted text
<ins></ins> Defines inserted text
<del></del> Defines deleted text
<mark></mark> Defines marked/highlighted text
HTML COMPUTER CODE
ELEMENTS
HTML COMPUTER CODE
ELEMENTS
Elements Description
<code></code> Defines programming code
<kbd></kbd> Defines keyboard input
<samp></samp> Defines computer output
<var></var> Defines a variable
<pre></pre> Defines preformatted text
HTML QUOTATION AND
CITATION ELEMENTS
HTML <Q> FOR SHORT
QUOTATIONS
The HTML <q> element defines a short quotation.
Browsers usually insert quotation marks around the <q>
element.
<p>WWF's goal is to: <q>Build a future where
people live in harmony with nature.</q></p>
HTML <BLOCKQUOTE> FOR
QUOTATIONS
The HTML <blockquote> element defines a section that
is quoted from another source.
Browsers usually indent <blockquote> elements.
<p>Here is a quote from WWF's website:</p>
<blockquote
cite="http://www.worldwildlife.org/who/inde
x.html">
For 50 years, WWF has been protecting the
future of nature.</blockquote>
HTML <ABBR> FOR
ABBREVIATIONS
The HTML <abbr> element defines an abbreviation or an
acronym.
Marking abbreviations can give useful information to
browsers, translation systems and search-engines.
<p>The <abbr title="World Health
Organization">WHO</abbr> was founded in
1948.</p>
HTML <ADDRESS> FOR CONTACT
INFORMATION
The HTML <address> element defines contact
information (author/owner) of a document or an article.
The <address> element is usually displayed in italic.
Most browsers will add a line break before and after the
element.
HTML <ADDRESS> FOR CONTACT
INFORMATION
Example
<address>
Written by John Doe.<br>
Visit us at:<br>
Example.com<br>
Box 564, Disneyland<br>
USA
</address>
HTML <CITE> FOR WORK TITLE
The HTML <cite> element defines the title of a work.
Browsers usually display <cite> elements in italic.
<p><cite>The Scream</cite> by Edvard Munch.
Painted in 1893.</p>
HTML <BDO> FOR BI-
DIRECTIONAL OVERRIDE
The HTML <bdo> element defines bi-directional
override.
The <bdo> element is used to override the current text
direction:
<bdo dir="rtl">This text will be written
from right to left</bdo>
HTML <BDO> FOR BI-
DIRECTIONAL OVERRIDE
The HTML <bdo> element defines bi-directional
override.
The <bdo> element is used to override the current text
direction:
<bdo dir="rtl">This text will be written
from right to left</bdo>
Output:
➔tfel ot thgir morf nettirw eb lliw txet sihT
SUMMARY
Tag Description
<abbr> Defines an abbreviation or acronym
<address> Defines contact information for the
author/owner of a document
<bdo> Defines the text direction
<blockquote> Defines a section that is quoted from
another source
<cite> Defines the title of a work
<q> Defines a short inline quotation
HTML STYLES
Prepared By: Mary Grace G. Ventura
THE HTML STYLE ATTRIBUTE
Setting the style of an HTML element, can be done with
the style attribute.
Syntax:
➔<tagname style="property:value;">
➔The property is a CSS property.
➔The value is a CSS Value
HTML BACKGROUND COLOR
The background-color property defines the background
color for an HTML element.
This example sets the background color for a page to
powderblue:
<body style="background-color:powderblue;">
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
HTML TEXT COLOR
The main tip to keep in mind for color with regard to web-
based text is simple: always provide plenty of contrast
so that your text remains readable.
The color property defines the text color for an HTML
element:
Example:
<h1 style="color:blue;">This is a heading</h1>
<p style="color:red;">This is a paragraph.</p>

You might also like