473,397 Members | 1,961 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,397 software developers and data experts.

CSS and Tags

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?
Dec 23 '05 #1
5 1315
Els
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 -
Dec 23 '05 #2
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)
Dec 23 '05 #3

"NEWS" <an******@nospam.com> wrote in message
news:g3Zqf.4699$AP5.4376@edtnps84...
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?


In the HTML file use
<div class="fBr">
These are tests
</div>
Dec 23 '05 #4

"Els" <el*********@tiscali.nl> wrote in message
news:18***************@locusmeus.com...
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 -

Dec 23 '05 #5

"Johannes Koch" <ko**@w3development.de> wrote in message
news:43***********************@authen.yellow.readf reenews.net...
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)

Dec 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: varois83 | last post by:
Hi I am fairly new to PHP/mysql and was reading an online tutorial and learned that my short tags weren't enabled. At this time I have no need for them, my setup apache/mysql/php runs on my PC...
0
by: Philippe Poulard | last post by:
People that have a knowledge of XQuery, XSLT, Ant, JSP/PHP/ASP, Cocoon, XMLBeans, taglibs and many others should recognize any of them in "Active Tags". " Active Tags is a set of specifications...
24
by: Day Bird Loft | last post by:
Web Authoring | Meta-Tags The first thing to understand in regard to Meta Tags is the three most important tags placed in the head of your html documents. They are the title, description, and...
7
by: Jasper Bryant-Greene | last post by:
I have three tables: `photos`, `tags` and `tags_photos`. The `photos` table contains a unique ID and a bunch of other stuff, the `tags` table contains a unique ID and a tag name, and the...
1
by: Jenny | last post by:
Hi, Can I create an array of tags by assigning same name to these tags? For example, I have two <p> tags with the same name t1. But document.all.b.value=document.all.t.length does not...
12
by: Oberon | last post by:
I have a large HTML document. It has hundreds of <span>s which have no attributes so these <span>s are redundant. How can I remove these tags automatically? The document also has <span>s with...
12
by: Stefan Weiss | last post by:
Hi. (this is somewhat similar to yesterday's thread about empty links) I noticed that Tidy issues warnings whenever it encounters empty tags, and strips those tags if cleanup was requested....
23
by: Big Bill | last post by:
http://www.promcars.co.uk/pages/bonnie.php I don't believe they should be there, can I take them out without stopping the includes from functioning? I'm the (hapless) optimiser on this one... I...
3
by: Paul Moore | last post by:
I'd like to write some scripts to analyze and manipulate my music files. The files themselves are in MP3 and FLAC format (mostly MP3, but FLAC where I ripped original CDs and wanted a lossless...
1
by: arrival123 | last post by:
Hello, I'm currently trying to decide on a database design for tags in my web 2.0 application. The problem I'm facing is that I have 3 separate tables i.e. cars, planes, and schools. All three...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.