File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Upload css file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Upload css file" Watch "Upload css file" New topic
Author

Upload css file

Aurika Vegana
Greenhorn

Joined: May 24, 2012
Posts: 11

Hi,

I wanted to upload my .css file for linking to in in the html.

I uploaded it to dropbox, and chose "get link", but the html site won`t work with it.
Here is my file: https://www.dropbox.com/s/bj83lmkq9e5vtig/main.css

And i put it like this:




The site won`t show up with the settings from the css file.

I am a beginner, so I would appreciate any help.

Kindly.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

Dropbox isn't delivering your CSS as a plain text CSS file. If you just click on the link you can see that it is being decorated with a lot of HTML. You'll need to put your CSS file somewhere where it can be delivered as is. Generally, you put your CSS files on the same server as your HTML, just in a subdirectory like css.


GenRocket - Experts at Building Test Data
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61769
    
  67

Dropbox is a wonderful tool and I make lots of use of it, but it is not a web server can cannot function as one.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

Plus it's also https: over SSL!!

WP
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61769
    
  67

William P O'Sullivan wrote:Plus it's also https: over SSL!!

So?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

Bear, you beat me to it.
Aurika Vegana
Greenhorn

Joined: May 24, 2012
Posts: 11

Hi,

thank you very much for your answers.

I somehow thought that would be the problem.

Generally, you put your CSS files on the same server as your HTML, just in a subdirectory like css.


I can`t, cause I don`t have any webspace nor homepage.
Firstly it is just for training, and then it will be for a ebay shop. So I have to upload it somewhere else?


Where can I upload it to work as a css file?

Kindly,
Aurika ;)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61769
    
  67

Does your ISP give you web space? If not, there are plenty of hosting services.
Aurika Vegana
Greenhorn

Joined: May 24, 2012
Posts: 11

Yes, but I have to pay for it.
Ok, i will google for it, but would be glad if you or someone else could name some. :-)
I don't need any hp, just somewhere to upload the css file.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61769
    
  67

free web hosting

Just remember, you don't get what you don't pay for.
Aurika Vegana
Greenhorn

Joined: May 24, 2012
Posts: 11

Ah, ok. Thank you anyways. Always quick replies here :-)

I' ll use the internal version, and put my styles in the head.

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

Aurika Vegana wrote:Ah, ok. Thank you anyways. Always quick replies here :-)

I' ll use the internal version, and put my styles in the head.



To be clear, you really don't need to upload a stylesheet somewhere just to use it. Reference it relative to your html file. Say you have the following structure:



Your index.html might look like this:



This will work locally. Then assuming you do upload that to a server at some point, as long as you upload the same structure, nothing has to change.
Aurika Vegana
Greenhorn

Joined: May 24, 2012
Posts: 11

Hi,

thank you , it really works ;)

But when I copy paste my html to ebay, all the images won`t show up.

It works only locally isn`t it?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18992
    
    8

I guess you still haven't understood the difference between a relative URL and an absolute URL. And I guess (you didn't post any examples) you used relative URLs in your HTML for your images without putting the images in the locations referred to by those relative URLs.

So show us your code, in this case the HTML which you're having trouble with.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61769
    
  67

If you are posting code to ebay (wouldn't that have been useful info to include from the outset?) you'll need to use absolute URLs. Otherwise, how would the page even know what server to look for the file(s) on?
Aurika Vegana
Greenhorn

Joined: May 24, 2012
Posts: 11

I guess you still haven't understood the difference between a relative URL and an absolute URL. And I guess (you didn't post any examples) you used relative URLs in your HTML for your images without putting the images in the locations referred to by those relative URLs.


I understand that i have to upload the images etc somewhere else (this was my question for css in the first post here) for ebay. ( Thats what I always do, cause it`s cheaper, than using the image gallery on ebay ;))



Gregg wrote:
...This will work locally. Then assuming you do upload that to a server at some point, as long as you upload the same structure, nothing has to change.


Here I was a bit stuck, cause for ebay it wont work.

Kindly,
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18992
    
    8

Okay. So you have some HTML which is accessed via an eBay URL. (Correct me if I have misunderstood anything -- which is quite possible.) And you have some images which are accessed by URLs which are not eBay URLs. Now explain to us whether you should use relative or absolute URLs in your HTML when you want to link to those images, and why.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61769
    
  67

Hello? Is this microphone on?
Aurika Vegana
Greenhorn

Joined: May 24, 2012
Posts: 11

Hi, yes micro is on ;)

sorry if I have confused you. English is not my first language as you have already noticed ;)

So if in my ebay account I want to place an item: I write the code on my laptop with say gedit, copy & paste it to ebay "html".
Then I upload my images on imageshack or somewhere else, and copy the image location url, and of course it`s an absolute url ,
which I paste on the right place where I wanted it to be in the html which is already in ebay.



Of course I have this pics on my laptop already, and if it were not for ebay I could see them locally with relative url`s in the browser.

Good night,

Aurika
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18992
    
    8

So it's all working now? Glad to hear that.
Aurika Vegana
Greenhorn

Joined: May 24, 2012
Posts: 11

Yes, thank you all for your patience =)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Upload css file