Share via

SharePoint 2013 page layout problem with width adjustment when zoom in/out or diff client views - CSS is not applying

Luis David Colón Vegas 121 Reputation points
2021-09-24T12:06:29.217+00:00

Hello community,

Please, i have a problem with a page layout and the page itself... I have created some page layouts and some pages using the new layouts and added a call to the CSS that auto adjust the size of the content to 100%.

My problem is when creating a new page and adding some images in the RichImageFields and set the width to 100% in the ribbon (SharePoint page editor) and saving the page, it applies a specific width and overwrrites the CSS linked. Even adding a Script Editor webpart and appliying the CSS to ".img, .ms-rtestate-field, .column with important¡" doesn't fix the problem.

When adjusting the width via editor, this overwrrites the CSS, the width is added by sharepoint and i cannot delete it from editor.
135058-5.png
Tried using Script Editor, but no luck.
134999-6.png
Layout code:
135034-7.png
Page Image overlap (phone view):
134917-2.png
Desktop overlap, zoom in:
135048-3.png

Can be this achieved by some way? JS?

Appreciate your help.
Regards,
LC.

Microsoft 365 and Office | SharePoint Server | For business
Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint Server | Development
0 comments No comments

Answer accepted by question author

  1. MichaelHan-MSFT 18,136 Reputation points
    2021-09-27T09:29:00.933+00:00

    Hi @Luis David Colón Vegas ,
    Try to use the below css instead:

    .ms-rtestate-field>img{  
        width: 100% !important;  
    }  
    

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.