This Message Forum is no longer in use

Please use the new Bravenet Help Forums FOUND HERE

General Forum
This Forum is Locked
Author
Comment
I have a HTML file and a CSS file, how do I get them to work together on the text editor?

Like the subject says, I have a my HTML file and my CSS file for it, but I don't know how to make my HTML file know where the CSS one is to use it. I have a index.html page in the text editor and a style.css file in there two, separately, how do I make it work? Thanks!

Browser: princessofdarkness5000@hotmail.com,3

Re: I have a HTML file and a CSS file, how do I get them to work together on the text editor?

The HTML file should have a tag that references the CSS file between the and tags. This tells the HTML file to read the CSS file and use the definitions. A link tag would look something like the following:



It the case above, the CSS file is expected to be in the same folder as the HTML file. If it is in another folder, the link reference needs to specify the folder name as well. As an example, the templates in the Template Gallery commonly store the CSS file in the same folder as the template images. For them the tag might look like the following.



But when you do it this way, you need to be careful about specifying images. Any images that might be specified for say, backgrounds, are specified relative to the CSS file, not to the HTML file.

Re: I have a HTML file and a CSS file, how do I get them to work together on the text editor?

The css file is referenced in the header. The following is an extract from the tutorial at W3schools.

How to Insert a Style Sheet

External Style Sheet

An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing one file. Each page must link to the style sheet using the tag. The tag goes inside the head section:

href="mystyle.css" />