(Thinking Inside the Box)
Such as :
<h1>-,<h6>, <p> and <div> elements<b>, <i>,<img>, <em> and <span>Example Styles:
- Boxes:
- Width and height
- Borders (color, width, and style)
- Background color and images
- Position in the browser window.
- Text :
- Typeface
- Size
- Color
- Italics, bold, uppercase,
- lowercase, small-caps
- Specific :
- Lists
- Tabels
- Forms
CSS associates style rules with HTML elements :
CSS properties affected of how the elements are displayed
Examples: HTML file:
<!DOCTYPE html>
<html>
<head>
<title>Introducing CSS</title>
<link href="css/example.css" type="text/css"
` rel=”stylesheet” />`
</head>
<body>
` <h1>From Garden to Plate</h1>`
<p>A
<i>potager</i>
is a French term for an
ornamental vegetable or kitchen garden ... </p>
<h2>What to Plant</h2>
<p>Plants are chosen as much for their functionality
as for their color and form ... </p>
</body>
</html>
CSS file: body {
font-family: Arial, Verdana, sans-serif; } h1, h2 {
color: #ee3e80; } p {
color: #665544; }
Inline : by applying the style directly to the element in tag .
Internal CSS: include CSS rules within an HTML page by placing them inside a <style> element, which usually sits inside the <head> element of the page.
External CSS : using the <link> element in the HTML document to tell the browser where to find the CSS file that is used to style the page.
Such as : (*) to target all the elements, (h1,h2,…..) by targetting the elemnt name
<body> element, they will apply to most child elements. This is because the value of the font-family property is inherited by child elements.References:
@Jon Duckett/HTML & CSS