Relative Paths.

Slides:



Advertisements
Similar presentations
Cascading Style Sheets Controlling the Display Of Web Content.
Advertisements

Public_html sites website1 website2 Server Folder Sequence & Website Uniform Resource Locator (URL) Address Example
Web Design (5) Navigation (1). Creating a new website called ‘Navigation’ In Windows Explorer, open the folder “CU3A Web Design Group”; and then the sub-folder.
Chapter 6 pp Announcements O Project 1 coming up (details on Monday) O Lab 2 deliverable (submit on Blackboard) O Lab 3 pre-lab quiz is up.
CM143Web Week 8 Review of Assignment 1 Revision & Elaboration.
INFO 1300: LOCAL DEVELOPMENT 10/16/2015. Index.html Important Homepage for every project in this course Points will be deducted otherwise.
How to upload files to Altervista Overview:
Building a Website: Site Management Fall Introduction Web page consists of a collection of varied files – HTML – images – CSS – Flash movies – Etc.
Web Design (8) Images (2). My Holiday Photos An exercise in adding and linking images. Create a new website folder calling it ‘My Holiday Photos’. In.
Site Organization. The Need to Organize Site Files Thus far, we have placed all our site files into the main (root) website folder. As a website becomes.
PATHNAMES LINKS BACKGROUND.  Pathnames in hyperlinks & image tags  Absolute pathnames: for links to web addresses  Relative pathnames: for links to.
CSU Extension Webpage Template Session 4 February 2010.
CSS IS A LANGUAGE DESIGNED TO TARGET HTML ELEMENTS AND NODES BY TYPE, CLASS, ID AND VALUE, AND CHANGE THEIR VALUES CSS – change how your HTML looks and.
EXTERNAL STYLESHEETS AND MORE HTML STYLING HTML and CSS part 2.
Hyperlinks Links for Other Pages. Hyperlink (aka Link) Text (or image) user can click Takes user to different location In general, location can be: On.
HTML5 and CSS3 Illustrated Unit E: Inserting and Working with Links.
HTML Links CS 1150 Spring 2017.
Web Protocols, Technologies and Applications
External Style Sheets.
Cascading Style Sheets
CSS Cascading Style Sheets
Web Development & Design Foundations with HTML5
Web Basics: HTML/CSS/JavaScript What are they?
Your GIMP Portfolio Navigation Menu.
4.01 How Web Pages Work.
Internal Style Sheets External Style Sheets
Objective % Select and utilize tools to design and develop websites.
Section 4.1 Section 4.2 Format HTML tags Identify HTML guidelines
SOEN 287 Web programming Tutorial 03- HTML5 & CSS
Site Organization.
Internal and External Links
Pre-Coding Web Design – Sec 3-1
Fundamentals of HTML, XHTML & CSS
Uniform Resource Locators (URLs)
Internal and External Links
Cascading Style Sheets contd: Embedded Styles
Spring 2009 Kevin Cole Gallaudet University
Web Development & Design Foundations with HTML5
Intro to CSS CS 1150 Fall 2016.
Objective % Select and utilize tools to design and develop websites.
CASCADING STYLE SHEET CSS.
Filezilla problems continuing
Introduction to CSS.
Intro to CSS CS 1150 Spring 2017.
For the World Wide Web Positioning Objects with CSS
Site Organization.
Cascading Style Sheets
How files are organized
5.2.3 Be able to use HTML and CSS to construct web pages
Uniform Resource Locators (URLs)
HTML Tags and References to other Files
Putting An Image on Your Web Page
Web Protocols, Technologies and Applications
Working with Cascading Style Sheets (CSS)
Web Page Validation File management and Referencing
Working with Cascading Style Sheets (CSS)
Uniform Resource Locators (URLs)
protocol relative URLs
Lesson 4 – Introduction to CSS
CSS.
Chapter 6 pp
HTML & CSS 7 Languages in 7 Days.
Cascading Style Sheets
Web Development & Design Foundations with HTML5
Digging in a little deeper
HTML Links CS 1150 Fall 2016.
Creating your website and learning HTML
HTML Tags and References to other Files
Website File Management
Presentation transcript:

Relative Paths

Relative Paths: Until now, we have placed all our files in the same folder. As a website becomes larger and more complicated, a single folder gets to be too cluttered to manage effectively. Some organization of files is required. We can group similar files, such as images, into separate folders, but we need a way to tell the browser how to locate these files.

Separate Folders: A well-organized site will group like files - such as CSS and images - in their own dedicated folders.

Example of Relative Paths: <head> <link rel="stylesheet" type="text/css" href="css/mycss.css" > </head> <body> <img src="images/flowers.jpg" /> <img src="images/orange.jpg" /> <img src="images/pink.jpg" /> </body> The path is always "relative" to the file making the reference. In this case, the path is relative to the location of index.html.

Example of Relative Paths: <head> <link rel="stylesheet" type="text/css" href="css/mycss.css" > </head> <body> <img src="images/flowers.jpg" /> <img src="images/orange.jpg" /> <img src="images/pink.jpg" /> </body>

Example of Relative Paths: body { background-image:url('../images/orange.jpg'); } This is the mycss.css file. Remember, the path is always "relative" to the file making the reference. In this case, that file is the CSS file in its own subfolder. The solution is to use ../ to tell the browser to "go up one folder" first.

A Common Mistake with Paths: <head> <link rel="stylesheet" type="text/css" href="css/mycss.css" > </head> <body> <img src="C:\Users\me\Desktop\Website\images\orange.jpg" /> <img src="images/orange.jpg" /> <img src="images/pink.jpg" /> </body> Never list a file path like this. It is called an "absolute" path and might work when we view our site locally but won't work when we move our site to a web server online.