2. SAVE AS--"myfirstcsspage_html"
3. Save it in a new folder called: "Last Name First CSS Layout"
4. Copy the code:
<!DOCTYPE html>
<html>
<head>
<title>Types of CSS</title>
</head>
<body>
<h1>Types of CSS</h1>
<p>This paragraph will contain an INLINE STYLE of CSS </p>
</body>
</html>
INLINE STYLES
--can only be placed directly in the <body> element.
--they are expressed as attributes within a tag.
Here's an example:
<p style="color:red; text-align: center;"> some content </p>
p is the HTML element
style is the attribute of the HTML element style has the properties color and text-align color has the value red text-align has the value center
EMBEDDED/INTERNAL and EXTERNAL STYLES
--it includes the HTML element as the selector and the
declaration (property and value).
--3 parts- A SELECTOR, a PROPERTY and a VALUE
<html>
<head>
<title>Types of CSS</title>
</head>
<body>
<h1>Types of CSS</h1>
<p>This paragraph will contain an INLINE STYLE of CSS </p>
</body>
</html>
INLINE STYLES
--can only be placed directly in the <body> element.
--they are expressed as attributes within a tag.
<element attribute="property: value; property: value;">
Here's an example:
<p style="color:red; text-align: center;"> some content </p>
p is the HTML element
style is the attribute of the HTML element style has the properties color and text-align color has the value red text-align has the value center
EMBEDDED/INTERNAL and EXTERNAL STYLES
--it includes the HTML element as the selector and the
declaration (property and value).
--3 parts- A SELECTOR, a PROPERTY and a VALUE
The Syntax:
selector {property: value; property: value;}How to write it:
- enter the selector you want to define characteristics for, such as h1
- use the { bracket to start the rule
- use } to end the rule
- inside the brackets, list the characteristics you want the tag to use
- list the property
- use the colon (:) to separate the property from its value
- list the value
- use a semi-colon (;) to separate each characteristic.
No comments:
Post a Comment