I have tried and isolated the problem below after spending hours on this. First link is not underlined on hover in FF but works in all the other browsers I have tried. The second link properly works in Firefox too. Most of the existing html on the site is structured in the below way so a site wide fix will be appreciated.
HTML: (pasting as code here removes tags) http://pastebin.com/duqfKGeY
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
FF test
</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link href="ff.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table>
<tbody>
<tr>
<td>
<ul type="disc">
<li>
<a target="_blank" href="http://example1.com">
<font size="2" color="#b80000"><b>Example Link 1</b></font></a>
<br>
<font size="2" face="Verdana">
example text example text example text example text example text example text example text example text example text example text example text example text example text example text example text example text example text
<a target="_blank" href="http://example2.com/">
<font size="2" face="Verdana" color="#b80000">Example link 2</font>
</a>
example text example text example text example text example text example text example text example text example text example text example text example text example text example text example text example text example text .
</font>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</body>
</html>
CSS:
a{color:#b80000;}
a:link{color:#b80000;text-decoration:none;}
a:visited{color:#b80000;text-decoration:none;}
a:hover{color:#b80000;text-decoration:underline;}
a:active{color:#b80000;}
Edit: Validates without any errors on W3C Validator
The <B> tag is overriding the text-decoration. Just add this:
a:hover b{text-decoration:underline;}
If there are others you could probably even do:
a:hover > *{text-decoration:underline;}
This is all a bit over kill I would just use:
a{text-decoration:none;}
a:hover{text-decoration:underline;}
There should be no reason why this doesn't work.
Okay first things first,
Tables for layout - educate yourself please:
http://shouldiusetablesforlayout.com
http://www.hotdesign.com/seybold/
http://webdesign.about.com/od/layout/a/aa111102a.htm
http://www.htmlgoodies.com/beyond/css/article.php/3642151/CSS-Layouts-Without-Tables.htm
<font> tags were deprecated LONG ago, we now use CSS and <span> tags for all our styling needs.
The most likely reason why stuff doesn't work is because your HTML is basically completely wrong, yes it works but it is killing the interwebz - Here is your layout redone with <div> tags and CSS - nice and clean and everyone is happy:
Live Demo
Also - validation - It is just a tool, not a standard to aspire to, sure it helps fish out bugs but it could end up causing you hassle trying to be 100% compliant (Stares at XHTML Strict) more on that here:
http://net.tutsplus.com/articles/general/but-it-doesnt-validate/
I see the :hover underline on both links in FF 3.6/Mac, even when they are visited links.
As Alex Thomas pointed out, your CSS can be more concise--consider that all the link states are the same color, and only the :hover state differs by having an underline.
Even though the crummy HTML from Google Docs has the color stated on those font tags (retro, eh?), duplicate the color rule in your CSS so the :hover underline appears in the correct color:
a {
color: #b80000;
text-decoration:none;
}
a:hover{ text-decoration:underline;}
The problem may be with the text-decoration: underline; CSS statement. Firefox ignores this in version 3.6. I know by version 7.0 it works just fine, but I don't know when it was actually fixed.
What version of Firefox are you working with?
Related
I'm trying to add the Arabic language to my paragraphs but it appears from left to right. I tried <HTML lang="ara"> and I tried to do it from .css file, but nothing worked with me.
note I'm using react and I just create the folder without changing anything and the first thing I did is to add the following paragraph.
<p lang="ara" dir='rtl' className='title-field' contentEditable />
the html-tag gets the direction-attribute
<html dir="rtl">
<body>
<p>aligned right</p>
</body>
</html>
You can also style specific elements with the direction property:
direction: rtl;
This seems to work fine, run the code snippet to see
<p lang="ara" dir='rtl' className='title-field'> نص الاختبار</p>
Is the following W3C Compliant:
<div>
<h3>Heading</h3>
This is the text for this section.
</div>
Or does the text require a container element?
<div>
<h3>Heading</h3>
<p>This is the text for this section.</p>
</div>
The first example doesn't sit right with me, but a content editor asked me and I realized I don't really know if it's okay.
Both examples are valid.
Technically in the first one, the text is inside a container, the outer <div>.
Anyway it is perfectly valid to put text directly inside the <body>, which means the following HTML document will pass validation with no errors or warnings:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<h3>Heading</h3>
This is the text for this section.
</body>
</html>
The more relevant question is whether it is semantically correct. To put it simply, paragraph text should be surronded by a <p> tag. More generally each type of content SHOULD be written inside the semantically relevant tag.
I will advise you to use the second approach.
When you use the correct Heading Tag it helps boost your page SEO wise.
Moreover, paragraph tag, P, helps some browser to render your page in “reading mode”.
Finally, a div is a block-displayed element. This CSS code looks a bit weird: div {color: blue}. But, p { color: red; } make more sense for a lot people.
Technically, both are conforming HTML (unless you validate it against the strict HTML4.x/XHTML1.x scheme which has no connection to reality anymore). Hovewer, the second approach would be probably more convenient from the styling/scripting perspective, where it's always better to have a possibility to address any piece of content directly. The first example has an implicit paragraph, and explicit is usually better than implicit.
Why does the following html snippet:
<html>
<head>
<title>Test</title>
</head>
<body>
Some Text<br />
<font color="rgb(0,0,0)">More Text</font><br />
<span style="color: rgb(255, 0, 0);">
<font color="rgb(0,0,0)">And the last of the text!</font>
</span>
</body>
</html>
Result in the output in the picture at the link (notice the red colouring!):
This seems to happen in Chrome and Firefox and even in Outlook (in HTML emails) but the text shows as black in IE 11.
It's not necessarily something I need to or can fix but that sort of styling is something given by a third party component and it's led me to wonder why this gives the result it does. I can't find any suggestions anywhere on the web on why this would be red(ish) rather than black.
I want to understand it more than anything.
The HTML color attribute (which was superseded over two decades ago) doesn't accept CSS color values. It only accepts HTML color values.
rgb(0,0,0) is a CSS color value. It is not an HTML color value.
Error recovery will cause it to either be ignored (in which case the parent element's colour will be inherited) or treated as a different colour.
Some browsers render <font color="rgb(0,0,0)"> in red because they interpret "rgb(0,0,0)" - which isn't a valid color value according to the deprecated spec - as hex color string #b00000:
<font color="rgb(0,0,0)">This color</font>
equals
<font color="#b00000">this color</font>
See Why does HTML think “chucknorris” is a color? for an explanation. Thanks to #j08691 for pointing this out in the comments above.
Let's have this simplified page:
<!DOCTYPE html>
<html>
<body>
<div style="display:table">
<span>Try to copy me!</span>
<br/>
<textarea> Paste here! </textarea>
</div>
</body>
</html>
In Internet Explorer 8 and 9 it is not possible to select and copy the text "Try to copy me!" or parts of it to the clipboard by using the mouse and Ctrl+C. (Ignoring the hack by selecting the text area also)
Unfortunately due to my complex page structure the display:table needs to stay in that place.
My Question: is it somehow possible to add CSS style to the span (or a additional inserted div) to make it possible to select the text again?
Mr Lister was right:
a display:table-cell enables the text selection again for me.
Here is what works:
<!DOCTYPE html
<html>
<body>
<div style="display:table">
<span style="display:table-cell">Try to copy me!</span>
<br/>
<textarea> Paste here! </textarea>
</div>
</body>
</html>
we have a pretty complex HTML application which also supports RTL.
However when switching the HTML to RTL by using the <html dir='rtl'> attribute not everything is reversed.
Especially elements that were aligned previously by CSS do NOT reverse.
Simple example:
<!DOCTYPE html>
<html>
<head></head>
<body>
<table>
<tr><td>Some text long text</td><td>Even More long text</td></tr>
<tr><td style='text-align:right;'>aligned to right</td><td>aligned to left</td></tr>
</table>
</body>
</html>
When setting
<html dir='rtl>
on this example I would expect the text-align to switch direction, too. But it doesn't. For this reason we currently load a 2nd template CSS file after the default one that overwrites the necessary alignments. I feel that this is not optimal.
Is there is easier way to reverse/flip alignment stuff for RTL?
You want something like this
html[dir="rtl"]
Example : http://jsfiddle.net/3UsyS/