CSS code to remove link underline

D

DavidF

Does anyone happen to know of the correct, perhaps revised way of writing
the CSS code that removes the underline of a hyperlink? This snippet works
by inserting it in a page via the code fragment tool in all version of
Publisher except 2007:

<style>
a{text-decoration:none;}
</style>

DavidF
 
R

Rob Giordano \(Crash\)

Take a look at the page code and see if it's being overridden by other CSS.
 
D

DavidF

Thanks for the suggestion.

I presume that indeed the Publisher 2007 coding engine is producing some
sort of code that is overriding this inserted code snippet. Assuming that I
was knowledgeable enough to find where this is happening, would this insight
tell me how to rework the code snippet I insert, so that it overrides the
current default page code? Or, would it require me to edit the actual page
code? My goal is to find a way to rework the inserted code snippet so that
it overrides the default page code, not to edit the page code directly. As
you know, a solution that requires editing the page code is not a practical
solution for the average Publisher user.

DavidF
 
R

Rob Giordano \(Crash\)

Yah I know.
Where's the page?
I gotta work today, but can look at it later tonight if you want..maybe I
can figure it out (sometimes not due to pub's code).


--
~~~~~~~~~~~~~~~~~~
Rob Giordano
Microsoft MVP Expression
 
D

DavidF

There is no specific page. Take any Publisher 2007 web template, insert into
the publication the CSS code snippet via the code fragment feature, insert a
hyperlink in any text, and do a web page preview to test...and to see the
code. You might also Publish to the Web and direct the html output to your
hard drive where you can open and study the .htm files at your leisure.

Thanks for your efforts.

DavidF
 
D

DavidF

Rob,

I know that you don't play with Publisher that much, so to make it a bit
easier on you I created a .pub file with just two text boxes and the code
snippet.

Here is a link to the Pub file:
http://download.yousendit.com/FB23A94C19503BA7

Here is the link to the .htm file:
http://download.yousendit.com/21B008C05D3F3F73

When you go to yousendit to get the files, you do not need to join...just
download the files. If there is anyone else that wants to help, feel free to
download the files.

DavidF
 
D

DavidF

Oh yeah...forgot to say that the .pub file was created in 2007. If you open
the same .pub file in 2003 and do a web page preview, the code snippet
works, and the underline is removed from the link.

I know how much you enjoy looking at Publisher html code <g>, so while I was
at it, and so you don't even need to open Publisher here is a link to the
Pub 2003 .htm page so you can compare the code side by side with the code
Pub 2007 produces:
http://download.yousendit.com/DD8313D22EDA3356

Once again, I really appreciate your time.

DavidF
 
R

Rob Giordano \(Crash\)

hmmmm sorry it's been a long day...just got back and it's gonna be another
long one tomorrow.

looks like the underline is coming from a span here:

<p class=MsoNormal><span lang=en-US
style='font-size:12.0pt;language:en-US'>This is the test text box with the
hyperlink to </span><a
href="http://www.google.com"><span lang=en-US style='font-size:12.0pt;
text-decoration:underline;language:en-US'>Google</span></a><span
lang=en-US


more than that I dunno at the moment...brain is fried...more later...maybe
sunday.


--
~~~~~~~~~~~~~~~~~~
Rob Giordano
Microsoft MVP Expression
 
D

DavidF

Rob,

No need to apologize...you only have 24 hours in a day, and helping out with
this and in this group obviously should take a back seat to your other
priorities. I appreciate any attention or time you have to give, when you
have it to give.

Yes, I had already found the string with the "decoration:underline". In fact
that is common to both the 2003 and the 2007 version. Now the trick is to
figure out why the CSS code snippet successfully overrides that in 2003, but
not in 2007.

I also realize that one could edit that to "decoration:none" and get the
effect in a Pub 2007 page, but once again, I am looking for a way to avoid
the code edit, and to get a CSS code snippet to work. It is possible that
this is simply something in the coding engine in 2007 that can't be
overcome, but then that is why I posted this question to the group. Perhaps
someone will know of a different way of writing the CSS snippet...if there
is one.

If you get a chance to study the code and have any more ideas, it would be
great...thanks.

DavidF
 
M

Mike Koewler

David,

This cannot be correct but it worked for me. Highlight the text you do
not want underline and click the underline button. I did that and both
on screen and web preview the line was missing. I could also change the
color the same way.

Mike
 
D

DavidF

Mike,

Interesting. You are correct that if you select the hyperlinked text and
click the underline format button it does remove it, and the link is still
active. I would never have thought to try that. So, now we have half an
answer. If someone just wants active links without the underline, they can
remove the underline. Thanks.

However, this question came about as a result of Barry trying to use this
code snippet:

<style>
a{text-decoration:none;}a:hover {text-decoration: underline;}a:hover {color:
#000000;}
</style>

In Pub 2003 this snippet would result in the underline being gone initially,
but appearing with a mouseover along with a text color change. It doesn't
work in 2007 though. So though your solution does work in removing the
underline, it still does not make the underline appear with a mouseover.

You got the other half of the answer? <g>

DavidF
 
M

Mike Koewler

David,

Give me time, not that I expect to find an answer. Perhaps a javascript
snippet?

That or adding the link via a html code fragment.

Mike
 
D

DavidF

No problem...I just appreciate anyone that might have some insight into
this. And besides, you did come up with a partial workaround. I am also
going to have to pursue your ideas about using javascript or a code
fragment, and see where that might lead.

I guess I am still hoping that there is a way to write the CSS code in a way
so that a workaround is not necessary, but it is beginning to sound like
that isn't possible. It sounds like the CSS code is written correctly, but
it just doesn't work in Pub 2007 ;(

Thanks for your time.

DavidF
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top