sách gpt4 ai đã đi

html - 是否可以使用 CSS 定位 HTML(文本)? - 它显示为(文本)作为 ID

In lại 作者:行者123 更新时间:2023-11-28 13:33:48 28 4
mua khóa gpt4 Nike

我在将 Twitter 嵌入到我从 HTML 5 转换的 wordpress 运行网站时遇到问题。

我遇到的问题是推文不是我的自定义字体...

nhập mô tả hình ảnh ở đây

这是我无法使用任何 css 定位的 HTML 代码,我正在为网站上的所有文本使用使用 css 导入的自定义字体。


取自 Index.php 的 PHP 代码


Twitter:



chrome中显示的css ID是

article#twitter (text)

我试过定位:#twitter, html, body, text, (text), ".

有人教我如何让这段文本以我选择的字体显示 - 我想只使用 CSS 可以让事情变得简单!

网址:

http://www.msc-media.co.uk

这是使用 CSS 导入字体的方式

    @font-face {
font-family: 'JosefinSansStdLight';
src: url('/wp-content/themes/1/JosefinSansStd-Light-webfont.eot');
src: url('/wp-content/themes/1/JosefinSansStd-Light-webfont.eot?#iefix') format('embedded-opentype'),
url('/wp-content/themes/1/JosefinSansStd-Light-webfont.woff') format('woff'),
url('/wp-content/themes/1/JosefinSansStd-Light-webfont.ttf') format('truetype'),
url('/wp-content/themes/1/JosefinSansStd-Light-webfont.svg#JosefinSansStdLight') format('svg');
font-weight: normal;
font-style: normal;

}


p, a, h1, h2, h3, h4, h5, h6{
font:'JosefinSansStdLight';
letter-spacing: 0.1em;
}
a{font:1.25em 'JosefinSansStdLight';}
p{font:1.2em 'JosefinSansStdLight';}
h1{font:3em 'JosefinSansStdLight';}
h2{font:2em 'JosefinSansStdLight';}
h3{font:1.25em 'JosefinSansStdLight';}
h4{font:18px/27px 'JosefinSansStdLight';}
h5{font:18px/27px 'JosefinSansStdLight';}
h6{font:18px/27px 'JosefinSansStdLight';}

1 Câu trả lời

CSS“font”属性要求“font-size”和“font-family”值都有效。在你的 CSS 文件中的几个地方,你有以下内容:

font:'JosefinSansStdLight';

这不是有效的 CSS,因为它不包含“字体大小”值。您应该像对 a、p、h1、h2、h3 等所做的那样包括大小:

a{font:1.25em 'JosefinSansStdLight';}
p{font:1.2em 'JosefinSansStdLight';}
h1{font:3em 'JosefinSansStdLight';}
h2{font:2em 'JosefinSansStdLight';}
h3{font:1.25em 'JosefinSansStdLight';}
h4{font:18px/27px 'JosefinSansStdLight';}
h5{font:18px/27px 'JosefinSansStdLight';}
h6{font:18px/27px 'JosefinSansStdLight';}

或者,您可以将“字体”声明更改为“字体系列”声明:

font-family:'JosefinSansStdLight';

关于html - 是否可以使用 CSS 定位 HTML(文本)? - 它显示为(文本)作为 ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10584423/

28 4 0
行者123
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com