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

Two boxes with diffrent Styles for <a href>

Hallo!
(Soory for my english ;-) )
I have create a style like this:

a:link { text-decoration:none; font-weight:bold; color:red; }
a:visited { text-decoration:none; font-weight:bold; color:#ff0033;}
a:hover { text-decoration:none; font-weight:bold;
background-color:#FFF000; }
a:active { text-decoration:none; font-weight:bold;
background-color:#CCFFFF; }

Also I have create a few boxes like:
#box1 { position:absolute; top:0px; left:0px; width:200px; height:200px;
z-index:1; background-color:#FFFccc; }

/* box 2 = Menuleiste */
#box2 { position:absolute; top:200px; left:0px; width:200px; height:auto;
z-index:2; background-color:#000666}
My Question:
is it possible to create a spezial Definition for a spezial box, so that in
box1 Links are coloured red (a:link {color:red; })
and in box2 Links are coloured blue

Frank
Jul 21 '05 #1
3 5668
Frank Reintgen wrote:
Also I have create a few boxes like:
#box1 { ... }

/* box 2 = Menuleiste */
#box2 { ... }

My Question:
is it possible to create a special definition for a special box, so that in
box1 links are coloured red (a:link {color:red; })
and in box2 links are coloured blue


Use styles like this:

#box1 a:link { color: red; }
#box1 a:visited { ... }
....
#box2 a:link { color: blue; }
....

--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://SpreadFirefox.com/ Igniting the Web
Jul 21 '05 #2
Lachlan Hunt wrote:
Use styles like this:

#box1 a:link { color: red; }
#box1 a:visited { ... }
...
#box2 a:link { color: blue; }


Sorry but this doesn't work.

ButI try to use "classes" and this works:
a.box { text-align:center; text-decoration:none; vertical-align: top; }

a.box:link { color:blue; background-color:transparent; }
a.box:visited { color:blue; background-color:transparent; }
a.box:hover { color:blue; background-color:white; }
a.box:active { color:#ff0; background-color:#a03; }

Thank you for help

Frank
I Use cl
Jul 21 '05 #3
in comp.infosystems.www.authoring.stylesheets, Frank Reintgen wrote:
Lachlan Hunt wrote:
Use styles like this:

#box1 a:link { color: red; }
#box1 a:visited { ... }
...
#box2 a:link { color: blue; }
Sorry but this doesn't work.


Yes it does. You just had mistake somewhere, which we can't know whitout
URL. Are you sure you didn't change your html?
ButI try to use "classes" and this works:
a.box { text-align:center; text-decoration:none; vertical-align: top; }

a.box:link { color:blue; background-color:transparent; }
a.box:visited { color:blue; background-color:transparent; }
a.box:hover { color:blue; background-color:white; }
a.box:active { color:#ff0; background-color:#a03; }


But now you need to add class to every A element. Not good idea.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Jul 21 '05 #4

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

Similar topics

2
by: Gregor Horvath | last post by:
Hi, Before I reinvent the wheel I`d like to ask if someone has done this before since I did not find an advice at Google. The goal is to create a dynamic Tree View in HTML. Say I have a...
6
by: snacktime | last post by:
I've searched and searched and have not found a solution to suppress the margin on form or href tags so that there is no space before or after the tag. The only way I have found to do this is to...
5
by: specjal | last post by:
hi in form TEXTAREA i have text like: bla bla http://www.google.com/bla/bla/bla text text text text now how to make from this text like: bla bla text text text text
13
by: tperri | last post by:
I have an HTML table with several fields like this: <A href="Savings.aspx?category=Food"><asp:imagebutton id="imgFood" ImageUrl="images\buttons\btn-food-i.gif"...
1
by: rn5a | last post by:
Consider the following code: <script runat="server"> Sub Page_Load(obj As Object, ea As EventArgs) Dim sqlReader As SqlDataReader sqlReader = 'calling a function that returns SqlDataReader ...
3
by: ajaspersonal | last post by:
"i want to change font_style (hyper link<a href...>text</a>) normal to italics.when load a page" this is my problem but that label included in one 'USERCONTROL' This user controls may...
8
by: Prisoner at War | last post by:
Another weekend, another project, another problem.... Why should a perfectly fine function work only half-way through when called through onClick in an anchor tag?? The text fade-in script...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.