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.

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,236 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,686 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,576 questions
0 comments No comments
{count} votes

Accepted answer
  1. MichaelHan-MSFT 18,016 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.

    0 comments No comments

0 additional answers

Sort by: Most helpful