473,664 Members | 3,066 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 3922
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
35666
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 hidden in print mode</p>
7
2574
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 url(styles/my_style.css);--></style> and <link rel=stylesheet href=styles/my_style.css type=text/css> in the header, which applies to the entire HTML document and is NOT what I want to do. This does not seem to work: <span style = @import url('styles/my_style.css');>
4
1566
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 the audience). I was told to create a table displaying the style used for each class and how they display. So I have 3 columns and each column has the class name being displayed with the style for each of the systems. I am using inline styling...
1
2701
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 to know if is it possible to assign styles inline but only for @media print. I cannot use external css file and cannot use <styles></styles>block. I would like something like that:
5
2125
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 show sub-categories. I've styled li to look like a button, then added a class (sub_category) to indent subcategories. I can put the style inline and it works. Why won't it work when I move the styles to the style sheet? I can't find anything...
3
1432
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
40960
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 a:hover attribute to eliminate an underline when underlined to a series of links . Wondering how possible putting an inline style such as this to <a hreftag thanks
0
1605
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 proxy, the inline style disappears, while if I executed the website on the local server only, without the reverse proxy processing anything, the inline styles appear in the tag. The original HTML code is the following: <abc:basiclabel...
2
1968
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 dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor</p> </div>
0
8437
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8348
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8636
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7375
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6187
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5660
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2764
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 we have to send another system
2
2003
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1759
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.