我有一些頁面,我的僱主要求選項卡式頁面的標題中的一部分以斜體顯示部分標題,例如,從NewsNow到News Now(沒有空格)。問題是頁面是動態生成的,我需要添加一個CSS規則。是否有一個僞類/元素,我可以添加到CSS來做到這一點?這裏是用於創建標籤頁的模板:需要使用css指定特定數量的字符
{% block extracss %}
<link rel="stylesheet" href="{% static 'css/jquery/jquery.ui.theme.css' %}">
<link rel="stylesheet" href="{% static 'css/jquery/jquery.ui.core.css' %}">
<link rel="stylesheet" href="{% static 'css/jquery/jquery.ui.tabs.css' %}">
{% endblock extracss %}
{% block page_content %}
<div id="tabs">
<ul>
{% for tab_found in tabs_on_page %}
<li>
<a href="#tabs-{{ tab_found.order }}">{{ tab_found.title }}</a>
</li>
{% endfor %}
</ul>
{% for tab_found in tabs_on_page %}
<div id="tabs-{{ tab_found.order }}">
{{ tab_found.html_blob|safe }}
</div>
{% endfor %}
</div>
{% endblock %}
{% block extrajs %}
<script src="/static/core/js/jquery/jquery-ui-1.10.0.custom.min.js">
</script>
<script>
jQuery(document).ready(function(){jQuery("#tabs").tabs();});
</script>
{% endblock extrajs %}
不要期望CSS中的任何內容,使用jQuery或JavaScript –
您需要一個不存在的第n個字母選擇器 –
@AlexK。是的,比瀏覽器會哭求幫助,因爲人們會開始使用'nth-letter' [this](http://stackoverflow.com/a/10429673/1542290)目的 –