Your CSS selector needs to be as precise as possible, so if your DIV has an ID or a CSS class then you select the DIV and the included FONT tag. Example:
<div id="xyz"><font ...
then you could select this with:
#xyz font { yourNewCSS }
That is the problem the webpart div id or class is not specified.
<div>
<font color="black" face="Calibri" size="2">
Can the webpart code be changed in the html editor.
hello,
mike smith has given you the suitable answer and if still it didn't over ride
<div id="abc">
<font>
</div>
<style>#abc{
color:black !important;}
</style>
using !important we can override.
thanks
Thought I would give you a screenshot.
The div does not have a class. I have tried using the div class ms-rtestate-field does not work in my custom css. Note again this is in a WebPartWPQ4.
Hi,
Add the below CSS to your webpart,
.ms-rtestate-field div
{
font-size:8px !important;
font:arial !important;
}
It should work!!! Cheers !!!
#MSOZoneCell_WebPartWPQ4 .ms-rtestate-field div
{
font-size:12px !important;
font:arial !important;
}
I think maybe something in my custom css is blocking this.
You add only the below snippet,
.ms-rtestate-field div
{
font-size:12px !important;
font:arial !important;
color:red !important;
}
Don't mention #MSOZoneCell_WebPartWPQ4 before class name.
Please add the above CSS class without changing anything.
I have added font color as Red just to confirm whether our custom css has applied.
Regards,
Krishna
That's really good.
if you can share your screenshot, i can help you more...
Regards,
Krishna
can you share your screenshot... where it is suppose to apply and where it got applied?
Sure
you want to change the font and font size to the text which is there in Summary box?
also, summary box it self a separate webpart?
well... you have to add the below code in the summary webpart,
In Summary webpart, add the CSS in html. It should look like as below,
<html>
<head>
<style type="css\style">
**** CSS code here ****
</style>
</head>
<html>
if tag like head or style miss in your code, add the tags and add the below snippet in your summary webpart,
.ms-rtestate-field div, ms-vb2 .ms-rtestate-field div, ms-vb2 a .ms-rtestate-field div
{
font-size:8px !important;
font:arial !important;
font-family: verdana, arial, helvetica, sans-serif !important;
color:blue !important;
}
Regards,
Krishna
- Proposed as answer by kmch2003 Saturday, January 11, 2014 5:16 PM
you said summary is webpart. So is it OOB webpart or your custom webpart?
if it is your custom webpart, you can incorporate into your code.
if it is OOB webpart, you can add to your custom master page.
what screenshot are you talking about. The screen shot of the webpart as well as the IE developer tool showing what I am trying to change is in this string.
Hi,
You've got the right idea above, but you need to drill down a little bit farther. Your CSS override needs to be added as close to the text as possible. So your CSS selector should look something like this:
#MSOZoneCell_WebPartWPQ4 .ms-rtestate-field div font
Adding the web part's ID is the best way to keep your change to only that one web part. You may need to do some trial and error to find the best sequence of selectors.
I see that you are using the F12 tools to inspect your HTML. Use the CSS option in that tool, click your text and in the right side CSS panel scroll to the bottom and notice that last CSS selector listed. That often is just what you need.
Which kind of web part are you using? You cannot add the CSS code directly to a list web part. You have a couple of choices:
- Edit the page that contains the web part in SharePoint Designer and add your CSS just before the end tag of the PlaceHolderMain placeholder.
- Add a Content Editor Web Part to your page and place it below the web part you want to change. You can either add the CSS directly to the CEWP or you can link to a text file stored in a library that contains the CSS (easier to maintain and reuse)
Thanks Mike, I have a css txt file attached in a content editor on the page. I did not realize I had to go that deep.
Wow that format is working. I did have to add the wbp number. Thank you all so much for being patient with me and for sharing the answer. I learned a lot.