Website Babble Webmaster Forums  


Go Back   Website Babble Webmaster Forums > Creating a Website > HTML, PHP, CSS, Javascript & Coding/Programming Topics

Your WB Notifications

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-01-2009, 09:13 AM
ofaict's Avatar
Regular Babbler
 
Join Date: Jul 2009
Location: New Hampshire & Florida
Posts: 68
ofaict has no reputation at Website Babble yet.
Default css question...

I recently downloaded the "free css template" off of Lisa's website. (2createawebsite) I also downloaded coffeecup as my html editor.

So here is my question.

I have the "style" and the "index" files in the same folder. And I have been creating new pages in the same folder (pages-in-original-folder) with no problems. The css formating has been carried to all new pages....all looks great.

Now I want to create a new page that has the address of:
mywebsite.com/pages-in-original-folder/newpage.html

How do I go about doing that so that the css carries to the "newpage.html" page??

Thanks!
-Ofaict
Reply With Quote
  #2 (permalink)  
Old 11-01-2009, 10:13 AM
sequencehosting's Avatar
Ultimate Babbler
 
Join Date: Jun 2009
Location: Kent, England
Posts: 1,339
sequencehosting has a stellar WB reputation (over 400 points)sequencehosting has a stellar WB reputation (over 400 points)sequencehosting has a stellar WB reputation (over 400 points)sequencehosting has a stellar WB reputation (over 400 points)sequencehosting has a stellar WB reputation (over 400 points)
Default

Quote:
Originally Posted by ofaict View Post
I recently downloaded the "free css template" off of Lisa's website. (2createawebsite) I also downloaded coffeecup as my html editor.

So here is my question.

I have the "style" and the "index" files in the same folder. And I have been creating new pages in the same folder (pages-in-original-folder) with no problems. The css formating has been carried to all new pages....all looks great.

Now I want to create a new page that has the address of:
mywebsite.com/pages-in-original-folder/newpage.html

How do I go about doing that so that the css carries to the "newpage.html" page??

Thanks!
-Ofaict
Your domain name

mywebsite.com is the index.html file. The other pages are in this folder so they will already be mydomain.com/page.html

If you would like to create a page with this structure

mydomain.com/folder/page.html

You will first need to create a new folder in the same directory as your index.html file. Next you will need to create a new html file inside that folder.

To do this create a new .html file in that folder and paste all of the code from index.html to the .html file (make sure you don't delete any code from index.html just copy it)

So you can now access your new .html file at

mydomain.com/folder/page.html

--


Now because you have a new file inside a folder you will need to change bits of code in the new .html file so they point to your .css file.

First look inside your <head> section and find this line (or something similar)

<link type="text/css" rel="stylesheet" href="style.css" />

Now this is the correct path for any file inside the main directory. For your new .html file inside the folder you created you will need to change that line to this following.

<link type="text/css" rel="stylesheet" href="/style.css" />

or this

<link type="text/css" rel="stylesheet" href="../style.css" />

It's up to you what one you use but I always use the first example. Let me explain a bit.

/ = main directory
../ = 1 folder

So by having /style.css it is saying to the browser, look for the style.css is the main directory.

by having ../style.css it's saying to the browser, look for style.css it will be 1 folder deep.

I recommend using the / because you will not need to change it depending on how many folders your file is in. If you wanted this structure

mydomain.com/folder/folder/file.html

You could use this code

<link type="text/css" rel="stylesheet" href="../../style.css" />

because the style.css is 2 folders away. But it's much easier to use the / instead. The following code will always work no matter where the file is.

<link type="text/css" rel="stylesheet" href="/style.css" />

---

The last code your will need to change is on any images so for example

<img src="image.jpg" />

you should change to

<img src="/image.jpg" />

much like the css line.

--

I hope I helped a bit, let me know if there are any problems.
__________________
Professional Website Hosting - Now Hosting Over 75 Websites! >Testimonials<
Professional cPanel Web Hosting from $1/month!
Our Disk Space and Bandwidth Has Been Doubled! Learn More
WEBSITE BABBLE SPECIAL! FREE Domain! - FREE Wordpress Setup! - 24 Hour Support

Last edited by sequencehosting; 11-01-2009 at 10:20 AM.
Reply With Quote
  #3 (permalink)  
Old 11-01-2009, 04:39 PM
ofaict's Avatar
Regular Babbler
 
Join Date: Jul 2009
Location: New Hampshire & Florida
Posts: 68
ofaict has no reputation at Website Babble yet.
Default

Here is the line of text that I believe I need to change.....
It does not look like your examples.
Can you help me?

<LINK href="style.css" type=text/css
rel=stylesheet><STYLE type=text/css>
Reply With Quote
  #4 (permalink)  
Old 11-01-2009, 04:42 PM
sequencehosting's Avatar
Ultimate Babbler
 
Join Date: Jun 2009
Location: Kent, England
Posts: 1,339
sequencehosting has a stellar WB reputation (over 400 points)sequencehosting has a stellar WB reputation (over 400 points)sequencehosting has a stellar WB reputation (over 400 points)sequencehosting has a stellar WB reputation (over 400 points)sequencehosting has a stellar WB reputation (over 400 points)
Default

Quote:
Originally Posted by ofaict View Post
Here is the line of text that I believe I need to change.....
It does not look like your examples.
Can you help me?

<LINK href="style.css" type=text/css
rel=stylesheet><STYLE type=text/css>
Yeah, you right it can vary slightly. Simply add the / before style.css in your code like so:

HTML Code:
<LINK href="/style.css" type=text/css 
rel=stylesheet><STYLE type=text/css>
Simply by adding the / you are telling the browser to look for the style.css file inside the main directory.

Im not sure why you have <STYLE type=text/css> twice but no problem as long at is works
__________________
Professional Website Hosting - Now Hosting Over 75 Websites! >Testimonials<
Professional cPanel Web Hosting from $1/month!
Our Disk Space and Bandwidth Has Been Doubled! Learn More
WEBSITE BABBLE SPECIAL! FREE Domain! - FREE Wordpress Setup! - 24 Hour Support

Last edited by sequencehosting; 11-01-2009 at 04:45 PM.
Reply With Quote
  #5 (permalink)  
Old 11-01-2009, 04:46 PM
ofaict's Avatar
Regular Babbler
 
Join Date: Jul 2009
Location: New Hampshire & Florida
Posts: 68
ofaict has no reputation at Website Babble yet.
Default

Never mind....
I got it!
I had to type the ".." before I added the "/" -Otherwise I was still seeing garbage.
Thanks for your help!
This website ROCKS!!!!
Reply With Quote
  #6 (permalink)  
Old 11-01-2009, 04:49 PM
sequencehosting's Avatar
Ultimate Babbler
 
Join Date: Jun 2009
Location: Kent, England
Posts: 1,339
sequencehosting has a stellar WB reputation (over 400 points)sequencehosting has a stellar WB reputation (over 400 points)sequencehosting has a stellar WB reputation (over 400 points)sequencehosting has a stellar WB reputation (over 400 points)sequencehosting has a stellar WB reputation (over 400 points)
Default

Quote:
Originally Posted by ofaict View Post
Never mind....
I got it!
I had to type the ".." before I added the "/" -Otherwise I was still seeing garbage.
Thanks for your help!
This website ROCKS!!!!
No problem, glad you got it sorted out
__________________
Professional Website Hosting - Now Hosting Over 75 Websites! >Testimonials<
Professional cPanel Web Hosting from $1/month!
Our Disk Space and Bandwidth Has Been Doubled! Learn More
WEBSITE BABBLE SPECIAL! FREE Domain! - FREE Wordpress Setup! - 24 Hour Support
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -6. The time now is 04:44 PM.


 Subscribe to RSS

WB Sponsors

flash chat

Home Jobs Online

Search Engine Marketing

Paid Surveys

Web Design Newcastle



 Subscribe to the Website Babble Feeds

2 Create a Website Homepage | 2 Create a Website Blog


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0