Hi all,
Firstly nice site. Found this very useful with lots of information.
As the title suggests I want to have different CSS rules for my text links but it seems I can only have one.
I know how to change the default link attributes, like hover, visited etc etc but I want to have a few different colors for my text links.
I'm using Dreamweaver 8
Can someone tell me how to achieve this? I have searched everywhere but cant find a solution.
Thanks all
Use classes. Then you can
Use classes. Then you can have as many different rules as you'd like.
Hi thanks for the reply, I
Hi thanks for the reply,
I just made a new CSS class rule called .link1 and assigned my text to it but as soon as I typed a url link in the properties inspector the text went back to the default link type.
Am I doing something wrong?
What program are you using
What program are you using to do your code? Please don't say frontpage.
LokiLoks
lokiloks wrote:What program
What program are you using to do your code? Please don't say frontpage.
LokiLoks
As mentioned in my initial post above, I'm using Dreamweaver 8.
Code?
? is Css code
Please mention your css code.I think U got worng class in your css code
zwemg wrote:... Am I doing
... Am I doing something wrong?
First thing is using dreamweaver, that's rarely right.

Are you looking at the page in a browser or in the dreamweaver design panel?
I would suggest using more descriptive class names. link1 has no real meaning. Then as thepineapplehead pointed out we need to see your code. All of it. Not just snippets, not just the css.
Your answer is: Select the
Your answer is:
Select the link, right click on the tag across the bottom, choose quick tag editor, type in class="pdflink" (or whatever you want to name the class) and press return.
Next right click in the CSS styles area in the top right and click new style.
Either go to advanced and type in .pdflink or leave it on class and type in pdflink.
Style using the dialogue box.
done
Hope that helps,
LokiLoks
Sorry I didn't see the dreamweaver 8 in the first post, or I'd have been able to help from the get go.
Yuck! then learn to hand
Yuck! then learn to hand code the stylesheet and be amazed at how much easier it is and faster, the more you free yourself from the applications methods the better the coder you will become.
proprietary app instructions on a CSS forum :mad:
Hugo wrote:Yuck! then learn
Yuck! then learn to hand code the stylesheet and be amazed at how much easier it is and faster,
It wouldn't ever be easier or faster to hand code that! :mad:
the more you free yourself from the applications methods the better the coder you will become.
I find that if you free yourself from wasted time hand typing code by using a tool that easily and efficiently does the same exact thing.
I hand code very well, and quite fast, but I'd still end up taking 800% longer to hand code this example.
There's simply no need for me to hand type out font family and other wordy tags every time.
proprietary app instructions on a CSS forum :mad:
Dreamweaver isn't the bane of coding like it used to be. There aren't extraneous tags unless you use features like templates. Its CSS tools are quite efficient and create lean, properly formatted code in less time.
I will grant you, however, that unless the OP figures out how to hand code CSS they will continually make errors and poorer quality code.
LokiLoks
lokiloks wrote:Hugo
Hugo wrote:Yuck! then learn to hand code the stylesheet and be amazed at how much easier it is and faster,
It wouldn't ever be easier or faster to hand code that! :mad:
I don't know. I counted 9 steps in your example versus 2 steps via handcoding.
Add class="whatever" to anchor tag.
Add .whatever {css definition here} to css file.
done.
lokiloks wrote:Your answer
Your answer is:
Select the link, right click on the tag across the bottom, choose quick tag editor, type in class="pdflink" (or whatever you want to name the class) and press return.
Next right click in the CSS styles area in the top right and click new style.
Either go to advanced and type in .pdflink or leave it on class and type in pdflink.
Style using the dialogue box.
done
Hope that helps,
LokiLoks
Sorry I didn't see the dreamweaver 8 in the first post, or I'd have been able to help from the get go.
lokiloks thanks so much for your clear instructions. That worked a treat!!
Turns out I didnt realise I had to make a class first. I thought I could just apply a new css rule.
Excellent, cheers mate.
Dreamweaver = Satan ;)
Yeah, I've got to say, Dreamweaver might get things done, but it sure as hell doesn't generate the simplest, most precise code. I've always been a hard coder, but recently got hired to work on a site that was previously done entirely with Dreamweaver by someone who knew zero code. I wound up having to delete it and code the entire bloody thing from scratch, because Dreamweaver's code, while the site had LOOKED fine, was WAY too convoluted to actually edit in a reasonable way.
Sorry Lokiloks but your
Sorry Lokiloks but your example can in no way be considered more straightforward than writing to or editing an simple text file which is what stylesheets are.
My objection - and I have raised and debated it countless times in the past on the forum - is that apps such as DW are misleading and attempt to lock people into their methodology, they promote bad habits , and a lack of understanding as to how to code , but hey it's everyones choice how they approach the job in hand I'm not that concerned as long as I don't have to clean the mess up
Hugo: I would say this:
Hugo:
I would say this: Dreamweaver is a great tool for those who know how to code by hand already and know where to take advantage of its shortcuts instead of being dependant on them.
Don't get me wrong, I don't think that a noob with a fresh copy of CS3 can make anything worth a damn. I do think, however, that experienced developers shouldn't have to manually type out lines of code when another solution is perfectly good at it.
Add class="whatever" to anchor tag.
Add .whatever {css definition here} to css file.
done.
Um, your example isn't as simple as that, it's actually these steps:
navigate your cursor to inside the tag you want to modify.
type class="example" and make sure you have a space before and after it.
pull up the file: open command
browse to the css file
click open
press end
type .example {
type each individual attribute you're going to use letter by letter
type each individual attribute value you're going to use letter by letter
don't forget the colon, the semicolon, and the quotes when you're using these specific attributes.
oh then close it with a }
There's 10 steps, and in my example there's actually 6 actions but if you want to nitpick you could count the number of steps to browse to the css file for your example and you could probably get mine up to 9 oh yeah, you did.
In my example, however I didn't do the most efficient, I did the easiest to convey the message and instruct the reader.
The most efficient would be:
Right click in the css area & select new.
Type a class name
Set the attribs you want & click ok.
Right click the tag and select the CSS style you just made.
Four steps.
Seriously, do you really think manually typing each class & attribute & each value for each attribute is efficient? If so, consider this, some people who truly appreciate the value of a manual transmission refuse to admit that a standard transmission is more fuel efficient for daily use. In specific, highly attentive driving circumstances it may be, but for most general use, it's less efficient.
Being a great CSS coder means you can do things that the WYSIWYG's can't but it doesn't mean that you shouldn't let a program do mundane jank for you.
Don't hate me for using a WYSIWYG.
LokiLoks
lokiloks wrote:navigate your
navigate your cursor to inside the tag you want to modify.
type class="example" and make sure you have a space before and after it.
pull up the file: open command
browse to the css file
click open
press end
type .example {
type each individual attribute you're going to use letter by letter
type each individual attribute value you're going to use letter by letter
don't forget the colon, the semicolon, and the quotes when you're using these specific attributes.
oh then close it with a }
I really don't care what you use to do your work or if you think its more efficient. Enjoy. Most of us don't see the point of using anything but Emacs or BBEdit. I think you're really making too big of a deal out of all of this. If you love dreamweaver fine. Everyone else is also allowed their opinion and have mostly at one time or another used dreamweaver and found it useless.
I agree that everyone is
I agree that everyone is allowed their opinion. However if someone makes a claim that my procedure takes "9" steps theirs takes only two they're being intellectually dishonest. The steps to hand code css always take at least these steps that make it less efficient:
1. You have to type the attribute without typos. You don't have to type attributes in dreamweaver and if you prefer to hand code in it, you can start typing the attribute and dreamweaver will offer auto-complete options as you type which is certainly more efficient. (this is not true for hacks and a few attributes that aren't standard W3C)
2. You have to type the class/id in the tag you're styling without typos each and every time you add a class/id. In dreamweaver you type Class/ID names once when you make the css and you can use auto-complete or select from a dropdown that can even display some of the styling so you have a clear idea which one you're selecting if you happen to have similar class names.
Let me be perfectly clear on this, Triumph. I hold no ill will towards you or Hugo or anyone else that disliked Dreamweaver; nor do I have any impression that you are anything less than a saavy CSS coder with a keen intellect. That being said, your whole response is invalidated by one sentence: "I don't know what you mean..."
For those that want to read my rant debunking Triumph's sarcastic jibes at my post, continue below. If you don't like rants, stop now.
navigate your cursor to inside the tag you want to modify.
Does dreamweaver know where you want the class applied without you navigating to something? How does that work?
I can click on a tag that's shown within the heirarchy of tags alone and not in the middle of a bunch of other html so I'd say it works a lot better than having to scroll or read through lines and lines of HTML to find the tag I want.
type class="example" and make sure you have a space before and after it
Are you serious?
Yes, I'm quite serious. Are you saying you've never made a typo doing your CSS and cost yourself time? I have, but not as often since I started to use dreamweaver. Not having to type as much will do that.
pull up the file: open command
Why wouldn't it already be opened if I'm working on it?
Because you had the HTML file open. Assuming you have the CSS in a seperate file, that means opening that window. Perhaps you alt tab to it, or mouse to another monitor, or take some other action to switch to the CSS file. Bottom line, hand coders have an additional step here. It may be small, but it adds up because you do it over and over and over and over.
It's in the same window as the markup file? No browsing.
Wow, you're not external CSS files? So you have duplicate CSS code in each file? I doubt it, as far as I remember your posts are representative of someone who is very skilled in CSS.
click open
It's already open as well.
If you're adamant that you don't use external stylesheets that means you'll have to navigate through all your code to get to the CSS area instead. Regardless, I don't have to do either, I can edit the CSS on the same screen as my HTML.
press end
Why would I do that?
So that you're not putting new CSS at the beginning of the file. Most people add new tags at the end or at least somewhere other than the front of the CSS file, but I get it, you've already got the thing open so you don't have to do this step.
type .example {
type each individual attribute you're going to use letter by letter
type each individual attribute value you're going to use letter by letter
don't forget the colon, the semicolon, and the quotes when you're using these specific attributes.
oh then close it with a }
Hmmm. You don't type your attributes out or name classes in dreamweaver?
You type class names 1 time, and you never have to type out attributes. You CAN, but you don't HAVE to.
How does that work? Does it have dropdowns with choices? I know I can type an attribute much faster than selecting one from a dropdown, but I don't know what you mean so :shrug: moving on...
It works in many different ways, any one of which would be faster than the hand coding if you did know what I mean. You trying to make the case that it's more efficient to not use Dreamweaver when you "don't even know what I mean". This is again, intellectually dishonest. I've hand coded, and I am very fast at it, when tested I type over 80 words per minute with 100% accuracy, and still I would prefer to not have to type "border-left-width:" every time I want to set that attribute. Even if I did prefer to type it I know it's a fact that I could click on a box to enter in the value for that attribute a lot faster than I could type it.
I really don't care what you use to do your work or if you think its more efficient. Enjoy.
I don't mind you preferring to hand code either. I don't just think it's more efficient I KNOW it is, because I've done it both ways and I'm much faster with it than without it. If you actually used the program instead of making baseless arguments you'd know it too.
Most of us don't see the point of using anything but Emacs or BBEdit.
Most people thought the world was flat at one point in time, did that make it true?
I think you're really making too big of a deal out of all of this.
I offered the assisance that a fellow dreamweaver user asked for and was then sneered at by those around me because I did so. Add to that, a FALSE claim was made that hand coding is easier and faster. Further, you attempt to discredit me without even "knowing what I mean".
If you love dreamweaver fine.
I don't "Love" dreamweaver but I do disdain those that spread lies. Dreamweaver isn't Satan and it IS easier to do css with it instead of hand coding.
Everyone else is also allowed their opinion
Including me. Also, however, facts do exist, and it is a FACT that typing each attribute by hand over and over and over is LESS efficient than having dreamweaver do it for you.
[most of us] have at one time or another used dreamweaver and found it useless.
Those that tried earlier versions of Dreamweaver practically used a different program. So if "at one time or another" means 3 years ago their assessment is irrelevent. Also, I would wager that few die hard Emacs or BBEdit users will give dreamweaver a real chance because they're set in their ways. Similarly, my preference for Dreamweaver leads me to have a relatively baseless negative view towards the new microsoft WYSIWYG.
There's a bias against dreamweaver IN MY OPINION.
I beleive it comes from these points of contention:
To which I reply:
LokiLoks
For the record, regarding
For the record, regarding typos, notepad 2 has excellent CSS syntax highlighting.
If you type an attribute properly (eg float:) in notepad2 it colours it light blue. If you make a typo (eg flota:) it doesn't. It makes it VERY easy to spot typos, especially if you type on a dark-grey background.
Also for the record, keyboard shortcuts > all.
Example:
navigate your cursor to inside the tag you want to modify.
type class="example" and make sure you have a space before and after it.
pull up the file: open command
browse to the css file
click open
press end
type .example {
type each individual attribute you're going to use letter by letter
type each individual attribute value you're going to use letter by letter
don't forget the colon, the semicolon, and the quotes when you're using these specific attributes.
oh then close it with a }
would be done by me as:
right click HTML file > edit (opens it in notepad2)
Use <CTRL> and right arrow to the tag
type class="example" (a 1 second jobby, notepad2 highlighting picks up if there is no space)
<alt><tab> to CSS file
<ctrl><end>
type .example {} ( both in one go, quicker! - two second jobby)
type each individual attribute you're going to use letter by letter (again, a two second jobby helped by syntax highlighting)
but each to their own, as they say.
I also find it MUCH quicker when posting code on this forum to manually type
<code>
</code>
than it is to click on the code button at the top.
/edit
we've got Macromedia 8 suite packaged up at work (the last version iirc before they were bought out by Adobe) and Dreamweaver is actually pretty decent at making good code.
oh dear what did I start
oh dear what did I start :rolleyes:
I'm very bad and should not have ranted, although it was said in partial jest!
Very nice well reasoned post lokiloks, I guess Triumph has a final right to reply then we ought to draw a line under things
FWIW I do understand where you're coming from but will always harbour a somewhat vitriolic hatred of DW and the gang, as I think you mentioned I just wish people could be prevented from using these apps untill they had learnt the first thing about coding, then by all means go ahead.
It's a dog pile
Most of us don't see the point of using anything but Emacs or BBEdit.

@lokiloks: At the risk of unmercifully piling on, it is extremely rare that using any pointer based application is faster than keeping your hands on the keyboard of a good text editor.
It is much faster, compared to moving your hand to the mouse and finding the right icon or dropdown to click, to simply type alt-[enter] and have <p>|</p> inserted (where the | is your cursor point, all ready to add content.
Already have the content pasted? Move the cursor to either end of the region, and type ctl-[space] to set a mark, move to the other end and type ctl-u alt-[enter], and have
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In vitae.
</p>
How about adding a list? Type ctl-c ctl-l u to get this
<ul>
<li>
</li>
</ul>
Or, ctl-c [tab] a to get
<img src="|" alt="" height="" width="" align="">
Or, ctl-c ctl-a l to get
<a href="|" ></a>
Three key strokes, how long does that take?
Don't remember the key binding? Type <bl (enough to be unique, but if it's not enough, a list of possible completion are offered), then esc [tab] to get <blockquote>|</blockquote>.
There is nothing that slows productivity more than going back and forth between keyboard and pointing device. Even without the key bindings that insert tags and move the cursor to the point where you want to start typing, typing is still faster than finding the right icon to click or clicking a dropdown, scrolling to the desired object and clicking.
These examples are from Emacs, which is the most powerful text editor in existence. I'm sure there are other editors with similar capabilities for html.
Okay, dog pile is over; everyone back to their benches.
cheers,
gary
As is usual with me, I start
As is usual with me, I start a reply then go off to do something else then return to finish it, only to find 'lebendy-seben intermediary comments.
I need to respond to this, however:
Triumph wrote:It's in the same window as the markup file? No browsing.
Wow, you're not external CSS files? So you have duplicate CSS code in each file? I doubt it, as far as I remember your posts are representative of someone who is very skilled in CSS.
lokiloks wrote:click open
Triumph wrote:It's already open as well.
If you're adamant that you don't use external stylesheets that means you'll have to navigate through all your code to get to the CSS area instead. Regardless, I don't have to do either, I can edit the CSS on the same screen as my HTML.
Probably most of us simply have the css and html open in adjacent panes in the editor window. The css can be in a separate file or embedded[1] in the html file. Even if it's in a single file, it doesn't matter because I can open that same file in two synchronized panes. Alter in one, the other pane is updated
Further, you made mention of putting new rules at the end of the stylesheet, if I read you rightly. I find that to be a particularly bad practice. There are too many opportunities for error in the cascade. I organize my stylesheets. Any given selector and its rules will always have a fairly specific spot in which it will live. This insures against possible conflicts and unexpected overrides, not to mention it makes it much simpler to find a given selector and to maintain it.
cheers,
gary
[1] When initially coding the main layout, I usually leave the css in the head of the document for ease of portability. Once things are solidified, I move it to a separate file unless it's a unique page. The pages on my playpen site reflect this.
LL there is no way that I'm
LL there is no way that I'm going to read all of that. I did, however, make it to the part about "sarcastic jibes". I just consider your opinion, at best, misguided. Perhaps due to not understanding that certain text editors are not simply windows that allow you to type into them. These are sophisticated machines and yes, they are far more efficient than Dreamweaver. At least in my hands. Maybe you're not as fast a typist as I am. Maybe you don't think the way I do. Maybe you don't plan the way I do. Tout dreamweaver all you like, just expect more of the same from most of the others here. Just don't take it so personally.
This reminds me of the
This reminds me of the classic "Hollywood IT mistakes" blog posts you see, their favourite one seems to be that "nobody in the movies ever uses a mouse, EVER" - when in fact (albeit probably unintentionally) that's fine, as it is much faster to do everything via a keyboard, as long as you know the shortcuts. I very rarely use a mouse any more (except at work, where the blasted Windows key is disabled)
thepineapplehead wrote:...
... (except at work, where the blasted Windows key is disabled)
Intentionally? Or did it break? :?
Part of the GPO to lock
Part of the GPO to lock everything down; being a sysadmin I could enable it but really cba, <ctrl><esc> brings up the start menu so that's what I use . . . shame I can't <win><r> to run things