English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

This year I've decided to take an HTML class, but I'm having trouble with one of the assignments... I need to make a linked style sheet, but it doesn't seem to be working. I'm using TextWrangler and I set up the CSS sheet using the format ".CSS"... So that isn't the problem. Any advice? Thanks!!

2007-12-17 07:00:22 · 6 answers · asked by Anonymous in Computers & Internet Programming & Design

6 answers

There are two ways to link your external CSS with your HTML document. Link the CSS Style Sheet with href attribute or use import method within the style tag. You should also know the word cascading means flow. So, link method and import method has different flow precedence. Fallow this recipe:

1. Create a HTML document.

2. Understand media types. Example: screen - computer screen and print - HTML page in print. You could include both or more. If you include both media types. The user who uses computer screen to view your HTML page with a browser will receive information of your media type and display only the style of media type with screen. However, when the user click on print the browser will choose the media type of print. So when users print your page the page is display in another style. It might be style suitable for print documents. Example:






CSS

















Remember, if your print CSS has the same style with your screen CSS. You won't be able to see the difference when you click on print. For now you could make a simple change by making the background color of your print CSS red and your screen CSS background color to blue. So when you click print the background color of your page should be red instead of blue.

2007-12-17 21:08:43 · answer #1 · answered by Hello World 2 · 0 0

No idea about TextWrangler, but you need this line:



It needs to be in the part of the code, I usually tuck it right under the . The path can be local, relative or fully qualified, i.e.<br /> yourstylefile.css<br /> /styles/yourstylefile.css<br /> http:// www.yoursite.com/yourstylefile.css<br /> ^ space added after the http to stop advertising a web hosting company </p> <p> <small> 2007-12-17 15:08:15 · <a href="#answer20071217150815">answer #2</a> · <span>answered by <u>Anonymous</u></span> · <span>0<span style='color:green;'>⤊</span></span> <span>0<span style='color:red;'>⤋</span></span> </small> </p> </div> <div id="answer20071217150540" class='answer' > <!-- <b>Answer #3</b> --> <p class='answer-content' lang="en"> Put this in the <head> area of the web pages you want the stylesheet linked to:<br /> <br /> <link href="mystylesheet.css" rel="stylesheet" type="text/css"><br /> <br /> bear in mind that the path to "mystylesheet.css" will change if your HTML files are in different folders than your css file. </p> <p> <small> 2007-12-17 15:05:40 · <a href="#answer20071217150540">answer #3</a> · <span>answered by <u>StevenLmas</u> <b>1</b></span> · <span>0<span style='color:green;'>⤊</span></span> <span>0<span style='color:red;'>⤋</span></span> </small> </p> </div> <div id="answer20071217151235" class='answer' > <!-- <b>Answer #4</b> --> <p class='answer-content' lang="en"> Link the style sheet in the <head> tag... put it after the <title>... and before the closing . I wrote an example below.






Linked Styles





2007-12-17 15:12:35 · answer #4 · answered by tyson c 1 · 0 0

In the section of your html document:

2007-12-17 15:08:44 · answer #5 · answered by daa 7 · 0 0

try this








I am formatted with a linked style sheet


Me too!




2007-12-17 15:04:49 · answer #6 · answered by Lexie Handley 1 · 0 0

fedest.com, questions and answers