how do I reference a stylesheet that I've uploaded into my Resources folder?

  • 1
  • Question
  • Updated 6 years ago
  • Answered
I've uploaded a stylesheet (style.css) into my resources folder, but when I use the <link rel ="stylesheet"type="text/css href="resources/style.css"> as the CSS rules require, it doesn't get used. Am I allowed to do this, and if not, how can a personal external style sheet be linked to ?
Photo of Philip Taylor

Philip Taylor

  • 355 Posts
  • 66 Reply Likes

Posted 6 years ago

  • 1
Photo of Philip Taylor

Philip Taylor

  • 355 Posts
  • 66 Reply Likes
(sorry, there's a closing quote mark after the text/css bit, as there should be)
Photo of Gop

Gop

  • 7473 Posts
  • 2115 Reply Likes
Hi Philip,

The syntax for calling the external stylesheet from your filemanager:

<link href="http://www.mydomain.com/resources/style.css" rel="stylesheet" type="text/css" />

based on the sheet being called style.css

This the third in a series of different types and is called an external style sheet.
Photo of Stefan

Stefan, Official Rep

  • 4448 Posts
  • 190 Reply Likes
Hello Philip

I'm afraid that it's not yet possible with Yola to add your own Style sheet as a .css file. To create a Yola website you will need to use one of our Style templates from the Style library. You can then change and customise the Site CSS, using the Site CSS Editor.

We are considering to offer the feature to create your own CSS Style in future, but it's currently not planned.
Photo of Philip Taylor

Philip Taylor

  • 355 Posts
  • 66 Reply Likes
Thanks Gop and Stefan.
I had a surge of hope when I saw Gop's answer, as it was slightly different from what I had used, but it still didn't get picked up; obviously, Stefan is correct in saying they can't be used at present.
Oh, well, type number two will have to suffice for now.
Photo of Stefan

Stefan, Official Rep

  • 4448 Posts
  • 190 Reply Likes
Hi Philip

Is there anything in particular that you'd like to achieve with your own Style? If you use a plain Style template such as "Squeaky Clean" or "No Frills", you can pretty much create your own style for your website by editing the Site CSS.
Photo of Gop

Gop

  • 7473 Posts
  • 2115 Reply Likes
External style sheets are generally used for additions in these cases with Yola and not templates as such. It's one of the ways of setting out your CSS and that's where the name comes from not the "Style" of the template.

Things like menus etc. The purpose is to call it as needed rather than add it to an HTML widget or CSS over-rides which would offer it on all pages. It's ideal for selective use when the stylesheet is a little complex. It works on a couple of sites I have.
Photo of Philip Taylor

Philip Taylor

  • 355 Posts
  • 66 Reply Likes
Thanks again.
No,there was nothing specific, I'm just trying to familiarize myself fully with HTML5 and CSS.
I'd be interested to know how you linked your pages, Gop, as I haven't been able to do this yet. Mine is the Free version, does that make a difference, maybe?
Photo of Gop

Gop

  • 7473 Posts
  • 2115 Reply Likes
They are currently both on Silver accounts

I wasn't using HTML5 at that stage when it was developed.

Basically I called the stylesheet and added the HTML to the page.
Photo of Philip Taylor

Philip Taylor

  • 355 Posts
  • 66 Reply Likes
Do you mean you added the styling as internal (inside STYLE tags at the top of the page), or did you call the external stylesheet from each page that used it? if that was the case, can you tell me the syntax you used for it?
Photo of Gop

Gop

  • 7473 Posts
  • 2115 Reply Likes
Hi Phillip,

I used an external style sheet as you have described in each page I wished to implement a menu. I called it in according to the syntax I mentioned above.
Photo of Philip Taylor

Philip Taylor

  • 355 Posts
  • 66 Reply Likes
Thanks again Gop.
As usual, it was my error. Your syntax was correct (although it's different from what I was advised to use) but as it turns out, I don't need to use my site URL, just the resources and file name.
I had tried this earlier but had wrongly uploaded the stylesheet as .txt instead of .css
Photo of Gop

Gop

  • 7473 Posts
  • 2115 Reply Likes
I am very glad you got it going. It's a valuable tool and makes life easier when you want to add styling to selected pages.

It's also great to store external style sheets in a repository such as a dummy site and then you can call them from that site rather than having to upload it again.

I don't know if the alternate syntax works or not because i have never used it but you can use absolute references for the storage address.