Linking to external stylesheets in Aptana - css

I'm new to Aptana Studio, and I'm afraid there's something I just don't understand about it. When I try to link to an external stylesheet located in the same folder as my .html file, it won't work.
Normally, you just place something like the following code in the head section, right?
<link rel="stylesheet" type="text/css" href="style.css" />
Can someone please explain to me why this doesn't work?
I really like Aptana so far, but this is driving me mad.

Your code is correct but I haven't heard good things about Aptana. If you only want to code in HTML CSS and JavaScript you surely want to use brackets
This is an awesome text editor with LIVE code preview in browser like firebug -
http://blog.brackets.io/2012/06/25/brackets-open-source-code-editor/
Download the latest sprint: https://github.com/adobe/brackets/downloads

Related

custom 404 sometimes missing stylesheet

I have a website hosted by siteground, and my custom 404 page is SOMETIMES missing it's stylesheet. I contacted support but they saw it working fine, assumed I just codded it wrong, and told me to get help form a professional web programmer... (of course I did test before contacting them to be sure it was not my fault)
Anyways, the way that siteground allowes you to create a custom 404 page is to add your html code to a form in your control panel, wich creates a 404.shtml in your main folder. The .shtml contains all your html. I have done the following test to narrow down the problem.
created a not404.html in my main folder with code copy pasted from my 404.shtml that is in the same folder. It loaded with my stylesheet applied no problem.
tried prompting a 404 page with both bad hyperlinks, and by typing pages that do not exist. When I am having the problem with my stylesheet missing, none of thease pages have css, but when I am not having the problem, they all have css applied.
What I think it is: I think that the 404.shtml is not really in my main folder, but just appears to be there, and sometimes that link breaks and the 404.shtml is actualy acessed somewere else on sitegrounds server, therefor the style link would not work properly. This would explain the intermittent css failor. But this is just logic, not understanding.
The only thing I can think of that would be wrong on my end is if there is more than one way to link stylesheets, and my way is a bit unstable. Here is the format I use.
<link type='text/css' rel='stylesheet' href='css/404.css'>
I know this might be a difficult question, but it would be pretty satisfying to figure this out and inform them of the problem with their site.
Change the href for the style tag to be absolute. So this:
<link type='text/css' rel='stylesheet' href='css/404.css'>
Becomes this:
<link type='text/css' rel='stylesheet' href='/path/to/css/404.css'>
css/404.css is a relative path. If the path is something like /path/to/nonextant/page it will try to load the stylesheet from /path/to/nonextant/page/css which does not exist.
Use an absolute path:
/css/404.css

joomla wrong base href results in wrong CSS template

I have installed Joomla 3.x and some modules.
One of my modules is to display articles from certain categories of my articles, but when I navigate to my article, the CSS stylesheets do not load.
When I view the source, I discovered that the URL for the CSS stylesheet in the page above becomes:
<base href="http://cambridge.mywebcommunity.org/index.php/10-%E7%88%B1%E7%AB%8B%E6%96%B9%E5%8A%A8%E5%90%91%E6%9B%B4%E6%96%B0/3-welcome-to-your-blog" />
... instead of the original I put in, here:
<base href="http://cambridge.mywebcommunity.org/" />
This also happens to another CSS stylesheet from the module. The CSS URL loads like this:
<link rel="stylesheet" href="http://cambridge.mywebcommunity.org/10-爱立方动向更新/modules/mod_news_pro_gk5/interface/css/style.css" type="text/css" />
... instead of the original CSS URL that I put in:
<link rel="stylesheet" href="http://cambridge.mywebcommunity.org/modules/mod_news_pro_gk5/interface/css/style.css" type="text/css" />
So I have figured out that the issue is the URLs are not being added by Joomla correctly. How would I go about fixing this?
From what you've posted it looks like you (or extension developers) are trying to add css with absolute links. Looking at the source of your page will quickly show you that your links look different from the core links in that they are absolute not relative. You may need to look a the code in the modules doing this and fix or contact the developers and ask them to fix. Also ask them about the js.
In Joomla you add style sheets with code like this in your template index:
$doc->addStyleSheet('templates/'.$this->template.'/css/template.css');
The change in behavior is most likely due to a recent security fix concerning uris in the header. I'm not going to link to details of the exploit but easy enough to find out why this was changed, but it was for good reasons.

Site hosted on dropbox not using CSS

I'm hosting a (very) small website on dropbox. I don't even have a domain name for it, I just need an easy way for my not so technology savvy teacher to access it and using an online service like wordpress or tumblr seemed like too much trouble and not as effective as I would like. I plan on putting it in my public folder and just sending her that link, something I've done in the past to show my friends websites I've made in class.
However, for some reason, CSS formatting isn't working. This is a problem I've noticed in the past but at the time wasn't important. I have it relatively linked in my head tag and it works when I pull up the files saved on my hard drive. Its only when I try to access it through dropbox do I notice this problem.
I've looked and it doesn't seem like anyone else has had this problem, I've only found multiple references to dropbox supporting CSS so I have no idea why this is happening.
This is the link in my code, and it's inside the head tag:
<link rel="stylesheet" type="text/css" href="css/format.css" />
Any help would be much appreciated. ^^
EDIT: Here's the page, there's not much on it yet but there's suppossed to be background formatting behind the navigation links in the top.
https://dl-web.dropbox.com/get/Public/EPortfolio/WritingAndForum.html?w=947f0aa1
To give an example expanding on Cfreak's comment, you would need to individually share the CSS file, then reference it in the HTML like this:
<link rel="stylesheet" type="text/css" href="https://dl.dropbox.com/u/1234567/cssfile.css">
A much easier way (and more correct) is to put your stylesheet in a folder called css and then have a relative link to it with "./" It gets you out of the long url trouble.
<link rel="stylesheet" type="text/css" href="./css/styles.css">

lightbox and slimbox2 doesn't work with composite c1

I'm trying to use both lightbox and slimbox with Composite c1 v3.
Neither works.
I have installed the relevant packages and I have set correctly the parameters for both functions.
The result is that when I use lightbox both thumbnail and the picture appears on the page.
When I use slimbox2, the thumbnail is fine but the picture opens to a new page.
I have tried it both with IE 9 and firefox 9.0.1 with the same result.
As far as Composite C1 is concerned, I'm working on Omnicorp example site.
Anyone with the some kind of problem?
I just tried the Slimbox2 package and it worked for me in Chrome and IE. I had success installing the package, going to a page in Content, and inserting the function. Then I picked the Media Folder parameter, and set it to be a constant and selected a folder path. Once published, the slimbox behaved as expected. I am not working with the Omnicorp demo, however.
The behavior sounds to me like some part of the script isn't loading or is loading in the wrong order. Does the Omnicorp site, or another package have conflicting jQuery import(s) in the head section of a published page?
Looks like the packages have a bug, when site is running in sub-folder the javascripts files are not loaded.
Do you run your site in subfolder?
Try to fix this.
Go to Functions perspective -> Xslt functions -> locate function Composite.Media.ImageGallery.Slimbox2 -> edit its template and fix links to the files, add ~ at the begin:
<script id="slimbox2-js" src="~/Frontend/Composite/Media/ImageGallery/Slimbox-2.04/js/slimbox2.js" type="text/javascript"></script>
<link id="slimbox-2.04" media="screen" type="text/css" href="~/Frontend/Composite/Media/ImageGallery/Slimbox-2.04/css/slimbox2.css" rel="stylesheet" />
also locate function Composite.Web.Html.Lightbox, edit its template and fix links to the files (add ~):
<script id="html-lightbox-js" src="~/Frontend/Composite/Web/Html/Lightbox/js/jquery.html-lightbox.js" type="text/javascript"></script>
<link id="html-lightbox-css" media="screen" type="text/css" href="~/Frontend/Composite/Web/Html/Lightbox/css/html-lightbox.css" rel="stylesheet" />

joomla: how is the CSS generated?

i made a website that looks like this www.yoursdproperty.com
i would like to know how the CSS is generated? where is it generated? how can i edit the settings that generate the CSS?
It's a while since I looked at Joomla, but (once you're logged into it) isn't there a "Template Manager" through which you edit the CSS?
EDIT: Just checked it out via http://www.opensourcecms.com/, it is indeed "Template Manager", under "Extensions" on the main menu. Select your template, then click the "Edit CSS" button on the top right.
I don't think Joomla generates (=compiles) style sheets out of the box.
Look into your source code:
<link href="/templates/system/css/system.css" rel="stylesheet" type="text/css" />
<link href="/templates/system/css/general.css" rel="stylesheet" type="text/css" />
<link href="/templates/pjo_joomlaforall/css/template_css.css" rel="stylesheet" type="text/css" />
you should be able to edit these without problems?
This may be applicable now to users on 1.7 or 2.5. You can edit the CSS in the browser by going to Extension/Template Manager, and then clicking the Templates option (instead of styles). Click on your particular template and all the css files will be listed down the right. Some have alot. As an example, the beez_20 default template has 16 css files. You could download them all and search them for the selectors you are looking for. For beez_20 it is personal.css which has most of them. Source: http://www.itlearning.net
Joomla doesn't make any "automatic generation" of css. The css are in the stylesheets at the url shown.

Resources