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>
CSSHTMLWeb Browsers

Avatar of undefined
Last Comment
nap0leon

8/22/2022 - Mon
Kyle Hamilton

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.
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.
COBOLdinosaur

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&
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Kyle Hamilton

you can have multiple classes, like this:

<li class="my-class1 my-class2 my-class3">
jackjohnson44

ASKER
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?
Kyle Hamilton

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

⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
jackjohnson44

ASKER
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>
Kyle Hamilton

then you'll have to use javascript if you want older browsers to behave.
jackjohnson44

ASKER
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>
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Kyle Hamilton

no. not for browsers that don't support custom attributes.
Kyle Hamilton

my recommendation is: dont fret your pretty little head over IE < 9. You'll be happier.
Kyle Hamilton

more to the point: as long as it's not "broken" then it's not worth the aggravation. Most people won't even notice.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
jackjohnson44

ASKER
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
nap0leon

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Kyle Hamilton

if the client is so hellbent on it, then they need to give you access to the code. no?
COBOLdinosaur

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&
Your help has saved me hundreds of hours of internet surfing.
fblack61
nap0leon

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.
COBOLdinosaur

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&
Kyle Hamilton

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.  
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
jackjohnson44

ASKER
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.
Kyle Hamilton

not sure on what basis you accepted the answer - you're not even using it.
jackjohnson44

ASKER
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 started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Kyle Hamilton

I gave you plenty of viable answers prior to that. Then I suggested using Javascript which you rejected.
nap0leon

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!