简体   繁体   English

如何为我的Wordpress网站的其余epsilon设置主题?

[英]How can I theme the remaining epsilon of my Wordpress site?

I am working on a Wordpress site, presently at http://dev.cjshayward.com , with a child theme of twentysixteen. 我正在一个Wordpress网站上工作,目前在http://dev.cjshayward.com上 ,其子主题为26。 For now the only customization I have is the style.css, although slightly down the road I want to edit eg the 404 page to include the interesting parts of https://cjshayward.com/missing.html . 目前,我唯一的自定义设置是style.css,尽管我想编辑一下,例如404页面,其中包括https://cjshayward.com/missing.html的有趣部分。 The two changes I am most interested in now are meant to be usable and boring in the best sense of the term: underlined blue links for unvisited pages and underlined purple for visited, and no text smaller than the default font size. 我现在最感兴趣的两个更改是在术语的最佳意义上是可用的和无聊的:未访问页面的带下划线的蓝色链接和已访问页面的带下划线的紫色,没有小于默认字体大小的文本。

My changes have affected most text as desired, but the logo link "CJS Hayward" at the top left is black unless you hover over it, and some internal links are a different shade of blue (NB different from where they were copied, where they are the default color). 我的更改影响了大多数文本,但除非将鼠标悬停在徽标上,否则左上角的徽标链接“ CJS Hayward”为黑色,并且某些内部链接的阴影为蓝色(与复制位置,复制位置不同)是默认颜色)。 I've tried inspecting the elements in question from Chrome's debugger, and Chrome shows my overrides as active and (with a little help from !important) contrary colorings and sizings as inactive, but those holdouts look like plain old untweaked twentysixteen. 我尝试从Chrome的调试器中检查有问题的元素,然后Chrome将我的替代显示为活动状态,并且(在!important的帮助下)将相反的颜色和尺寸设置为非活动状态,但是这些保留看上去像是普通的旧的未减弱的26。

My child theme style.css is: 我的子主题style.css是:

/*
 Theme Name:   Twenty Sixteen UX Tweaks Child
 Theme URI:    https://cjshayward.com/twenty-sixteen-ux-tweaks-child/
 Description:  Twenty Sixteen UX Tweaks Child Theme
 Author:       CJS Hayward
 Author URI:   https://cjshayward.com
 Template:     twentysixteen
 Version:      1.0.0
 License:      MIT
 License URI:  https://opensource.org/licenses/MIT
 Tags:         ux, usability, light, dark, two-columns, right-sidebar,          responsive-layout, accessibility-ready
 Text Domain:  twenty-sixteen-ux-tweaks-child
*/
a
    {
    text-decoration: underline;
    }
a:alink, a:active, .site-branding .site-title a:active
    {
    color: #800000;
    }
a:link, .site-branding .site-title a:link
    {
    color: #0000ee !important;
    } 
a:vlink, a:visited, .site-branding .site-title a:link
    {
    color: #551a8b !important;
    }    
body, button, .entry-footer, input, select, .site-title, textarea, .widget,
.widget-title, h2.widget, h2.widget-title
    {    
    font-family: Verdana, Arial, sans !important;
    font-size: 20px !important;
    }

How can I get the top "CJS Hayward" link, and the widget h2's in the right column, to be respectively colored and sized by rules I define in the child style.css? 如何获得顶部的“ CJS Hayward”链接以及右栏中的小部件h2,以分别根据在子style.css中定义的规则进行着色和设置大小?

If I understand you correctly, you want all your links (include .site-branding) to be blue, and all visited to be red for example. 如果我对您的理解正确,那么您希望所有链接(包括.site-branding)均为蓝色,例如,所有访问的链接均为红色。

If so, your css rules must be: 如果是这样,您的css规则必须是:

body, button, .entry-footer, input, select, .site-title, textarea, .widget, .widget-title, h2.widget, h2.widget-title
{    
    font-family: Verdana, Arial, sans !important;
    font-size: 20px !important;
}
a, a:link {
    text-decoration: underline;
    color: blue;
}
a:visited {
    color: red;
}
a:hover {
    //color for cover;
}
a:active {
    color: #800000
}

The link states must be defined in this order, according w3schools 根据w3schools ,必须按此顺序定义链接状态

If you want to style your logo differently, then you can use .site-branding .site-title a 如果您想以其他方式设置徽标样式,则可以使用.site-branding .site-title a

If you want to style the logo and the widget title, add this in child's style.css 如果要设置徽标和小部件标题的样式,请将其添加到孩子的style.css中

.site-branding .site-title a,
.widget .widget-title {
   background: #0000ee;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM