Link to home
Start Free TrialLog in
Avatar of jackjohnson44
jackjohnson44

asked on

css in Firefox vs IE

Hi, I am trying to remove a spacer line (dashed line in a list) using this code.  It works in FireFox, but not in IE.

Both work in FF:
    li.ms-MenuUIULItem[type='separator']{
        display: none;
    }

    li[type='separator']{
        display: none;
    }

This is what I am trying to get rid of:
<li id="mp5_0_4" class="ms-MenuUIULItem" type="separator"><div type="separator" class="ms-MenuUISeparator">&nbsp;</div></li>
Avatar of Kyle Hamilton
Kyle Hamilton
Flag of United States of America image

depending on the version if IE and HTML, your "type" property may be invalid, and thus will be ignored.

get rid of the type property, it's not adding any value, and just use classes.
Avatar of jackjohnson44
jackjohnson44

ASKER

Thanks, but that is not an option, I have other li's that have the same class "ms-MenuUIULItem".  This is actually a SharePoint site and I have no control over the output.
Kyle is right the declaration is only semi-supported in IE... AFAIK it works for IE9; will work with a strict doctype for IE8 and maybe IE7.

Using complex declarations when a simple class is all that you need is not good practice.

Cd&
you can have multiple classes, like this:

<li class="my-class1 my-class2 my-class3">
Thanks for the response.  I am unable to change the html.  I can only change the css.

Is there any way to fix this issue only using css?
Since there is an id, and id's must be unique, you can use the id to target the element:

#mp5_0_4{

display:none;

}

Open in new window

Sorry, I don't have access to the id's there is more than one separator.

This is the entire code that I have access to and the ID is not guaranteed:
<li id="mp5_0_4" class="ms-MenuUIULItem" type="separator"><div type="separator" class="ms-MenuUISeparator">&nbsp;</div></li>
then you'll have to use javascript if you want older browsers to behave.
It is dynamically loaded and I don't have any access to anything.

So it is impossible to hide this only using css?

<li id="mp5_0_4" class="ms-MenuUIULItem" type="separator"><div type="separator" class="ms-MenuUISeparator">&nbsp;</div></li>
no. not for browsers that don't support custom attributes.
my recommendation is: dont fret your pretty little head over IE < 9. You'll be happier.
more to the point: as long as it's not "broken" then it's not worth the aggravation. Most people won't even notice.
I wish that were the case.  If it were up to me, I would leave it.  My client is hell bent on getting this resolved.  Thanks for all your help.

Also, I am removing other entries which leaves a bunch of those seperators next to each other.
ASKER CERTIFIED SOLUTION
Avatar of nap0leon
nap0leon

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
if the client is so hellbent on it, then they need to give you access to the code. no?
That kind of restrictive approach is not web development.  It is more like building a ship in a bottle while blindfolded and wearing boxing gloves.  Your client is a moron.

Cd&
Off topic, but no, the client is not a "moron" for not letting jackjohnson (presumably a contractor for hire) to make modifications to a working SharePoint site.  Opening up (recompiling, etc.) the SharePoint code exposes an additional layer of risk to the project.

In other words...
The mechanics I trust to put tires on my car and do an alignment is not the same set of mechanics I trust to replace a tie-rod or make adjustments to the frame.
If the client is not prepared to give the access required for the changes they want then they are stupid to expect the work to get done.  

The mechanics I trust to put tires on my car and do an alignment is not the same set of mechanics I trust to replace a tie-rod or make adjustments to the frame.

Any real mechanic who cannot competently do both should not be allowed to do either.  If the client does not consider jackjohnson qualified; then why would they hire him?

Cd&
I can see where nap0leon is coming from, but it's kind of hard to argue with this one:

If the client is not prepared to give the access required for the changes they want then they are stupid to expect the work to get done.  
Hey guys, thanks for all of the help.  I got around my issue bu hiding all li's with that class, then explicitly showing them by matching on the text attribute.

    li.ms-MenuUIULItem{
        display: none;
    }
    li.ms-MenuUIULItem[text^='View Properties'],
    li.ms-MenuUIULItem[text='Edit Properties'] {
        display: block;
    }    

"That kind of restrictive approach is not web development.  It is more like building a ship in a bottle while blindfolded and wearing boxing gloves.  Your client is a moron."

I totally agree, and call that approach SharePoint development.
not sure on what basis you accepted the answer - you're not even using it.
He gave a viable answer to my problem.   Everyone else told me the premise of my question is incorrect or that my requirements were derived by morons.
I gave you plenty of viable answers prior to that. Then I suggested using Javascript which you rejected.
Unfortunately, I agree with those that say to not award me points for it...
My answer doesn't tell you how to do it with CSS - you figured that out on your own!