473,508 Members | 2,337 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IE and inline styles...

Hello all,

It seems to me that IE ignores other styles altogether when an inline style
is used. As an example, check my site (in my signature file). In the "Latest
News and Headlines" you can see the new link to my "download center". When
you hover over that link, it does not behave the same way as the other
links. The difference? I added an inline style to that particular tag.

In my stylesheet I have:

a:link { color: #0066ff; }
a:visited { color: #ff9000; }
a:hover { color: #ff0000; font-variant: small-caps; font-weight: bold;
text-decoration: none }

In my HTML I have:

<a href="download.htm" style="font-weight: bold">download center.</a>

Basically, I want the words "Download Center" to be bold for the time being,
not just during hover. Anyway, Firefox applies the inline style *and* the
hover style defined in my stylesheet. IE totally ignores the style in my
stylesheet and applies the inline style only. I assume that Firefox is doing
it the right way, but I'm not sure.

Is this an IE bug or is it conficting code? I know that inline styles get
the highest priority, but I thought that applied only to similar style
statements. For example: If I had { font-weight: bold; text-decoration:
underline } in my stylesheet, but I wanted to change that in one instance
and did an inline style { text-decoration: none }, it would override that
statement only and not the whole style.

Comments?

--

Viken K.
http://home.comcast.net/~vikenk

Feb 7 '06 #1
5 3910
Viken Karaguesian wrote:

a:hover { color: #ff0000; font-variant: small-caps; font-weight: bold;
text-decoration: none }

In my HTML I have:
<a href="download.htm" style="font-weight: bold">download center.</a>

I can see where there may be differences in how the browsers decide
about this. Both apparently find the extra style ambiguous although both
chose :hover as the likely target. I do not know if either browser is correct.
I suggest creating a separate class for the link rather than an inline
style change.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Feb 7 '06 #2
Viken Karaguesian wrote:
It seems to me that IE ignores other styles altogether when an inline style
is used.
You have jumped into a conclusion, but you have also found a genuine bug
in IE. (Not the only one, I'm afraid.)
As an example, check my site (in my signature file).
In general, it is productive to try and isolate a problem to a simplest
possible case where it still appears. Especially when asking for help in
public, this should be your homework.
IE totally ignores the style in my
stylesheet and applies the inline style only.
No, that's a wrong conclusion. IE _does_ apply the rules in the <style>
element as well, _except_ for one rule. (You probably mean the content
of that element by the expression "my stylesheet". But the content of
any style="..." element is your stylesheet, too.)
I know that inline styles get the highest priority,


Only in the sense described in the cascade rules. Those rules are
generally misunderstood, if known at all.

Instead of getting into the general discussion about the cascade once
again, I'll just point out the _real_ problem: IE does not implement
a:hover { font-variant: small-caps; }
correctly - it does not change the font variant on mouseover. It
recognizes and implements font-variant: small-caps properly*) in
general, as you can see by trying e.g. p { font-variant: small-caps; }.
But for some odd reason, this particular combination does not work. The
bug has not been fixed in IE 7 beta preview.

Even stranger, you can circumvent the bug by adding another rule that
changes the properties of the font. I haven't studied this in detail,
but e.g.

a:hover { font-variant: small-caps; font-size: 100%; }

helps as a workaround.
Feb 7 '06 #3
> again, I'll just point out the _real_ problem: IE does not implement
a:hover { font-variant: small-caps; }
correctly - it does not change the font variant on mouseover. It
I have noticed this myself. When I use a:hover {font-variant: small-caps}
by its self, IE does not implement the small-caps on hover. However, when I
added "font-weright: bold", the small caps were implemented.
But for some odd reason, this particular combination does not work. The
bug has not been fixed in IE 7 beta preview.


Has Microsoft make the IE7 beta available for download? I've been curious
about that.

--
Viken K.
http://home.comcast.net/~vikenk
Feb 7 '06 #4
I've removed the inline style. May be I'll wrap it in a <span> tag if I want
to make it bold again. Thanks for the replies.

--
Viken K.
http://home.comcast.net/~vikenk
Feb 7 '06 #5
"Viken Karaguesian" <vikenkNO_SPAM@NO_SPAMcomcast.net> wrote:
Has Microsoft make the IE7 beta available for download?


Yes, some days ago: http://www.microsoft.com/windows/ie/ie7/

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Feb 7 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
35600
by: geotso | last post by:
Hi I'm trying to hide from printing a specific element of a page but I don't know how (and if) I could. Here is an example of what I'm trying to do: <h1>Hidden in print mode</h1> <p>Also...
7
2562
by: David Filmer | last post by:
Greetings. I want to localize a style definition to a portion of an HTML document, but use an external stylesheet. It seems that I can only do <style><!-- @import...
4
1556
by: FayeC | last post by:
I am building a table with style samples from 3 CSS files. We currently have 3 CSSs (NS4, IE and SUN) as our audience is diverse (banking industry - old systems and old browsers for about 50% of...
1
2679
by: appleboy | last post by:
Hello to all, and sorry about my poor english :) I am trying to assign inline styles thru javascript or directly into the element parameters. E.j: <span style="font-size:5em;"> I would like...
5
2118
by: Stan McCann | last post by:
link: https://ssl.perfora.net/famousphone.com/ css: http://famousphone.com/styles.css The menu list on the right top (Shop by Category) is where I'm having difficulties. I'm trying to visually...
3
1423
by: rn5a | last post by:
I came across the following line in an ASP.NET article: Each AlternatingItemStyle in a DataGrid renders the style inline. What does rendering the style "inline" mean?
5
40950
by: Bubba | last post by:
I need to use an inline css tag for a few links that will not behave like the a:link and a:hover attributes in my stylesheet. I want to add a special link color with underline and a mouseover...
0
1599
by: Mike | last post by:
Hi, I have a strange problem: I wrote a reverse proxy that redirects pages to a local or remote server. Everything seems to work fine, but I have a strange problem with inline styles. In my...
2
1954
by: Kevin R | last post by:
Wondering why my inline style is failing here is the content.html page that I am calling. <!-- content4.html --> <div style"width: 770px; text-align:left;"> <h1Page 4 </h1> <p>Lorem ipsum...
0
7225
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7123
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7383
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7498
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3194
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1557
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.