为什么我不能更改图像锚标记中标题的字体大小?

时间:2018-02-08 12:09:11

标签: jquery html css twitter-bootstrap

我目前正在使用我的画廊的colorbox插件:

http://www.jacklmoore.com/colorbox/

我想更改锚标记中标题的字体大小,所以我尝试在#cboxtitle的属性中添加font-size。但是,它的字体大小仍然相同。我也尝试在锚标签上进行内联样式,但无济于事。有没有办法改变锚标签的标题字体大小?

以下是我正在使用的HTML代码:

<div class="col-sm-12 col-md-4" id="section">
    <p><a class="group4" href="Images/event1.jpg" title="Gallery 1 image"><img src="Images/event1.JPG" alt="" style="height: 200px; width: 300px;"/></a></p>
</div>
<div class="col-sm-12 col-md-4" id="section">
    <p><a class="group4"  href="Images/event2.jpg" title="Gallery 2 image"><img src="Images/event2.JPG" alt="" style="height: 200px; width: 300px;"/></a></p>
</div>
<div class="col-sm-12 col-md-4" id="section">
    <p><a class="group4"  href="Images/event3.jpg" title="Gallery 3 image."><img src="Images/event3.JPG" alt="" style="height: 200px; width: 300px;"/></a></p>
 </div>

彩盒的CSS:

#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden; -webkit-transform: translate3d(0,0,0);}
#cboxWrapper {max-width:none;}
#cboxOverlay{position:fixed; width:100%; height:100%;}
#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
#cboxContent{position:relative;}
#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;}
#cboxTitle{margin:0;  font-size: 40px !important;}
#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;}
.cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;}
#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}

#cboxOverlay{background:#fff; opacity: 0.9; filter: alpha(opacity = 90);}
#colorbox{outline:0;}
    #cboxTopLeft{width:25px; height:25px; background:url(images/border1.png) no-repeat 0 0;}
    #cboxTopCenter{height:25px; background:url(images/border1.png) repeat-x 0 -50px;}
    #cboxTopRight{width:25px; height:25px; background:url(images/border1.png) no-repeat -25px 0;}
    #cboxBottomLeft{width:25px; height:25px; background:url(images/border1.png) no-repeat 0 -25px;}
    #cboxBottomCenter{height:25px; background:url(images/border1.png) repeat-x 0 -75px;}
    #cboxBottomRight{width:25px; height:25px; background:url(images/border1.png) no-repeat -25px -25px;}
    #cboxMiddleLeft{width:25px; background:url(images/border2.png) repeat-y 0 0;}
    #cboxMiddleRight{width:25px; background:url(images/border2.png) repeat-y -25px 0;}
    #cboxContent{background:#fff; overflow:hidden;}
        .cboxIframe{background:#fff;}
        #cboxError{padding:50px; border:1px solid #ccc;}
        #cboxLoadedContent{margin-bottom:20px;}
        #cboxTitle{position:absolute; bottom:0px; left:0; text-align:center; width:100%; color:#999;}
        #cboxCurrent{position:absolute; bottom:0px; left:100px; color:#999;}
        #cboxLoadingOverlay{background:#fff url(images/loading.gif) no-repeat 5px 5px;}

我遇到的问题:增加“图库1图片”的字体大小。

Gallery Title

2 个答案:

答案 0 :(得分:0)

从您的代码中,class id而不是#cboxTitle{margin:0; font-size: 40px !important;}

改变,

.cboxTitle{margin:0;  font-size: 40px !important;}

要,

tooltip

<强> PS:

默认情况下,在html中无法更改class User < ActiveRecord::Base has_many :is_memberships, :as => :is_memberable, :class_name => 'Membership' has_many :is_members_structures, through: :is_memberships, source: :is_memberable, source_type: 'Structure' end 的样式,您可以使用Jquery,如一条评论中所述

Here is Jquery tooltip

For tool-tip custom styling

答案 1 :(得分:0)

此选择器将应用于ID

#cboxTitle{margin:0;  font-size: 40px !important;}

但是你在HTML中使用了类,所以它必须是

.cboxTitle{margin:0;  font-size: 40px !important;}