reading-notes


Project maintained by Razan-am Hosted on GitHub Pages — Theme by mattgraham

HTML & CSS

Introduction to CSS


Such as :

  1. BLOCK & INLINE ELEMENTS
    • Block level elements look like they start on a new line taking the full width,like: <h1>-,<h6>, <p> and <div> elements
    • Inline elements flow within the text and do not start on a new line taking only the content width,like : <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; }


  1. Inline : by applying the style directly to the element in tag .

  2. 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.

  3. 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.


CSS Selectors:


Inheritance:


An Overall

References:

@Jon Duckett/HTML & CSS