The list web part contents are vertical-align middle and no padding right. How do I apply CSS to the web part? I am on SP Online: Classic Experience.

I need to clarify. What is the specific code that adds the formatting to the list web part.

The web part id="WebPartWPQ1", so I put the following into a Script Editor web part:

<style type="text/css">


1 Answer 1


I suggest you save your CSS style in to a CSS file, then upload this file to Site Assets of that site/sub-site to where I need modifications and then reference that CSS file using Content Editor Web Part or Script Editor Web Part in your list view page.

<link href="/SiteName/SiteAssets /CustomStyle.css" rel="Stylesheet" type="text/css" />

It will better to manage your CSS style, if you want to modify the CSS style, we just modify the file, don't need edit your list view page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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