any way to ignore span=style

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • macgyver

    any way to ignore span=style

    This is a strange question, and I think the answer is NO, but I am
    asking anyway.

    I am a member of a website which allows us to alter our member
    profiles. Using css in the middle of the profile area allows one to
    overide the normal formatting of the entire page and truly customize
    it. But there is a span-style tag which gives an ugly blue background
    to certain text which I want to get rid of. This is the tag:

    <span style="backgrou nd:#004D73; color:white;">

    Is there anything I can do to make the browser ignore this or override
    it? It is within a div-class tag named copy and using .copy I can
    chage the rest of the div, but not the area within the span-style tag.
  • Ivo

    #2
    Re: any way to ignore span=style

    "macgyver" wrote[color=blue]
    > This is a strange question, and I think the answer is NO, but I am
    > asking anyway.
    >
    > I am a member of a website which allows us to alter our member
    > profiles. Using css in the middle of the profile area allows one to
    > overide the normal formatting of the entire page and truly customize
    > it. But there is a span-style tag which gives an ugly blue background
    > to certain text which I want to get rid of. This is the tag:
    >
    > <span style="backgrou nd:#004D73; color:white;">
    >
    > Is there anything I can do to make the browser ignore this or override
    > it? It is within a div-class tag named copy and using .copy I can
    > chage the rest of the div, but not the area within the span-style tag.[/color]

    div.copy span {display:none;}
    removes the span entirely while leaving the rest of div as is.
    or
    div.copy span {background-image:url(white pixel.png);}
    covers the blue with an image of your choice, as long as it is not
    transparant. I am not sure if the shorthand "background " declaration in the
    span overrides this.

    The only answers I can think of that do not evaluate to NO.
    HTH
    Ivo


    Comment

    • Mark Tranchant

      #3
      Re: any way to ignore span=style

      Ivo wrote:
      [color=blue]
      > "macgyver" wrote
      >[color=green]
      >>This is a strange question, and I think the answer is NO, but I am
      >>asking anyway.
      >>
      >>I am a member of a website which allows us to alter our member
      >>profiles. Using css in the middle of the profile area allows one to
      >>overide the normal formatting of the entire page and truly customize
      >>it. But there is a span-style tag which gives an ugly blue background
      >>to certain text which I want to get rid of. This is the tag:
      >>
      >><span style="backgrou nd:#004D73; color:white;">
      >>
      >>Is there anything I can do to make the browser ignore this or override
      >>it? It is within a div-class tag named copy and using .copy I can
      >>chage the rest of the div, but not the area within the span-style tag.[/color]
      >
      >
      > div.copy span {display:none;}
      > removes the span entirely while leaving the rest of div as is.
      > or
      > div.copy span {background-image:url(white pixel.png);}
      > covers the blue with an image of your choice, as long as it is not
      > transparant. I am not sure if the shorthand "background " declaration in the
      > span overrides this.[/color]

      Something being implied but not stated here is that the style attribute
      effectively overrides the style sheet.

      See http://www.w3.org/TR/REC-CSS1#cascading-order :

      5. Sort by order specified: if two rules have the same weight, the
      latter specified wins. Rules in imported style sheets are considered to
      be before any rules in the style sheet itself.

      <snip>

      A declaration in the 'STYLE' attribute of an element (see section 1.1
      for an example) has the same weight as a declaration with an ID-based
      selector that is specified at the end of the style sheet:

      <STYLE TYPE="text/css">
      #x97z { color: blue }
      </STYLE>

      <P ID=x97z STYLE="color: red">

      In the above example, the color of the 'P' element would be red.
      Although the specificity is the same for both declarations, the
      declaration in the 'STYLE' attribute will override the one in the
      'STYLE' element because of cascading rule number 5.



      The only solution I can think of is to use Javascript to re-style the
      <span>s after the document has loaded.

      --
      Mark.


      Comment

      • Jukka K. Korpela

        #4
        Re: any way to ignore span=style

        Mark Tranchant <mark@tranchant .plus.com> wrote:
        [color=blue]
        > Something being implied but not stated here is that the style
        > attribute effectively overrides the style sheet.[/color]

        Not quite. You can use the !important specifier.

        div.copy span { background: white !important;
        color: black !important; }

        --
        Yucca, http://www.cs.tut.fi/~jkorpela/

        Comment

        Working...