17 replies [Last post]
Guillaume777
Offline
newbie
Last seen: 14 years 13 weeks ago
Joined: 2007-02-11
Posts: 9
Points: 0

Part of my link must appear in blue, and the other part of the link ( journal name ) must appear in purple.

It works great yet the part in purple is underscored in blue, making it look ugly. How do I get the underscore of that part of the link so it is purple, too ?

Thanks

My code :

Tougas, F., Rinfret, N., Beaton, A.,de la Sablonni

Guillaume777
Offline
newbie
Last seen: 14 years 13 weeks ago
Joined: 2007-02-11
Posts: 9
Points: 0

I got it !.journal

I got it !

.journal { font-style: italic; color:#800080; text-decoration:underline ( LINE I HAD TO ADD :) ) }

I though text-decoration:underline was on by default, guess that is only true for "body" !

Mike James
Offline
Regular
Houston
Last seen: 13 years 39 weeks ago
Houston
Timezone: GMT-5
Joined: 2005-06-22
Posts: 35
Points: 0

use link styling and descendent selectors

howdy Guillaume777 -

I'm glad you found a working solution! Keep in mind, though, that the ultimate goal of using CSS is completely separating the content of a document with its presentation.

The FONT tag is a presentational element, and here it is used within the content -- probably not a "best practice."

Consider using link styling and descendant selectors as in this alternative:

[...]

.reference a:link {
color: #660000;
}

.reference a:link .journal {
font-style: italic;
color: #800080;
}

[...]

Tougas, F., Rinfret, N., Beaton, A.,de la Sablonni

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 6 years 17 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Taking into account what

Taking into account what Mike James has mentioned I might add that there is possibly/probably a better approach to marking this up and one that doesn't create a huge massive body of text that is one link which looks slightly odd and ugly?

Concider:

Tougas, F., Rinfret, N., Beaton, A.,de la Sablonni

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Guillaume777
Offline
newbie
Last seen: 14 years 13 weeks ago
Joined: 2007-02-11
Posts: 9
Points: 0

I'm not sure to understand

I'm not sure to understand the difference between SPAN and FONT, to me they are the same ? Is the different purely a question of standards ?

Guillaume777
Offline
newbie
Last seen: 14 years 13 weeks ago
Joined: 2007-02-11
Posts: 9
Points: 0

Hugo, I will think about

Hugo, I will think about only making part of the reference as a link, however the overall look must stay exactly the same as it is important for the reference to look as close as possible to actual scientific references in journals.

Hugo wrote:
Taking into account what Mike James has mentioned I might add that there is possibly/probably a better approach to marking this up and one that doesn't create a huge massive body of text that is one link which looks slightly odd and ugly?

Concider:

Tougas, F., Rinfret, N., Beaton, A.,de la Sablonni

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 6 years 17 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Guillaume777 wrote:Hugo, I

Guillaume777 wrote:
Hugo, I will think about only making part of the reference as a link, however the overall look must stay exactly the same as it is important for the reference to look as close as possible to actual scientific references in journals.


Smile not sure how on earth you consider font and span to be the same :?
You use semantic structure to correctly present information, for starters if your not using the cite tag then you are NOT marking this up to match the original properly.

I'm afraid that you are not matching the original using the tags designed to do this in terms of HTML; just to match appearance is only one part of the job your markup must reflect the content, it doesn't at present really.

You may style a dl list to match virtually any layout format you care that is the point of CSS but first you must describe content correctly.
p.s you may also do <dd><p></p></dd>
Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Guillaume777
Offline
newbie
Last seen: 14 years 13 weeks ago
Joined: 2007-02-11
Posts: 9
Points: 0

Hugo wrote: not sure how on

Hugo wrote:

Smile not sure how on earth you consider font and span to be the same :?

Why don't you explain the difference to me then ? I tried changing my font to span and my span to font and nothing changed, so they to me they are the same and I use them interchangingly. You claim that they are different so I guess they have different properties or take different parameters etc. ?

Hugo wrote:

You use semantic structure to correctly present information, for starters if your not using the cite tag then you are NOT marking this up to match the original properly.

I'm afraid that you are not matching the original using the tags designed to do this in terms of HTML; just to match appearance is only one part of the job your markup must reflect the content, it doesn't at present really.

Matching appearance is all that matters really, why should I invest time to change code that will have absolutly zero effect on how my page looks ? I have better things to do !

Hugo wrote:

You may style a dl list to match virtually any layout format you care that is the point of CSS but first you must describe content correctly.
p.s you may also do <dd><p></p></dd>
Hugo.

Those tags don't seem to be that useful since my page looks good as it is : I'm a busy man and if it works, it is good enough for me, even if the code is not very pretty.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 6 years 17 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

In response and in light of

In response to and in light of those replies I have nothing more to add, I too am a busy man but choose to offer some of the skills I have to help people, if the attitude is that it looks right so bugger using correct code then personally speaking I would think this not the best forum for you as most of us hold with these things being important *shrug* and on that note I withdraw from this thread somewhat wishing I hadn't wasted my valuable time Smile

cheers,

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Guillaume777
Offline
newbie
Last seen: 14 years 13 weeks ago
Joined: 2007-02-11
Posts: 9
Points: 0

Hugo, sorry if my attitude

Hugo, sorry if my attitude consternated you, as I did not know you had elevated "correct code" to a moral obligation and an end in itself.

As for me, I have a purely utilitarian view of code, and unless someone can show me the cold, hard benefits I can get from changing my code, I'm not touching it.

Sorry for committing the sin of having a different opinion on this matter, which in this case apparently means withdrawing of all help and quasi-expulsion from the community.

Have a good day,

Guillaume

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 6 years 30 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Guillaume777 wrote:why

Guillaume777 wrote:
why should I invest time to change code that will have absolutly zero effect on how my page looks ?

Because it's not only people with perfect sight who will access your pages. By using incorrect markup you're affecting how people who use assistive technologies and machines (ie search engines) read your pages.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

Ed Seedhouse
Ed Seedhouse's picture
Offline
Guru
Victoria British Columbia
Last seen: 11 weeks 4 days ago
Victoria British Columbia
Timezone: GMT-8
Joined: 2005-12-14
Posts: 3570
Points: 675

Guillaume777 wrote:As for

Guillaume777 wrote:
As for me, I have a purely utilitarian view of code

And there are good utilitarian reasons why your whole approach is backwards.

Quote:

and unless someone can show me the cold, hard benefits I can get from changing my code, I'm not touching it.

There are none so blind as those who refuse to see. Such cold, hard benefits are all there, and there are plenty of sites that will tell you what they are. The whole idea behind CSS was to provide such "cold hard" benefits, but if you refuse to look you can be sure you'll never see them.

Quote:
Sorry for committing the sin of having a different opinion on this matter,

That's not the sin. The sin is refusing to listen with an open mind, which you are apparently unable to do.

Quote:
which in this case apparently means withdrawing of all help and quasi-expulsion from the community.

Excuse me, but last time I looked it was you who was asking for free help, but not providing us what we need to give you that help and then refusing it when it was, nevertheless offered. You come across more as one who is intent on refusing all help and then complaining about not being helped. Not a plan that's likely to make you well liked in any group.

Send me a bill and I will happily refund you ten times the money you paid for help here.

Ed Seedhouse

Posting Guidelines

Watch out! I am carrying irony, sarcasm and satire, and know how to use them.

Guillaume777
Offline
newbie
Last seen: 14 years 13 weeks ago
Joined: 2007-02-11
Posts: 9
Points: 0

Ed Seedhouse wrote:There

Ed Seedhouse wrote:

There are none so blind as those who refuse to see. Such cold, hard benefits are all there, and there are plenty of sites that will tell you what they are.

I know some of the CSS benefits : lower file size, faster download, easier to make modifications, etc. However, it is not at all clear what the benefits of using "span" instead of "font" are (I searched but could not find any), which is why I asked. My question was only meet with contempt from Hugo, however, and I still don't know why I should use "span" instead of "font".

Ed Seedhouse wrote:

Excuse me, but last time I looked it was you who was asking for free help, but not providing us what we need to give you that help and then refusing it when it was, nevertheless offered.

I myself answered my own question in this thread. After my problem was solved, some people started to nitpick my code. When I asked how the suggested changes would improve my site, all I got was moralization from Hugo about what I

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 6 years 30 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Guillaume777 wrote:However,

Guillaume777 wrote:
However, it is not at all clear what the benefits of using "span" instead of "font" are (I searched but could not find any), which is why I asked.

The font tag became deprecated with HTML 4.01 (which was several years ago), so while it may work now, there's no guarantee that it always will. It's also imparting a meaning to your content that's not really intended which as I pointed out earlier might not make much difference to people reading your site, but will to machines (search engines, assistive technologies).

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

Guillaume777
Offline
newbie
Last seen: 14 years 13 weeks ago
Joined: 2007-02-11
Posts: 9
Points: 0

Tyssen wrote:Guillaume777

Tyssen wrote:
Guillaume777 wrote:
However, it is not at all clear what the benefits of using "span" instead of "font" are (I searched but could not find any), which is why I asked.

The font tag became deprecated with HTML 4.01 (which was several years ago), so while it may work now, there's no guarantee that it always will. It's also imparting a meaning to your content that's not really intended which as I pointed out earlier might not make much difference to people reading your site, but will to machines (search engines, assistive technologies).

Thanks for your straightforward and genuine answer Tyssen ! I won't use the font tag again then.

Unfortunately the website I'm working on was originally built exclusively with microsoft frontpage and the font tags appear everywhere. I'm not sure if it is worth it to make the change from font to span but I will consider it.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 6 years 17 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

*sigh* I ought not to

*sigh* I ought not to dignify your reponses with retorts but I'm a fool and slightly irked at your attitude

Guillaume777 wrote:

as I did not know you had elevated "correct code" to a moral obligation and an end in itself.

this is a somewhat asinine statement full of hyperbole, I have nor elevated correct code to a moral obligation it just is necessary and I atempted originally to help you by demonstrating a better approach to the markup which was damned with feint praise that I consider showing contempt for the help I extended to you and that which sparked this little run of pointless posts that serve to waste energy!

Guillaume777 wrote:

Sorry for committing the sin of having a different opinion on this matter

What opinion? you have no opinion, sorry but this may sound rather arrogant but when you can argue on a subject at the same level then you can claim to have an opinion, so far you have not demonstrated sufficient knowledge to claim an opinion on. Sorry but saying you are being denied a vioce is a cliched hackneyed response often trotted out in poor defence of an indefencable position.

Guillaume777 wrote:

is why I asked. My question was only meet with contempt from Hugo,

If contempt was shown it was to your attitude to that which we mainly hold to be the foundation of what we strive to achieve to the best of abilities. In truth it is you that has shown contempt for that which we hold to be important!

Guillaume777 wrote:

some people started to nitpick my code. When I asked how the suggested changes would improve my site, all I got was moralization from Hugo about what I

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 6 years 30 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Guillaume777 wrote:I'm not

Guillaume777 wrote:
I'm not sure if it is worth it to make the change from font to span but I will consider it.

Well it's probably going to be even more complicated than that, because knowing the sort of code that Frontpage is infamous for, it's likely that a straight swap from font to span would be inappropriate because there could be a myriad of tags that would serve better depending on the context.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

Ed Seedhouse
Ed Seedhouse's picture
Offline
Guru
Victoria British Columbia
Last seen: 11 weeks 4 days ago
Victoria British Columbia
Timezone: GMT-8
Joined: 2005-12-14
Posts: 3570
Points: 675

Guillaume777 wrote: Ed

Guillaume777 wrote:

Ed Seedhouse wrote:

Excuse me, but last time I looked it was you who was asking for free help, but not providing us what we need to give you that help and then refusing it when it was, nevertheless offered.

I myself answered my own question in this thread. After my problem was solved, some people started to nitpick my code. When I asked how the suggested changes would improve my site, all I got was moralization from Hugo about what I

Ed Seedhouse

Posting Guidelines

Watch out! I am carrying irony, sarcasm and satire, and know how to use them.