Connecting Tech Pros Worldwide Forums | Help | Site Map

CSS and Tags

NEWS
Guest
 
Posts: n/a
#1: Dec 23 '05
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
Guest
 
Posts: n/a
#2: Dec 23 '05

re: CSS and Tags


NEWS wrote:
[color=blue]
> 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?[/color]

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
Guest
 
Posts: n/a
#3: Dec 23 '05

re: CSS and Tags


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

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)
NEWS
Guest
 
Posts: n/a
#4: Dec 23 '05

re: CSS and Tags



"NEWS" <antispam@nospam.com> wrote in message
news:g3Zqf.4699$AP5.4376@edtnps84...[color=blue]
> 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?[/color]

In the HTML file use


<div class="fBr">
These are tests
</div>


NEWS
Guest
 
Posts: n/a
#5: Dec 23 '05

re: CSS and Tags



"Els" <els.aNOSPAM@tiscali.nl> wrote in message
news:18vg21pxt8tle.dlg@locusmeus.com...[color=blue]
> NEWS wrote:
>[color=green]
>> 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?[/color]
>
> 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 -[/color]


NEWS
Guest
 
Posts: n/a
#6: Dec 23 '05

re: CSS and Tags



"Johannes Koch" <koch@w3development.de> wrote in message
news:43ac6b9d$0$93403$892e7fe2@authen.yellow.readf reenews.net...[color=blue]
> NEWS wrote:[color=green]
>> body.Wyght
>> {[/color]
> [...][color=green]
>> link color: red; /* unvisited links */
>> visited color: blue ; /* visited links */
>> hover color: yellow; /* user hovers */
>> active color: lime; /* active links */
>> focus background: yellow;
>> }[/color]
>
> 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)[/color]


Closed Thread