着色句子CSS的第一个单词 [英] Color the First word of Sentence CSS

查看:81
本文介绍了着色句子CSS的第一个单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

页面< / DIV>

使用的CSS是

  .logoS {
padding:0px;
float:left;
font-family:'Open Sans',Helvetica,Arial,sans-serif;
颜色:白色;
border:固体1px黑色;
font-weight:bold;
font-size:22px;
}

.logoS :: nth-word(1){
margin-right:20px;
}

我只想着色TITLE,换句话说,


$ b

解决方案

试试这个,希望对您有所帮助。 snippetdata-lang =jsdata-hide =falsedata-console =truedata-babel =false>

  .logoS:before {color:red; content:Title;}  

< div class = logoS> Of The Page< / div>

I was trying to color just first WORD of sentence

<div class="logoS">Title Of The Page</div>

CSS which am using is

.logoS{
    padding: 0px;
    float: left;
    font-family: 'Open Sans', Helvetica, Arial, sans-serif;
    color: white;
    border:solid 1px black;
    font-weight: bold;
    font-size: 22px;
}

.logoS::nth-word(1) {
  margin-right: 20px;
}

i just want to color "TITLE" not other words, any solution

解决方案

Try this, hope this will help .

.logoS:before {
  color: red;
  content: "Title ";
}

<div class="logoS">Of The Page</div>

这篇关于着色句子CSS的第一个单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆