Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Publisher / Web Design / May 2008

Tip: Looking for answers? Try searching our database.

CSS code to remove link underline

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DavidF - 23 May 2008 00:24 GMT
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
Rob Giordano (Crash) - 23 May 2008 03:50 GMT
Take a look at the page code and see if it's being overridden by other CSS.

Signature

~~~~~~~~~~~~~~~~~~
Rob Giordano
Microsoft MVP Expression

> 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
[quoted text clipped - 6 lines]
>
> DavidF
DavidF - 23 May 2008 13:38 GMT
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

> Take a look at the page code and see if it's being overridden by other
> CSS.
[quoted text clipped - 9 lines]
>>
>> DavidF
Rob Giordano (Crash) - 23 May 2008 15:05 GMT
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).

Signature

~~~~~~~~~~~~~~~~~~
Rob Giordano
Microsoft MVP Expression

> Thanks for the suggestion.
>
[quoted text clipped - 23 lines]
>>>
>>> DavidF
DavidF - 23 May 2008 15:45 GMT
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

> Yah I know.
> Where's the page?
[quoted text clipped - 28 lines]
>>>>
>>>> DavidF
DavidF - 23 May 2008 23:44 GMT
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

> Yah I know.
> Where's the page?
[quoted text clipped - 28 lines]
>>>>
>>>> DavidF
DavidF - 23 May 2008 23:57 GMT
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

> Yah I know.
> Where's the page?
[quoted text clipped - 28 lines]
>>>>
>>>> DavidF
Rob Giordano (Crash) - 24 May 2008 05:25 GMT
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.

Signature

~~~~~~~~~~~~~~~~~~
Rob Giordano
Microsoft MVP Expression

> 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
[quoted text clipped - 42 lines]
>>>>>
>>>>> DavidF
DavidF - 24 May 2008 19:00 GMT
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

> hmmmm sorry it's been a long day...just got back and it's gonna be another
> long one tomorrow.
[quoted text clipped - 58 lines]
>>>>>>
>>>>>> DavidF
Mike Koewler - 25 May 2008 19:10 GMT
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

> 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
[quoted text clipped - 6 lines]
>
> DavidF
DavidF - 25 May 2008 21:57 GMT
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

> David,
>
[quoted text clipped - 15 lines]
>>
>> DavidF
Mike Koewler - 25 May 2008 23:00 GMT
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

> Mike,
>
[quoted text clipped - 40 lines]
>>>
>>>DavidF
DavidF - 26 May 2008 14:58 GMT
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

> David,
>
[quoted text clipped - 51 lines]
>>>>
>>>>DavidF
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.