0

How can I make a web-part (content query) move a number of pixels (for example 10 pixels) to left in Sharepoint 2013?

When I click inspect I can edit the number of pixels by changing this line of code

.dfwp-column {
     margin-left: <the number of px I need>px !important;
}

Actually the content-query is an ul:

<ul class="dfwp-column dfwp-list" style="width:100%"><li class="dfwp-item">

How can I change this code within Sharepoint? Where from?

6
  • Are you using a wiki page or web part page? Commented Feb 12, 2015 at 15:11
  • @Jordan A web part page Commented Feb 12, 2015 at 15:37
  • @Jordan And I can use Sharepoint Designer. The problem is I don't know where to find the files that contain the css. Another way around would be to use Design Manager but it's tricky so I'm having doubts. Commented Feb 12, 2015 at 15:39
  • 1
    If you are able to change it with Developer Tools, can you just throw in a script editor web part and change the css on the page? Or do you want this site wide? I wouldn't go around changing the css file if this is the only place you want to make the change. Commented Feb 12, 2015 at 16:06
  • @Jordan wow, it was so simple! Of course, script editor! Thank you so much! I'll use this solution for now, but if sometime I'll need to edit the master page, how can I do that? Commented Feb 12, 2015 at 16:55

1 Answer 1

2

Use a script editor and use the same thing you did in Developer Tools.

If you are using a wiki page and want a code-free way to format the entire web part itself, a trick is to place the web part in a table on the page and play with the widths of each column. This can all be done directly within SharePoint. This wouldn't exactly work for what you are doing here, but could help with some formatting web parts instead of having to mess with the css in the future.

As far as having to edit the SharePoint css, it is <SharePoint:CssRegistration Name="Themable/corev15.css" runat="server" /> in your master page. You don't generally want to edit this. Rather create your own and reference it in the master page. There is another post that discusses that issue here:

How can i Locate and modify the corev15.css

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.