Jump to content

Links in stylesheet


Recommended Posts

Help please!I am trying to add link styles across all my pages using an stylesheet but I can't get it to work. It only works if I put it individually to every single page but this is very time consuming especially if I have to make any changes. Thank you.Here is my stylesheet:.wrapper{ margin: 0px auto; width: 900px; background-color: #cccccc;}.header{ float: left; width: 100%; height: 200px; background-color: #6699cc;}.content{ float: left; width: 100%; height: 500px; background-color: #ffffff;}.footer{ float: left; width: 100%; height: 70px; background-color: #6699cc;}body { padding: 10px; margin: 10px; font-size: 90%; background-color: #6699cc;}a:link { color: #CCC;}a:visited { color: #69C;}a:hover { color: #00F;}a:active { color: #CCC;}

Link to post
Share on other sites

Theres 2 ways:<style type="text/css" media="all">@import url(css/stylesheet.css);</style> Or the more 'traditional' way:<link rel="stylesheet" type="text/css" href="css/stylsheet.css" media="screen" />Notice the media attribute, 'screen' is for normal monitors and 'all' is for everything, so that includes mobile devices. While its a good idea to use this, its not mandatory to have it. But its useful for a dedicated printing CSS file, eg: media="print"Both of these tags go into the head section of each page. Just make sure the path is correct to the CSS file. These 2 examples assumes (and you should) stick your CSS in a seperate folder, this time called 'css'.Hope that helps :)

Edited by real_illusions
Link to post
Share on other sites

MANY THANKS, IT HAS WORKED!

Theres 2 ways:<style type="text/css" media="all">@import url(css/stylesheet.css);</style> Or the more 'traditional' way:<link rel="stylesheet" type="text/css" href="css/stylsheet.css" media="screen" />Notice the media attribute, 'screen' is for normal monitors and 'all' is for everything, so that includes mobile devices. While its a good idea to use this, its not mandatory to have it. But its useful for a dedicated printing CSS file, eg: media="print"Both of these tags go into the head section of each page. Just make sure the path is correct to the CSS file. These 2 examples assumes (and you should) stick your CSS in a seperate folder, this time called 'css'.Hope that helps :)
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...