473,406 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

instructions of how to link an external style sheet

7
I’m looking for instructions of how to link an external style sheet file to my html page. Also instructions on where to place the link within the html document.
Feb 24 '10 #1

✓ answered by zorgi

You must place your links to external css itno the head part of your html page and here is the code:
Expand|Select|Wrap|Line Numbers
  1. <head>
  2. <link rel="stylesheet" type="text/css" href="path/to/your/css/file/index.css"/>
  3. </head>
  4.  
Note:
Very good idea is to check source code of the pages you find interesting. You'll find loads of interesting html,css and JavaScript. You can do it by view->source through your browser but for loads more useful information you should really install firebug.

4 1861
zorgi
431 Expert 256MB
You must place your links to external css itno the head part of your html page and here is the code:
Expand|Select|Wrap|Line Numbers
  1. <head>
  2. <link rel="stylesheet" type="text/css" href="path/to/your/css/file/index.css"/>
  3. </head>
  4.  
Note:
Very good idea is to check source code of the pages you find interesting. You'll find loads of interesting html,css and JavaScript. You can do it by view->source through your browser but for loads more useful information you should really install firebug.
Feb 24 '10 #2
Zorgi gave a good idea to including a external CSS file into document.
There is one more idea to including a external CSS file into any documents and that is:

<style type="text/css" media="all">@import "path/to/your/css/file/index.css";</style>

You have to use this into header section of your document. This will also work fine for you.
Feb 25 '10 #3
tharden3
916 512MB
so "style" can be used in any type of page? Not just HTML?
Mar 2 '10 #4
Dormilich
8,658 Expert Mod 8TB
@tharden3
not in any. you can use it in any Markup Language*, as long as it is not violating the syntax and/or validation rules. whether it makes sense or has any effect on the document is questionable, though.

* – of the XML and HTML family, maybe even SGML.
Mar 2 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Richard Speiss | last post by:
I am trying to display a random background image for a webpage. I found this code to do it <% 'Defines the number of background images you have Const NUMBER_OF_IMAGES = 2 'Initiates the...
6
by: Mark | last post by:
Hi - in my current pages, I have: <link href="styles.css" rel="stylesheet" type="text/css"> What I would like to do is: <!--#include file="config.asp" --> <!--#include file="styles.asp" --> ...
5
by: Dave Mausner | last post by:
the html 4.01 standard says i can use: <link type="text/css" href=file-name> to include a style section. questions: 1. does the external style sheet have to contain <html> ... </html>? 2. does...
7
by: steven | last post by:
Which one is better: <link rel="stylesheet" href="style.css" type="text/css" /> or <style type="text/css"> @import url("style.css"); </style>
0
by: Andrea | last post by:
Hi everyone. I'm working on a navigation menu (in a frameset) that I want to set the "active" link to black (the link that corresponds to the page displayed in the right side of the frame) to...
5
by: Janet | last post by:
The following html code appears in an ASP page. The hyperlink is set to white (see the page link color), but when the page renders in IE 6.0, it initially appears in maroon with a white border...
4
by: news.internode.on.net | last post by:
Is there any way that a STYLE attribute can be used to control the color of hyperlinks. We have a tabular output generator written in C#. Each column of the table is defined by a column, and...
14
by: Stapes | last post by:
Hi I have this entry in my stylesheet main1.css: #head { width: 310px; height: 60px; float: left; display: block; background-image: url(logo.jpg); background-position: left top;
2
by: David W | last post by:
I need to include a style sheet link in the aspx page based on what user they are. Basically this functionality, but using code behind. Any idea how to change this line to code behind? This...
4
Frinavale
by: Frinavale | last post by:
So a while ago I created a Tab Strip Control (before the AjaxToolkit had theirs otherwise I would have probably just used theirs). When I looked at the AjaxToolkit control to see how they got...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.