jQuery fullCalendar 字体大小

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2565799/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 13:49:11  来源:igfitidea点击:

fullCalendar Font size

jqueryfontssizefullcalendarfont-size

提问by Ronald Alfonso

I am having issues setting the calendar font sizes to be smaller.

我在将日历字体大小设置得更小时遇到问题。

I have changed setting a container div font size, no effect.

我已经更改了设置容器 div 字体大小,没有效果。

I have also changed the fullCalender.css font from 1em to 0.5em and to a px size but the calendar text stays the same.

我还将 fullCalender.css 字体从 1em 更改为 0.5em 并更改为 px 大小,但日历文本保持不变。

回答by LostSalad

This is quite the blast from the past, but I originally found this looking for a solution.

这是过去的爆炸,但我最初发现这是在寻找解决方案。

I just wanted to change the font size of the elements in the table (date headers, time sidebar). The following worked for me:

我只想更改表格中元素的字体大小(日期标题、时间边栏)。以下对我有用:

th.ui-widget-header {
    font-size: 9pt;
    font-family: Verdana, Arial, Sans-Serif;
}

I used opera dragonfly to find the element class (CTRL+SHIFT+i -> Hover over element), but any DOM inspector should do.

我使用歌剧蜻蜓来查找元素类(CTRL+SHIFT+i -> 悬停在元素上),但任何 DOM 检查器都应该这样做。

回答by Venkat.R

  1. Add the 'theme' setting in FullCalendar.

    $('#calendar').fullCalendar({
      theme: true
    });
    
  2. Add your Custom themed CSS by editing the FullCalendar provided CSS file, http://arshaw.com/js/fullcalendar-1.6.1/demos/cupertino/theme.css

  1. 在 FullCalendar 中添加“主题”设置。

    $('#calendar').fullCalendar({
      theme: true
    });
    
  2. 通过编辑 FullCalendar 提供的 CSS 文件添加您的自定义主题 CSS,http://arshaw.com/js/fullcalendar-1.6.1/demos/cupertino/theme.css

Note: Demo is here http://arshaw.com/js/fullcalendar-1.6.1/demos/theme.html

注意:演示在这里http://arshaw.com/js/fullcalendar-1.6.1/demos/theme.html

回答by Sam Munroe

For future reference:

备查:

.fc-title{
    font-size: .9em;
}

回答by Ronald Alfonso

I could solve that problem with the following

我可以用以下方法解决这个问题

::ng-deep body .fc {
  font-size: 12px;

回答by Val

try and use !importantwhich is a CSS rule to obey that rule and ignore others.

尝试并使用!important哪个 CSS 规则来遵守该规则并忽略其他规则。

e.g: in CSS:

例如:在 CSS 中:

.calendar{font-size: 12px !important:}

in jQuery:

在 jQuery 中:

$('.calendar').css('font-size','12px !important');

回答by Manuelvalles

Change general font size (fullcalendar.css) except Modals , addevent and edit event

更改除 Modals 、 addevent 和 edit 事件之外的一般字体大小 (fullcalendar.css)

body .fc { 
   font-size: 1.5em;  <--- change here for general 
}

回答by Manuelvalles

I have found the cause, not sure why this is causing the issue but when I didn't declare the document type as

我找到了原因,不确定为什么会导致问题,但是当我没有将文档类型声明为

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

it wouldn't change the font size.

它不会改变字体大小。

Thanks

谢谢