" ps: It looks like you are doing some exploring. I might suggest that there most likely already exists a directory with your user name as "/www/youruserid." If so, it will make your life easier in the future if you put the "articles" folder in your own directory."

You can't expect that to work if you are going to put direct links to that location in your HTML pages. Each Apache instance must have a document root, and Apache can then only serve static files from that document root. It cannot serve documents from other areas of the IFS. The only way you can serve documents from other areas of the IFS (outside the document root) is if you do it programmatically and then stream the data back to the browser.

If the folder structure is like this

www

articles

CSS

mobile.css

htdocs

mobileorder.html

Then Apache can only serve the CSS files if the document root is the "www" folder. But that would be a bad way to configure Apache. Typically the document root would be www/htdocs and then all the static resources (js, css, html etc) would be within www/htdocs (or subfolders therein). You can then reference them in your HTML with a leading "/" (meaning from the document root) or without a leading "/" (meaning relative to the html file location).


[https://www.netcracker.com/assets/img/netcracker-social-final.png] ƕ
-----Original Message-----
From: WEB400 [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Booth Martin
Sent: 30 January 2017 08:39
To: Web Enabling the IBM i (AS/400 and iSeries) <web400@xxxxxxxxxxxx>
Subject: Re: [WEB400] external CSS style sheets problem

I'm not sure I understood your structure correctly. There are choices but the most common pattern used would be a file structure like this:

* /www/articles/htdocs and put your .html, .css, js, and .json & .xml
files in htdocs.
* At some point you may wish to add an "images" folder to htdocs to
hold your images.

If you go this route you will want your line to say:

*

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

ps: It looks like you are doing some exploring. I might suggest that there most likely already exists a directory with your user name as "/www/youruserid." If so, it will make your life easier in the future if you put the "articles" folder in your own directory.

On 1/30/2017 1:51 AM, gio.cot wrote:
Hi all



I'm trying to follow this <http://iprodeveloper.com/author/brian-may>
Brian May's article at
http://iprodeveloper.com/application-development/move-your-web-apps-fo
rward- part-2-add-css-and-html5-features ; I use RDI for editing HTML
and CSS in IFS and this is my problem :

1. I created the css file inside the subdirectory in my /articles/

2. In the HTML I added this line <link rel="stylesheet"
type="text/css" href="/articles/css/mobile.css">

3. And all other step suggested in the document



Now when I try to display the HTML preview (in RDI) or when I run my
application from browser, the css style don't work



Where am I wrong ?

Thanks in advance



This is my folder structure in IFS

www

articles

CSS

mobile.css

htdocs

mobileorder.html



This my source file



Css (/www/articles/CSS/mobile.css)

body {

background: #00294f;

color: red ;

text-align: center ;

}

h1 {

text-align: center;

}

.form-table {

border: none;

margin-left: auto;

margin-right: auto;

}

.form-label {

text-align: right;



HTML (/www/articles/htdocs/mobileorder.html)



<html>

<head>

<link rel="stylesheet" type="text/css"
href="/articles/CSS/mobile.css">

<meta name="viewport" content="width=device-width, initial-scale=1.0,
maximum-scale=1.0, target-densitydpi=device-dpi" />

<title>Order Entry</title>

<!-- <style type="text/css">body {background: #00294f; color:
white}
h1{text-align: center;}</style> -->

</head>

<body>

<h1>Mobile Order Entry</h1>

<form action="/cgi-bin/mobileord.pgm" method="post">

<!-- <center> -->

<table class="form-table">

<tr>

....








--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/web400.




________________________________
The information transmitted herein is intended only for the person or entity to which it is addressed and may contain confidential, proprietary and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.