unexpected behaviour a:hover style

At http://www.monumentmaker.nl I noticed something very strange. Site made with FW pro 5.2.1 and Expression Engine.
I’ve made these styles:
.onderschrift
.onderschrift a
.onderschrift a:hover (I made a underline when hovering)
.onderschrift a:visited

In the source this becomes:

Een plek voor gedachten

What I consider very strange is that a:hover only occurs when that link has been followed before. (cookie) I checked with Safari Firefox and Opera (only on a Mac system)
Does someone has an explanation? Or even a cure??

Thanks

(BTW I noticed also that FW outputs these styles not in a logical order in the css stylesheet. .onderschrift and the rest are separated, not close together. When I put them manually together there was no difference in behaviour. Must I test with another order? a:visited comes now last.)


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I am still not used to the way this mailsystem works, sorry. My text suddenly became a link. Not good.

So: correction:

In the source this becomes

“link-to-my-site/index.php/funerair/grafteken/bewaarplek/” title=“Bewaarplek.”>Bewaarplek.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

The code is this:

<p class="onderschrift f-lp"><a href="http://www.monumentmaker.nl/index.php/funerair/grafteken/een_plek_voor_gedachten1/ 
" title="Een plek voor gedachten">Een plek voor gedachten</a>
</p>

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Remember the following mnemonic:

LoVeHAte

Link
Visited
Hover
Active

You have to put your link “pseudoclass” rules in that particular order
or they won’t work consistently.

Freeway does this for you automatically if you select an HTML box on
the page, click on the paintbrush tab in the Inspector, open the Link
segment, and define your link styles there.

Likewise, if you select the page and do the same thing (through the
Inspector), it will also create these styles in the correct order.

But if you simply create your styles in the main Styles palette list,
they will appear in the source in alphabetical order. Yes, I know this
is evil, and I have filed a bug report to that effect.

There is a work-around, all you have to do to force the sort order is
to create the style using the Tag field (and not the Name field) in
the New Style dialog, and then use a number of spaces before the
beginning of the name to force the sort order. So you would do this as
follows:

     a.mystyle:link { ... }
    a.mystyle:visited { ... }
   a.mystyle:hover { ... }
  a.mystyle:active { ... }

Walter

On Feb 13, 2009, at 4:24 PM, atelier wrote:

.onderschrift
.onderschrift a
.onderschrift a:hover (I made a underline when hovering)
.onderschrift a:visited


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Waltd

Thanks again…

I made the changes, but still no result. (emptied cache etc)

stylesheet first showed:

.onderschrift a:link { color:#eee; font-size:9px; text-align:center; text-decoration:none }

.onderschrift a:visited { color:#eee; font-size:9px; text-align:center; text-decoration:none }
.onderschrift a:hover { color:#fff; font-size:9px; text-align:center; text-decoration:underline }
.onderschrift a:active { color:#eee; font-size:9px; text-align:center; text-decoration:none }

Then I noticed that you had a different formula for the linkstyles, so I changed it into:

a.onderschrift:link { color:#eee; font-size:9px; text-align:center; text-decoration:none }

a.onderschrift:visited { color:#eee; font-size:9px; text-align:center; text-decoration:none }
a.onderschrift:hover { color:#fff; font-size:9px; text-align:center; text-decoration:underline }
a.onderschrift:active { color:#eee; font-size:9px; text-align:center; text-decoration:none }

But I still do not see the desired result. I’m very sorry.
It’s sure is loveandhate this

Do I miss something important here maybe? The only small thing I want is a link style and a hover style attached to a simple MarkUp item.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

This is actually the right approach, you have applied the onderschrift
class to the paragraph that contains the link. You might want to
change this to

p.onderschrift a:link ...

and see if it becomes more specific. You have written the styles in
the correct order, if they aren’t applying, then some other rule is
overriding them.

Which gave me an idea – I looked at your page in Xyle scope, and the
links inside the onderschrift text are being styled by the
#resultaatbox a styles. The other rules aren’t even showing up in the
cascade of styles applied to their links.

Walter

On Feb 13, 2009, at 8:20 PM, atelier wrote:

.onderschrift a:link { color:#eee; font-size:9px; text-
align:center; text-decoration:none }


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You are correct, I applied that a month ago and forgot that it was there… So I was looking at the wrong place.

It’s the circle I’m running in. If I do not style that box, the links in the MarkUp are generic blue, even if I style the text that’s inside it.
Now I restored the situation from before: I removed all the a styles for onderschrift and kept the styles from #resultaatbox (applied from within the inspector)

Links still do get underlined when hovering only after having visited the link before. How to solve this problem?

#resultaatbox a:link { color:#ccc; text-decoration:none }
#resultaatbox a:visited { color:#ccc; text-decoration:none }
#resultaatbox a:hover { color:#fff; text-decoration:underline }
#resultaatbox a:active { color:#ccc; text-decoration:none }


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I must come back to my answer.
Reason why I created the a styles in the style-menu was that I made an ‘extra part’ (with tables, no floating DIV’s) in my site that only shows up when IE comes by.
But the cruelty of the whole thing is that the links work good there…
So I restored the a styles now again. Problem remains though.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Try doing less. Without any fussing around with leading spaces or
anything, make two styles in the Styles palette:

#resultaabox a { color:#ccc; text-decoration:none }
#resultaabox a:hover { color:#fff; text-decoration:underline }

That should fix things for you. They will naturally be in the correct
order when alphabetical ordering seizes hold of them. This should
work, unless yet another tag is getting in the way.

Walter

On Feb 14, 2009, at 5:23 AM, atelier wrote:

You are correct, I applied that a month ago and forgot that it was
there… So I was looking at the wrong place.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

OK Walter, fixed it.
(Did it my way, needed the leading space because order was not good in the css stylesheet)

#resultaatbox a:link { color:#eee; font-size:9px; text-align:center; text-decoration:none }
#resultaatbox a:hover { color:#fff; font-size:9px; text-align:center; text-decoration:underline }

What is the bottom line?
That ‘we’ cannot trust FW anymore? When appliying the linkstyles to a DIV with the Inspector does not do the job? Please correct me if I’m wrong. And, as you mentioned, shame that FW does not order link-visited-hover-active in the correct order in case linkstyles are made in the Styles menu.

How much more need we to know? My site is now appr. 60% handcoded. One more step and I do not need FW anymore. I’ll spend my time learning HTML and CSS with a text-editor in stead.

But you, you have been a great help. Thanks a lot again!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I would recommend that you take a big step back, look at what you are
trying to accomplish when it comes to styles, and then figure out how
to do that in Freeway. “Dance with who brung ya”, as they say in
Texas. In Freeway, that means use the tools exposed through the Styles
palette and the Inspector.

You have a LOT of extra fun stuff happening in the MonumentMaker site,
lots of very nice JavaScript and all that. If I recall correctly, you
are also using Expression Engine for parts of this, too. I would posit
that you are at the very sharp end of the cutting edge of Freeway use
with this site, and can expect a few bruises along the way. For most
people, for most sites, it’s fairly simple to do most things, and
that’s quite a miracle when it comes to HTML+CSS.

What I have found in many years of hand-coding CSS for dynamic sites
is that it is very easy to paint yourself into a corner with too-
specific styles. And once you get a few too many steps into the
process, it is equally easy to lose track of what’s styling what. Xyle
scope is incredibly useful in untangling these knots after you’ve tied
them, but the easiest way to keep them from becoming an issue is to
look for opportunities to do less.

Want all the links on your page to have a consistent style, but
different sizes and colors? Make a set of link styles at the body
level that leave out the color, and a set of link styles at the local
level that tweak only the color. Or if your colors can stay the same,
then only tweak the size. All of this is do-able in Freeway using the
regular interface – no extra styles or extended dialog needed.

Try this on a new blank document. Click on the pasteboard, then click
on the paintbrush tab in the Inspector. Create your link styles for
the entire page, setting the underline, background color, and as
little else as possible. Click in the Style palette, create a new
style with the Tag ‘body’, and nothing at all in the Name field. Set
the basics of your text style for the entire page here. If you can,
set as much of the details as possible. Every other tag inherits from
body, so any attribute you set here will “cascade” down to every other
styled element on the page.

Now, start laying out your page. As you go along, resist the urge to
style anything specifically. Use structural tags, like h2 and h3 (and
go ahead and add h4, 5 and 6 if you like) to indicate the relative
priority of the page elements. If you find yourself in a situation
where you want to change something drastic, like maybe the font color
in an entire HTML box, then create a new class style (no Tag, and some
Name) which carries the new font color or other textual attributes,
and apply that style to the HTML box – not the text inside it.

The key to this method of work is to resist the urge to style things
locally. The reason that you had to get so specific with your link
styles is because there were other styles of higher priority
overriding what you thought were locally important choices. A style
that descends from an ID is 10 times as important as a style that
descends from a Class, which is in turn 10 times as important as a
style that descends from a Tag (all other things being equal). Again,
Xyle scope can be a big help here in figuring out the priorities. When
you click on an element, it shows you the cascade of styles, all the
way back to the body and the html, that apply their rules to the
selection, and it shows the numeric priority of each rule along with
listing them in descending order of importance.

I suspect that a lot of the problems you’re experiencing with your
current site is due to the fact that it’s grown over time, and you’ve
added visual elements in an organic manner. There is nothing at all
wrong with this – it’s how I work most of the time! But it does lead
you into ugly corners where it’s very hard to get back out without
resorting to ultra-specific tags like #item4 #item3 #item2 p.somestyle a span.link or something equally awful.

One very useful exercise would be to open up a browser window next to
a new Freeway document, and try to build a page from your site from
scratch, following some of the principles I’ve outlined here. If you
don’t have two monitors or a Cinema display, then take a screenshot,
add it to your page as a locked layer, and start duplicating the page
over the top of it. I would bet you a large sum of imaginary money
that you will find relatively easy ways to duplicate a design that
“grew” over time. Easier AND more rational, style-wise.

Walter

On Feb 14, 2009, at 9:29 AM, atelier wrote:

How much more need we to know? My site is now appr. 60% handcoded.
One more step and I do not need FW anymore. I’ll spend my time
learning HTML and CSS with a text-editor in stead.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On Feb 14, 2009, at 8:29 AM, Walter Lee Davis wrote:

look for opportunities to do less.

sound words if there ever were any.

and it’s not just the mantra of gov’t employees either, but a key
part in successful development of most Any process.

it’s like, the less crap you have; the easier it is to vacuum the
house, eh.

cheers
peter v.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I’ll print your advise out, Walter, use it as a guideline. You described very clearly indeed how this site grew and grew. In my real profession (I’m a sculptor as you would have guessed :slight_smile: I teach my students exactly the same. Making a sculpture is a constant balance between the frontal approach (which is what we want in our enthousiasm) taking steps back to look from a distance, forseeing trouble miles ahead, and the correct use of the right tools. Talking about tools, when it comes down to Freeway and Expression Engine, I still think that these two can be like a match made-in-heaven. I do hope that the evolution of FW moves more and more towards developing dynamic sites.

Thanks again
all the best

Hans


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I have been kicking and shoving it in that direction for years. I
second your hope and will continue to spend my spare time helping
Softpress make it more useful for that purpose.

Walter

On Feb 14, 2009, at 12:29 PM, atelier wrote:

I do hope that the evolution of FW moves more and more towards
developing dynamic sites.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options