PDA

View Full Version : css firefox problem


kaliok06
11-12-2007, 09:58 AM
Hi

Hopefully someone can help me on this.

I am having a small problem with firefox. I am developing a site that admin staff generate text etc in the admin area. In the place to add links they can also add text using for the link using the rich text editor. This can be one line (which works fine) or multiple paragraphs (which does NOT). When there are multiple lines. The link still works in Firefox but the underline doesn't. The underline seems to be fine in IE6+ and Safari, but Firefox will not underline the text if its got <p> tags inside the <a> tags. The following is an example of the code that is causing problem.


<span class='linkpage'><a href='http://www.aaa.bbb'><p>The first line.</p><p>The next line.</p></a></span>


The css is standard (as far as I am aware):

.linktype a:link { color: #000; text-decoration: none;}
.linktype a:visited { color: #000; text-decoration: none;}
.linktype a:focus {color: #000;text-decoration: underline;}
.linktype a:hover {color: #000;text-decoration: underline;}
.linktype a:active {color: #000;text-decoration: underline;}

Any help is greatly appreciated.

Cheers.

abduraooft
11-12-2007, 10:16 AM
It's not allowed to put a block element(like <p>) inside an inline element(like <a>,<span> etc.)
PS: You can use <br/>, if you want to break the link text.

kaliok06
11-12-2007, 10:35 AM
Thanks for the quick reply. The problem is I am not generating the text that is being turned into a link. The user is.

I guess Firefox is more strict about css rules than the other browsers, but is there a way to trick firefox into accepting the link rule I want?

Cheers.

abduraooft
11-12-2007, 11:46 AM
Try by adding style="cursor:pointer;display:block;" to your <a>.
(But it's against the markup rules and the w3validator will show errors)