reading-notes


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

HTML & CSS

Design and Build Websites

Contents:

In order to teach you about creating web pages, this book is divided into three sections:

Before starting we need to know the differents ways that you can access to web:

html using elements to describe the structure of the page:

Image Image

So an overall the websites are being built using HTML and CSS,so how these worked ?

it’s used so that in CSS the element with a unique identity allows you to style it differently than any other instance of the same element on the page.


Examples of block elements are <h1>, <p>, <ul>, and <li>.

<h1>Hiroshi Sugimoto</h1>

<p>The dates for the ORIGIN OF ART exhibition are as follows:</p>

<ul>

` <li>`

` Science: 21 Nov - 20 Feb 2010/11`

` </li>`

</ul>

Examples of inline elements are <a>, <b>, <em>, and <img>.

For example, you might create a <div> element to contain all of the elements for the header of your site (the logo and the navigation) <div id="header">

<img src="images/logo.gif" alt="Anish Kapoor" />

<ul>

<li><a href="index.html">Home</a></li>

<li><a href="biography.html">Biography</a></li>

<li><a href="works.html">Works</a></li>

<li><a href="contact.html">Contact</a></li>

</ul>

</div><!-- end of header -->

<span class="gallery">Tate Modern</span>

<iframe

width="450"

height="350"

src="http://maps.google.co.uk/maps?q=moma+new+york

&amp;output=embed">

</iframe>

src:The src attribute specifies the URL of the page to show in the frame. height:The height attribute specifies the height of the iframe in pixels. width:The width attribute specifies the width of the iframe in pixels scrolling:The scrolling attribute will not be supported in HTML5 frameborder:The frameborder attribute will not be supported in HTML5.


<meta> The element lives inside the <head> element and contains information about that web page.And it is not visible to users.

For example:

<head>

<title>Information About Your Pages</title>

<meta name="description"

content="An Essay on Installation Art" />

<meta name="keywords"

content="installation, art, opinion" />

<meta name="robots"

content="nofollow" />

<meta http-equiv="author"

content="Jon Duckett" />

<meta http-equiv="pragma"

content="no-cache" />

<meta http-equiv="expires"

content="Fri, 04 Apr 2014 23:59:59 GMT" />

</head>

Overall abou extra markup:

An overall example of extra markup:

<!DOCTYPE html PUBLIC

"-//W3C//DTD HTML 4.01 Transitional//EN"

"http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta name="description" content="Telephone, email

and directions for The Art Bookshop, London, UK" />

<title>Contact The Art Bookshop, London UK</title>

</head>

<body>

<div id="header">

<h1>The Art Book Shop</h1>

<ul>

<li><a href="index.html">home</a></li>

<li><a href="index.html">new publications</a>

</li>

<li class="current-page">

<a href="index.html">contact</a></li>

</ul>

</div><!-- end header -->

<div id="content">

<p>Charing Cross Road, London, WC2, UK</p>

<p><span class="contact">Telephone</span>

0207 946 0946</p>

<p><span class="contact">Email</span>

<a href="mailto:books@example.com">

books@example.com</a></p>

<iframe width="425" height="275" frameborder="0"

scrolling="no" marginheight="0" marginwidth="0"

src="http://maps.google.co.uk/maps?f=q&amp;

source=s_q&amp;hl=en&amp;geocode=&amp;

q=charing+cross+road+london&amp;output=embed">

</iframe>

</div><!-- end content -->

<p>&copy; The Art Bookshop</p>

</body>

</html>

  1. Chapter 17:HTML layout
  1. Chapter 18:Prossess & design

JAVASCRIPT

Introduction

  1. ACCESS CONTENT :You can use JavaScript to select any element, attribute, or text from an HTML page.
    • Select the text inside all of the elements on a page
    • Select any elements that have a class attribute with a value of note
    • Find out what was entered into a text input whose id attribute has a value of email
  2. MODIFY CONTENT:You can use JavaScript to add elements, attributes, and text to the page, or remove them.
    • Add a paragraph of text after the first element
    • Change the value of class attributes to trigger new CSS rules
  3. PROGRAM RULES:You can specify a set of steps for the browser to follow (like a recipe),which allows it to access or change the content of a page.
    • A gallery script could check which image a user clicked on and display a larger version of that image.
  4. REACT TO EVENTS:You can specify that a script should run when a specific event has occurrede, it could be run when:
    • A button is pressed
    • A link is clicked (or tapped) on
    • A cursor hovers over an element

JAVASCRIPT IN THE BROWSER


The A B C in programming

Before you learn how to read and write the JavaScript language itself, you need to become familiar with some key concepts in computer programming and they are :

A. What is a script and how do I create one? B. How do computers fit in with the world around them? C. How do I write a script for a web page?

A. What is a script and how do I create one?

A browser may use different parts of the script depending on how the user interacts with the web page. Script can run different sections of the code in response to the situation around them.

WRITING A SCRIPT


FROM STEPS TO CODE

So To approach writing a script, break down your goal into a series of tasks and then work out each step needed to complete that task (a flowchart can help).


B. How do computers fit in with the world around them?

C. How do I write a script for a web page?

There is three languages that are used to create web pages: HTML, CSS, and JavaScript.

With keeping the three languages in separate files, HTML page is linking to CSS and JavaScript files.Each language forms a different purpose.

These three layers form the basis of a popular approach to building web pages called progressive enhancement.

JavaScript is written in plain text, just like HTML and CSS,so you do not need any new tools to write a script.And to link it with the HTML :

  1. Create a folder to put the javascript file into it Ex; add-content . j s
  2. Use the HTML <script> element to tell the browser it is coming across a script.

<body>

<hl>Constructive &amp ; Co. </ hl>

<script src="js/ add-content.js"></ script>

<p>For all orders and i nquiries please cal l

<em>SSS-3344</ em></ p>

</ body>

It will be applied using document.write(object) its usually work with the conditions command.

JAVASCRIPT RUNS WHERE IT IS FOUND IN THE HTML

Example of the Javascript commands:

var today= new Date();

var hourNow = today.getHours();

var greeting;

if (hourNow > 18) {

greeting= 'Good evening!';

else if (hourNow > 12) {

greeting = ' Good afternoon!';

else if (hourNow > 0) {

greeting = 'Good morni ng!';

else {

greeting = 'Welcome! ' ;

document .write( ' <h3>' +greeting + ' </ h3> ');

References:

@Jon Duckett/HTML & CSS

@Jon Duckett/JAVASCRIPT