How to add a custom paragraph style in my SharePoint 2013 blog? - asp.net

I have a Share Point 2013 web site and a blog in it. Since my posts will include a lot of special text content, I need to add more styles that I will use on all posts. Typically all styles appear in the top ribbon bar when creating a new post.
How to add the new style in Share Point Designer 2013?
What do I need to do?

What you are looking for are custom styles for the SharePoint RichText editor. The nice thing is that all you have to do is add some custom CSS and SharePoint will magically render new text styles. you can also do this with SharePoint Designer if you have a custom master page or if you just specify the alternate CSS somewhere.
The "magic" CSS is something like the following:
.ms-rteStyle-MySpecialStyle {
-ms-name: "My special style";
font-style: bold;
color: red;
}
h2.ms-rteElement-SpecialHeading{
-ms-name: "Special Heading";
font-style: bold;
color: green;
}
The difference between the two is the rteElement vs. rteStyles, but the difference becomes clear once you look at your screenshot: Page Elements and Text Styles. The difference is that you style particular elements with one, e.g. H1, H2, SPAN, and you style text passages with the other - SharePoint actually adds a span tag around the text and assigns it your style.
Enough of the words, a couple of complete blog articles to help you get started:
How to add custom styles to the ribbon in SharePoint 2013
Add new stlyes to Rich Text Editor ribbon in SP2013 Online
Do you know how to custom styles for RichHtmlEditor in SharePoint 2013?

Please try this code for custom heading and text
h2.ms-rteStyle-customHeading
{-ms-name:"custom heading";
color:gray; }
.ms-rteElement-customTest
-ms-name:"customize text";
{color:black; }

Related

Formatting text editor with Elementor

I'm using Elementor with an OceanWP theme. I'm trying to customize a text editor that has many lines of text. I have 2 questions about how to tailor the content of the text editor:
Is it possible to prevent Elementor from adding space between paragraphs (in a similar way to how MS Word handles this matter)?
When I click on bold font, the text editor is actually using the expression <strong> rather than <bold> as I was expecting. The thing is that I would like to increase the contrast with the regular font but <bolder> and <stronger> do not work.
So I'd add some custom CSS
You could add some custom CSS to override the margin on the paragraph elements within Elementor text block. Here's some psuedocode:
.elementor-text-editor-block p {
margin-bottom:0!important;
}
Similarly, add something like
strong {
font-weight: 600;
}

How do I change the CSS of the default Paragraph Format in Froala Editor?

I'm implementing Froala Editor in an Angular project. I want to be able to change the default Paragraph Format drop down and to be able to apply my own styles to the options in there.
I know there is the paragraphFormat option where I can change the list in the drop down, but it doesn't mention where I would define the CSS for those options. Anyone have any ideas where/how I can do that? I don't want to use the separate paragraphSyltes option as that introduces a separate button and doesn't have the paragraphFormatSelection dropdown feature that default paragraph format comes with.
Edit: Thanks for the help, I've created a jsfiddle for the problem. Not sure exactly what the CSS should be, this is what I have but doesn't work:
.froala-paragraph-drop-down {
.H1 {
text-align: center;
color: red;
font-size: 14px;
}
}
Can you please help me with making Heading 1, say 14px red in both the paragraph dropdown as well as when applied to the text in the editor?

How to change button background and text color under every post

How to change the background and text color of every read more button on my website?
The site has "swift" theme.
There should be a option in Wordpress admin panel to edit website's appearance, including font size, color and stuff like that. I have not worked on the Swift theme but from the little experience I have, theme's options have such features to modify color/size/font without having to write CSS for it.
OR you can add custom CSS to your website, but for that you will need to write CSS which may overlap with other settings on the website if not done carefully.
The 'Read More' element has 'moretext' class, so you need to work on CSS to customize it. Something like this:
.moretext { background: #ffffff; color: 000000; }
Here's the documentation https://codex.wordpress.org/Customizing_the_Read_More

WordPress how do I add caption styles in the editor

In the current version of WordPress (4.6.1) using the code inspector reveals that the inline style for the image captions is:
<dd class="wp-caption-dd">Photo Caption Text</dd>
However, using ".wp-caption-dd" in editor-style.css has no affect - even with !important. How can I affect the class in the editor to create the same look in the editor that is live?
Please note: I am only talking about the editor ".wp-caption-text" is the correct class for live coding of the caption.
Charles
Using Chrome and Inspector I saw the .wp-caption-dd, and just putting this in your styles should do.
It should probably be more restrictive (inside the dd specifically), but this should get you started.
/* photo caption inside the Visual Editor */
.wp-caption-dd
{
font-size: 70%;
text-align: right;
font-family: Trebuchet,"Trebuchet MS",Helvetica,Geneva,Helv;
}

Editing css in individual elements of a text area custom field in Wordpress

I am making my first steps of coding. I have finished HTML, CSS, JavaScript, mySQL and PHP courses on the Internet. And now I decided to continue learning from the practice while I make a Wordpress theme.
The thing is that I am working with custom fields. I have a field for the text and I can't find a way to customize the css of specific parts of that text.
I know that I can apply a class to that field but how can I apply a class to specific parts of that field?
For example if I want to make some bolder words?
When you insert your text in the custiom field, you can use some html tags such as <b>I am bold</b> or <i>I am italic</i>
Or you can add <span> tags, but add a class name like <span class="boldAndRed">some content</span>, then in css do this:
.boldAndRed{
font-weight: bold;
color:red;
}

Resources