HTML and CSS Reference
In-Depth Information
Indent
Right
Margin
Left
Margin
Figure 14.11 HTML and CSS—An embedded style sheet.
14.5.2 The Inline Style and the <style> Attribute
Inline style sheets are also embedded within an HTML document, but are assigned as an
attribute of the <style> tag in the body of the document and are useful for overriding an
already existing style for a particular element in a linked style sheet. On the negative side,
they have to be redefined for any element that requires that style, element by element. For
example, if the h1 element has been defined to be blue and you want to temporarily change
it to red, you can define the style as an attribute of the style tag for that element:
<h1 style= "color: red; "> This is red text</h1>
EXAMPLE 14.10
<html>
<head><title>Inline Style Sheets</title>
1
<style type="text/css">
2
body { background-color: orange;
color:darkblue; /* color of text */ }
Continues
 
 
Search WWH ::




Custom Search