 |
Account Login
|
 |
 |
Latest Articles
|
 |
 |
Advertisement
|
 |
 |
Associates
|
 |
 |
Associates
|
 |
|
 |
 |
|
 |
11-18-2007, 01:09 AM
|
#1 (permalink)
|
|
The Frequenter
Join Date: Sep 2007
Posts: 356
Thanks: 24
|
CSS Link Patterns
Can't remember the link patterns to style links? You can easily remember the link patterns by an easy relationship.
LoVe HAte
a:link, a:visited, a:hover, a:active
This LoVe HAte relationship will help you remember the link patterns forever. :p
|
|
|
|
11-18-2007, 01:21 AM
|
#2 (permalink)
|
|
The Contributor
Join Date: Oct 2007
Location: Argentina
Posts: 72
Thanks: 18
|
:D lol, nice
|
|
|
|
11-19-2007, 08:55 PM
|
#3 (permalink)
|
|
The Acquainted
Join Date: Nov 2007
Posts: 125
Thanks: 0
|
That is good. usually I just do <em>a</em> and that covers everything. Then do a a:hover for the hover.
|
|
|
|
11-20-2007, 12:14 AM
|
#4 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 1,654
Thanks: 73
|
Am I being completely dim or does this not help one little bit? I can see your love hate thing, but it's not like the out-dated one for remembering the order of the planets. You still have to remember which letters to use from love hate. Surely it's easier to remember link, visited, hover, active.
...And for those who are wondering which planet one I mean. Well, this is the one I was taught at school:
My
Very
Easy
Method
Just
Speeds
Up
Naming
Planets
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|
11-20-2007, 01:47 AM
|
#5 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 753
Thanks: 2
|
When learning CSS many moons ago, I was introduced to remembering "LoVe HAte" also and even now I almost unconsciously say to myself, when writing link styles, "love hate". Whatever works, works. :)
Just to clarify things a little about the utility of this topic. What we're discussing is the order in which CSS styles must be written in order to make the cascade useful for hyperlink styling. Certain pseudo-selectors occur when activity occurs on a hyperlink (hover, et al) but if you write them in the wrong order, one style will overrule another and won't produce the desired effect. A more thorough explanation comes from Eric Meyer on Link Specificity but essentially each of the link style types carry the same 'weight' so the last applicable one will be chosen.
Take the following CSS:
css Code:
/* LVAH = wrong */ a:link { colour: #69c; } a:visited { color: #9c6; } a:active { color: #000; } a:hover { color: #c63; }
The "active" style will never be applied when a visitor clicks down onto the link, because the "hover" style will always overrule it since it is the last one in the list.
The way I generally apply my link styles is along the following pattern:
css Code:
a:link, a:visited { ... } a:hover { ... } a:active { ... }
This is pretty much following the LoVe/HAte pattern but since a link can never be both :link (ie, the default link state) and :visited (a visited link) we can safely join those styles together -- the usability people will cut my throat because I very often style unvisited and visited links in the same styles.
__________________
|
|
|
|
11-20-2007, 04:10 PM
|
#6 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 1,654
Thanks: 73
|
The only reason I fail to see its practical use is that how do you know which letters in love and hate to use? If it was like a phrase with each word beginning with the letter, such as my conception:
Lonely
Vegans
Hoard
Apples
Then it'd make perfect sense and I'd be like, "Wey hey! Fantastic."
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|
|
The Following User Says Thank You to Wildhoney For This Useful Post:
|
|
11-25-2007, 12:45 AM
|
#7 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 1,654
Thanks: 73
|
No responses to mine? :( Well I liked it!
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|
11-28-2007, 04:16 AM
|
#8 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 1,654
Thanks: 73
|
I'm guessing everybody thinks mine sucks? :( You're all too polite to say something.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|
12-01-2007, 04:36 PM
|
#9 (permalink)
|
|
The Contributor
Join Date: Apr 2005
Posts: 31
Thanks: 0
|
Well, since you're after remembering link, visited, hover, active as the order n which to define the css styles, and each relevant initial letter only occurs once in LoveHate, its easy. Yes, I use LoveHate. I also use Trouble when setting padding and margins - Top, Right, Bottom, Left. Again each relevant letter only occurs once. Of course whatever you learn, once you've learned it, it works, and that's what matters.
|
|
|
|
12-08-2007, 11:01 AM
|
#10 (permalink)
|
|
The Frequenter
Join Date: Sep 2007
Posts: 356
Thanks: 24
|
Quote:
Originally Posted by Dr John
Well, since you're after remembering link, visited, hover, active as the order n which to define the css styles, and each relevant initial letter only occurs once in LoveHate, its easy. Yes, I use LoveHate. I also use Trouble when setting padding and margins - Top, Right, Bottom, Left. Again each relevant letter only occurs once. Of course whatever you learn, once you've learned it, it works, and that's what matters.
|
I write all the patterns such as link pattern and margin/padding pattern at the top of my css file. 
|
|
|
|
12-10-2007, 06:17 AM
|
#11 (permalink)
|
|
The Acquainted
Join Date: Nov 2007
Posts: 125
Thanks: 0
|
Quote:
Originally Posted by Dr John
Well, since you're after remembering link, visited, hover, active as the order n which to define the css styles, and each relevant initial letter only occurs once in LoveHate, its easy. Yes, I use LoveHate. I also use Trouble when setting padding and margins - Top, Right, Bottom, Left. Again each relevant letter only occurs once. Of course whatever you learn, once you've learned it, it works, and that's what matters.
|
With padding and margins, etc you could think of it like a clock. It starts at noon and rotates clock wise. I usually just remember it starts at the top and rotates to the right.
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|