 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

May 6th, 2004, 03:09 PM
|
|
Authorized User
|
|
Join Date: Nov 2003
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Css for only one tag and only for links
I want to create a css(Cascading Style Sheet) in Dreamweaver that will affect two things:
- A tag that I will select
- Only hyperlinks through the text
I want to specify that all links will have this color, this size, the color when are visited etc.
All my efforts untill now were not succesful because it did not affect only the hyperlinks but the other text too, eventhoug I selected a tag. So, only one tag (maybe a td of a table) and only links(no other text), this is what I need.
So can you please tell me how to go through the menus to achive my goal?
|
|

May 6th, 2004, 03:12 PM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
Why not code it directly? It's very easy:
<style type=text/css>
/* affect only td elements */
td { /* td settings */ }
/*normal links*/
a {color:#c0c0c0;}
/*visited*/
a:visited {color:#eeeeee;}
/*hover (onmouseover) */
a:hover {color:#808080;}
</style>
HTH,
Snib
<><
|
|

May 6th, 2004, 03:20 PM
|
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Karib:
I am assuming you solved the other problem.
You can create a style sheet through the CSS Styles panel (which is part of the Design Panel Group.
Once there, you click on the + icon for a new style. A Tag style will be for one particular tag (i.e. td) and a class style will be a style that can be applied to any tag that you want.
The only other decision you need to make is whether the style will be for this document only (this is an embedded style and will be built within the <head> </head> tags. An external style is saved in its own document and and has the extension of css. That can be applied to any document.
Once you select OK, you will be taken to a dialogue box where you can setup your specifications.
For the links, you can either set them up using Page Properties or, using the Advanced option in the CSS opening dialogue box. If you select Advanced, you will see the various link options in the dropdown box.
Let me know if this helps,
Charles
Charles E. Brown
Author - Beginning Dreamweaver MX, Fireworks MX - Zero to Hero
Contributor - Macromedia Studio MX Bible
|
|

May 6th, 2004, 03:23 PM
|
|
Authorized User
|
|
Join Date: Nov 2003
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks for your response.
The code you wrote affected all links in the page!
So, just imagine, my navigation links just blown away.
So this is not the case.
Navigation links should be unaffected but all other links should be affected.
The links that should be affected are in a table cell, I usually select the td tag.
Except from this, I wanted to do it through Dreamweaver's menus so If need to change something I would know what to change and where. This not happens with code lines.
So, can I have a step by step instruction to Dreamweaver menu? And keep affecting only the links of a spicific tag.
Thanks in advance
|
|

May 6th, 2004, 03:28 PM
|
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
If you go to the CSS panel, as I outlined in my last post, and use advanced, you can setup contextual pairs for CSS
For instance, if you want to apply the style to only anchors embedded in a table tag, you might want to use:
table a
as the Advanced identifier.
Notice that there is no comma between them.
Charles E. Brown
Author - Beginning Dreamweaver MX, Fireworks MX - Zero to Hero
Contributor - Macromedia Studio MX Bible
|
|

May 6th, 2004, 03:31 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
If you want to affect only part of your links, you could wrap them in a <div>, and then apply the styles to just <a> tags inside that div.
For example:
Code:
<div id="MainMenu">
<a href="1.html">Menu 1</a><br />
<a href="2.html">Menu 2</a><br />
</div>
<div id="Content">
This is the content with a <a href="Something">normal</a> link.
</div>
Now, if you want to change just the links in the menu, try this contextual selector:
Code:
<style type="text/css">
#MainMenu a
{
color: green;
background-color: yellow;
}
</style>
This makes sure that only <a> tags that fall within the MainMenu div get a green color and yellow background.
Is this what you're after?
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

May 6th, 2004, 03:36 PM
|
|
Authorized User
|
|
Join Date: Nov 2003
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
à just created a new ccs through it's panel. I selected contexual.
For my situation what about the tag I have to choose (to affect it exclusively)?
Do I have to see it from the bottom of the Design Window and then write it somewhere exactly?
Thanks in advance
|
|

May 6th, 2004, 03:42 PM
|
|
Authorized User
|
|
Join Date: Nov 2003
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I would appreciate if you could tell me these steps through css panel, where to go, what to select, what to write.
Thanks in advance
|
|
 |