2016-05-16 47 views

回答

0

该tric将使用float: left。这里的CSS:

CSS

#titleBar .toggle { 
    height: 60px; 
    left: 0; 
    position: relative; /*to make the float work*/ 
    top: 0; 
    width: 80px; 
    z-index: 2; 
    float: left; /*the magic*/ 
} 
#titleBar .title { 
    display: block; 
    position: relative; 
    letter-spacing: 2px; 
    line-height: 44px; 
    font-size: 1.3em; 
    font-weight: 700; 
    text-align: left; /*possibly what you meant*/ 
    text-transform: uppercase; 
    color: #fff; 
    z-index: 1; 
    float: left; /*the magic*/ 
} 

浮动使浮动跨度彼此相邻,解决你的问题。希望这会有所帮助!

+0

我改了一下我的代码。虽然它没有显示在在线网页上,但是通过创建一个ID为“logo”并将其命名为CECE的html元素,我可以在标题栏中显示CECE。但是,当我这样做时Google Chrome会将网页识别为移动网页,并且只会显示移动网页。我的CSS中没有任何内容可以说明这一点,并且可以在其他浏览器中使用。我清除了缓存,并且非常困惑。 – Curb

+0

这是奇特的。我可以看到这个版本的代码吗? –

1

我只是说这在Chrome控制台,但增加了该位后<span class="toggle"

<span class="toggle-right-title">Text</span> 

那么CSS应该是这样的

.toggle-right-title { 
margin-left: 35px; 
font-size: 20px; 
color: #fff; 
font-weight: bold; } 

您可以更改和自定义这是需要的话

相关问题