This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > December 2005 > CSS and Tags





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author CSS and Tags
NEWS

2005-12-23, 6:34 pm

if I want to change a tag with CSS with a file rather than having all the
CSS code on the HTML doc I know I can do the following

<SNIPPET>
body.Wyght
{
background-color: #D9D9FF;
border: 50px;
border-color: #A000B2;
font-family: cursive;
link color: red; /* unvisited links */
visited color: blue ; /* visited links */
hover color: yellow; /* user hovers */
active color: lime; /* active links */
focus background: yellow;
}
div.fBr
{
background-color: transparent;
float: right;
font-size: 125%;
font-family: fantasy;
color: #3300B2;
}
div.sGr
{
background-color: transparent;
float: right;
font-size: 125%;
font-family: serif;
color: #005B38;
}
div.cYr
{
background-color: transparent;
float: right;
font-size: 125%;
font-family: cursive;
color: #D4D400;
}
</SNIPPET>

Then I can use


<link href="../CSS/testStyle.css" rel="stylesheet" type="text/css">

if testStyle.css is the file

How do I use this in the HTML file?


Els

2005-12-23, 6:34 pm

NEWS wrote:

> if I want to change a tag with CSS with a file rather than having all the
> CSS code on the HTML doc I know I can do the following
>
> <SNIPPET>
> </SNIPPET>
>
> Then I can use
>
> <link href="../CSS/testStyle.css" rel="stylesheet" type="text/css">
>
> if testStyle.css is the file
>
> How do I use this in the HTML file?


Put the styles in a styleblock in the <head> of the HTML file, like
so:

<style type="text/css">
body{
background:red;
color:green;
}
</style>

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Johannes Koch

2005-12-23, 6:34 pm

NEWS wrote:
> body.Wyght
> {

[...]
> link color: red; /* unvisited links */
> visited color: blue ; /* visited links */
> hover color: yellow; /* user hovers */
> active color: lime; /* active links */
> focus background: yellow;
> }


No, that's syntacically incorrect. Write

body.Wyght a:link {
color: red; /* unvisited links */
}
body.Wyght a:visited {
color: blue; /* visited links */
}
body.Wyght a:hover {
color: yellow; /* user hovers */
}
body.Wyght a:active {
color: lime; /* active links */
}
body.Wyght a:focus {
background: yellow;
}

instead.
--
Johannes Koch
Spem in alium nunquam habui praeter in te, Deus Israel.
(Thomas Tallis, 40-part motet)
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews