Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a Masterpage which has custom CSS with some padding on the #s4-bodyContainer on some pages my #s4-titlerow gets an inline style and causes horizontal scrolling.

I don't want this inline style to happen and can't figure out how to stop it, or correct it instantly in the event it does happen.

share|improve this question
    
Did you try to override some style attribute on the fly to see what works, using Firefox + Firebug perhaps? Try for example by adding "overflow:hidden" to #s4-titlerow. –  natdico Dec 17 '12 at 21:56
    
overflow:hidden would work but obviously anything overflowed by SharePoint would then also be hidden. My only options at this point are either doing a CSS !important (which I am trying to avoid) or something via Javascript. My preference is to use javascript to remove or best yet stop SharePoint from doing it. –  RyanHirsch Dec 18 '12 at 12:43

1 Answer 1

If it is an inline style via the Style attribute then the only way that you can change that is to use Javascript to change it, otherwise, it will override all other styles coming in from the CSS. jQuery makes this amazingly simple to do.

share|improve this answer
    
My issue is figuring out the timing to remove the style attribute. My attempt to remove the style attribute is firing before the SharePoint javascript which sets it. –  RyanHirsch Dec 17 '12 at 21:37
    
Using .ready fires before the SharePoint javascript which sets the style. –  RyanHirsch Dec 17 '12 at 21:46
    
A clumsy option would be to use SetTimeout to keep checking the Style attribute and then change it once the other javascript has set it –  Dave Wise Dec 17 '12 at 22:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.