![]() |
Inline Styles |
|
|
|
This lesson: Overview |
Syntax | Example |
Exercise
Other lessons: Style Syntax | Order of
Precedence | Style Properties |
Other Style Information
Intro. to Styles | Inline Styles | Embedded Style Sheets |
Linked Style Sheets
<TAG STYLE="property: value; property: value"></TAG>
<P STYLE="font-size: 10pt; color: green">Example of an Inline Style</P>
<body style="font-family: JunkFont1, Arial, sans-serif">
<h1 style="font-size: 20pt; font-weight: bold; color: #FF0000; text-align:
center">This web page uses inline styles.</h1>
<h2 style="background-color: #CCCCFF; text-align: center">Generic Font
Families</h2>
<blockquote style="color: green">Serif...Fixedsys</blockquote>
<address style="font-size: 10pt; text-align: center">This
page...2002</address>
- You may use a text or web page editor.
- If you use FrontPage, use the HTML view to type the code that appears boldfaced (and in red).
- Or, if you wish, open the file, exercise-inline-text-1.txt. Copy the needed text and paste it into the appropriate areas.
<html>
<head>
<title>Exercise: Using Inline Styles</title>
</head>
<body style="font-size: 18pt">
<h1 style="font-family: Impact, Cooper Black,
sans-serif; text-align: center; background-color: yellow">Exercise: Using
Inline Styles</h1>
<p>The inline style formats the body text as 18 points. It also formats a heading 1 paragraph so that it uses
the Impact or Cooper Black Font. If those fonts are not available, then a
sans-serif font is used. Heading 1 is also formatted with a center text
alignment and a yellow background.</p>
</body>
</html>
Exercise: Using Inline Styles
An inline style centers the first paragraph. Another inline style creates
a first line indent for the second paragraph as well as double-spacing the
paragraph.
Center Paragraph
Indent First Line and Double-space Paragraph
![]()
Penn State Behrend Home | Computer Center Home
This page is maintained by Carolyn Dudas
Updated May 21, 2002