请懂CSS样式的大佬帮忙给解决个标题宽度的问题

查看 44|回复 3
作者:xinglinboy   
最近在调试一个模板,所有地方都符合,就是文章的标题如果字数如果超过16个汉字,在首页显示时,多出的部分就会被省略号所代替,文章内页的TITLE标题也是这样,自己不太懂CSS,搞了半天没搞明白,麻烦懂的大佬给看下,应该改什么地方的参数,谢谢。
CSS的代码如下:
[CSS] 纯文本查看 复制代码::selection{background:rgba(0,149,255,.1)}
a{color:#444444b5;text-decoration:none}
a:active,a:hover{color:#444}
code,pre{background:#f3f3f3;font-size:.92857em;font-family:Menlo,Monaco,Consolas,"Lucida Console","Courier New",monospace}
code{padding:2px 4px;color:#b94a48}
pre{overflow:auto;padding:8px;max-height:400px}
pre code{padding:3px;color:#444}
blockquote{margin:1em 0;padding-left:1.5em;border-left:4px solid #eee;color:#666}
input[type=email],input[type=password],input[type=text],input[type=url],textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:5px;width:100%;border:1px solid #e9e9e9;border-radius:2px}
textarea{resize:vertical}
.comment-content a,.post-content a,.post-meta a,.widget a{border-bottom:1px solid #eee}
.comment-content a:hover,.post-content a:hover,.post-meta a:hover,.widget a:hover{border-bottom-color:transparent}
#header{padding-top:35px}
.title{margin-top:10px;color:#444444b5;text-align:center;letter-spacing:6px;font-weight:700;font-size:2em}
@media screen and (min-width:760px){.title{font-size:3em}}
.description{position:relative;top:-1.2em;margin:.4em 0 0;color:#919191;text-align:center;font-size:1em}
@media screen and (min-width:760px){.description{font-size:2em}}
@media screen and (min-width:760px){nav{text-align:center;font-weight:200;font-size:1em;line-height:2em}}
nav{z-index:150;-webkit-overflow-scrolling:touch}
nav a{margin-right:-1px;padding:0 10px;border-bottom:none;border-radius:6px;color:#444444b5;font-size:1.8em;line-height:32px}
nav .current{background:#8a97a014}
.search{position:relative;display:inline-block;padding-left:10px}
.search .text{margin:0;padding:0;width:100px;outline:0;border:none;background:0 0;letter-spacing:-.625px;font-weight:300;font-size:1.7em;-webkit-transition:all cubic-bezier(.15,1,.5,1) .8s;-o-transition:all cubic-bezier(.15,1,.5,1) .8s;transition:all cubic-bezier(.15,1,.5,1) .8s}
::-webkit-input-placeholder{color:#444444b5}
@media screen and (min-width:760px){.post{margin:2em;font-size:18px}}
.post-title{font-size:1em}
.post #tag{font-size:1.5em}
.post h2 span:before{margin-right:5px;color:#ff6d6d94;content:"※"}
.post-content a{position:relative;color:#ff4e6a;text-decoration:none;word-wrap:break-word;-webkit-transition:all .35s;transition:all .35s}
.post-content a:focus,.post-content a:hover{color:#ff4e6a}
.post-content a::after{position:absolute;right:0;bottom:-2px;width:0;border-bottom:1px solid;content:"";-webkit-transition:width .35s;transition:width .35s}
.post-content a:hover::after{left:0;width:100%}
.post-content h1 h2 h3{position:relative;padding-bottom:10px}
.post-content h1:before{margin-right:5px;color:#ff6d6d;content:"「"}
.post-content h1:after{margin-left:5px;color:#ff6d6d;content:"」"}
.post-content h2:before{margin-right:5px;color:#ff6d6d;content:"「"}
.post-content h2:after{margin-left:5px;color:#ff6d6d;content:"」"}
.post-content h3:before{margin-right:5px;color:#ff6d6d;content:"「"}
.post-content h3:after{margin-left:5px;color:#ff6d6d;content:"」"}
.post-author{margin:20px 15px 0 0;padding:20px 0;border-top:1px solid #eee;border-bottom:1px solid #eee}
.post-author-bottom{margin-bottom:30px}
.post-author-flextop{display:flex;align-items:flex-start}
.post-author .avatar{width:60px;height:60px;border-radius:100%}
.post-author-left{margin-top:-20px;margin-left:25px}
.post-author h3{margin-top:15px;margin-top:20px;margin-bottom:15px;font-size:24px;line-height:1}
.post-author p{margin-top:0;margin-bottom:0;color:rgba(0,0,0,.6);font-size:18px}
.post .tags a{clear:both;margin-top:12px;padding:5px;height:28px;border-radius:5px;background-color:#a5a5b112;color:#000;font-size:14px;line-height:2}
.protected .text{width:50%}
.page-navigator{margin:25px 0;padding:0;list-style:none;text-align:center}
.page-navigator li{display:inline-block;margin:0 4px}
.page-navigator a{display:inline-block;padding:0 10px;height:30px;line-height:30px}
.page-navigator a:hover{background:#eee;text-decoration:none}
.page-navigator .current a{background:#eee;color:#444}
@media screen and (min-width:760px){#comments{margin:2em}}
#comments{color:#444444b5}
#comments .submit{padding:5px 10px;border:1px solid #e9e9e9;border-radius:1px;background:#fff;cursor:pointer;user-select:none}
.comment-list,.comment-list ol{margin:0;padding:0;list-style:none}
.comment-list li{margin-top:10px;padding:14px;border:1px solid #eee}
.comment-list li.comment-level-odd{background:#f6f6f3}
.comment-list li.comment-level-even{background:#fff}
.comment-list li.comment-by-author{background:#fff}
.comment-list li .comment-reply{text-align:right;font-size:.92857em}
.comment-meta a{color:#999;font-size:.92857em}
.comment-author{display:block;margin-bottom:3px;color:#444}
.comment-author .avatar{float:left;margin-right:10px;width:45px;height:45px;border-radius:100%}
.comment-author cite{font-weight:700;font-style:normal}
.comment-list .respond{margin-top:15px;border-top:1px solid #eee}
.respond .cancel-comment-reply{float:right;margin-top:15px;font-size:.92857em}
#comment-form label{display:block;margin-bottom:.5em;font-weight:700}
#comment-form .required:after{color:#c00;content:" *"}
#footer{padding:3em 0;color:#999;text-align:center;line-height:1.5}
.comment-content,.post-content{word-wrap:break-word;line-height:1.5}
.comment-content h2,.post-content h2{font-size:1.28571em}
.comment-content img,.comment-content video,.post-content img,.post-content video{max-width:100%}
.comment-content a img,.post-content a img{position:relative;bottom:-4px;background:#fff}
.comment-content hr,.post-content hr{margin:2em auto;width:100px;border:1px solid #e9e9e9;border-width:2px 0 0 0}
@media(min-width:1200px){.container{max-width:952px}}
.container,.row [class*=col-]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
.container{margin-right:auto;margin-left:auto;padding-right:10px;padding-left:10px}
.row [class*=col-]{padding-right:10px;padding-left:10px;min-height:1px}
.row [class*="-pull-"],.row [class*="-push-"]{position:relative}
.col-mb-12{width:100%}
首页的代码如下:
[PHP] 纯文本查看 复制代码need('header.php');
?>
        next()): ?>
        
                        [url=]permalink() ?>">sticky(); $this->title(20, '...') ?>[/url]
        
       
    pageNav('« 前一页', '后一页 »'); ?>
need('footer.php'); ?>
文章页的代码如下:
[PHP] 纯文本查看 复制代码need('header.php');?>
   
        
            content(); ?>
        
        tags(' ', true, '暂无标签'); ?>
        
        [url=]author->permalink(); ?>" rel="author">
            author(); ?>" src="options->logoUrl() ?>" class="avatar">[/url]
            
                [url=]author->permalink(); ?>" rel="author">author(); ?>[/url]
                options->p() ?>
            
        
   
    need('comments.php'); ?>
need('footer.php'); ?>

大佬, 代码

px307   

应该不是css控制的,是代码里写的  sticky(); $this->title(20, '...')
px307   

文章页的title没看出显示在哪里 , 是   content(); ?>这里显示吗
zhuxiangyu1024   

$this->title(20, '...')改成$this->title()或者$this->title(999,'...')  依次尝试,很多年不写了。
您需要登录后才可以回帖 登录 | 立即注册

返回顶部