NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Cannot Preview images or CSS


Joined: 25 Aug 2003
Posts: 10
Reply with quote
Hi All,

As I could not find any posts that refered to my problem I am posting it here.

I am using PHPEd 4.5 and have found that I cannot preview images in a .html page I am working on. Nor does the CSS located in an external file seem to be applied.

My Project directory structure is thus:


Code:
   Project_Directory(PD)
                       |
                         site
                             |
                               html
                             |
                               images
                             |
                               css



I place an HTML file, test.html in the PD/site/html directory. I place an image in PD/site/images and I place a CSS file in PD/site/css.

In my HTML file I attempt to access the CSS file using:

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

I also place an image in the HTML file using:

<img src="../images/logo.jpg" width="188" height="94" border="0">

I then attempt to style some text using styles defined in the CSS file:


<div id="aTextStyle">THIS SHOULD BE SOME STYLED TEXT</div>

Now, if I upload this to my server it works correctly, but if I try to preview it locally all I see is the broken link to the image and the bare, un-CSS styled text.

Does anyone have any ideas on how to get the Preview feature working correctly?

Thanks,

Jeff
View user's profileFind all posts by jalertaSend private message


Joined: 07 Mar 2006
Posts: 22
Reply with quote
Shouldn't the relative links be

Code:
./../
..?
View user's profileFind all posts by Joe BelmaatiSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Preview tab loads HTML file into browser directly and therefore you won't see neither imager nor CSS applied nor any other linked files.
To make a real preview you have to pass HTML through the web server. Right?
So, just press RUN button. It's easy Smile
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 25 Aug 2003
Posts: 10
Reply with quote
Joe Belmaati wrote:
Shouldn't the relative links be

Code:
./../
..?



Actually, the 'site' directory is the DocumentRoot on the web server for that project, so from the 'html' directory '../images/' would be the correct relative link to the 'images' directory.

The reason I start this project from the 'Project_Directory' is that I have multiple projects that are all located in that main directory. It makes it easier for me to access multiple projects using a single Account setup.

Jeff
View user's profileFind all posts by jalertaSend private message


Joined: 25 Aug 2003
Posts: 10
Reply with quote
ddmitrie wrote:
Preview tab loads HTML file into browser directly and therefore you won't see neither imager nor CSS applied nor any other linked files.
To make a real preview you have to pass HTML through the web server. Right?
So, just press RUN button. It's easy Smile


Not to be contrary, but what is the use of a Preview tab if it does not preview anything? I would expect that it would at least show images if they are correctly referenced. Maybe I cannot expect a Dreamweaver type preview, which will actually allow you to use design-time CSS linking, but at least the preview can show the basic page graphical layout, dont' you think?

Why have a preview tab if you need to run everything through a web server? If that is the case, I can just use my Firefox or IE browser to test my files. The preview tab would just be adding confusion.

Jeff
View user's profileFind all posts by jalertaSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Quote:
I can just use my Firefox or IE browser to test my files.

Sure you can.
But I thnk [Run] button is a bit faster.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Cannot Preview images or CSS
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic