{"id":246,"date":"2024-06-20T00:15:06","date_gmt":"2024-06-20T00:15:06","guid":{"rendered":"https:\/\/www.yellowfalconmedia.com\/blog\/2024\/06\/20\/help-to-modify-css-in-wordpress-sitepoint\/"},"modified":"2024-06-20T00:15:06","modified_gmt":"2024-06-20T00:15:06","slug":"help-to-modify-css-in-wordpress-sitepoint","status":"publish","type":"post","link":"https:\/\/www.yellowfalconmedia.com\/blog\/2024\/06\/20\/help-to-modify-css-in-wordpress-sitepoint\/","title":{"rendered":"Help to modify CSS in WordPress &#8211; SitePoint"},"content":{"rendered":"<p>Could you help me find in this CSS file what I need to modify so that the underlined titles (h2, h3, etc.) have the correct line spacing for easy reading and so that the font size of the paragraph is like what it looks like now (currently, I have to add the HTML tag <code>&lt;p class=\"has-text-align-justify has-medium-font-size\"&gt;<\/code> to make it look like this) by default? I also want to change the appearance of the links, which currently appear in red, to the traditional blue color.<br \/>I need these changes to be visible on both the desktop and mobile versions. <\/p>\n<div class=\"lightbox-wrapper\"><a class=\"lightbox\" href=\"https:\/\/global.discourse-cdn.com\/sitepoint\/original\/3X\/0\/5\/056609c80e5e5f58bfec10fe589a384184c1f364.jpeg\" data-download-href=\"\/community\/uploads\/short-url\/LL0ckcc47ejV6FeD4aU5VeFshu.jpeg?dl=1\" title=\"Screenshot_20231210_002643_Chrome\" rel=\"noopener nofollow ugc\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/global.discourse-cdn.com\/sitepoint\/optimized\/3X\/0\/5\/056609c80e5e5f58bfec10fe589a384184c1f364_2_254x500.jpeg\" alt=\"Screenshot_20231210_002643_Chrome\" data-base62-sha1=\"LL0ckcc47ejV6FeD4aU5VeFshu\" width=\"254\" height=\"500\" srcset=\"https:\/\/global.discourse-cdn.com\/sitepoint\/optimized\/3X\/0\/5\/056609c80e5e5f58bfec10fe589a384184c1f364_2_254x500.jpeg, https:\/\/global.discourse-cdn.com\/sitepoint\/optimized\/3X\/0\/5\/056609c80e5e5f58bfec10fe589a384184c1f364_2_381x750.jpeg 1.5x, https:\/\/global.discourse-cdn.com\/sitepoint\/optimized\/3X\/0\/5\/056609c80e5e5f58bfec10fe589a384184c1f364_2_508x1000.jpeg 2x\" data-dominant-color=\"D8D3BE\"><\/p>\n<div class=\"meta\"><svg class=\"fa d-icon d-icon-far-image svg-icon\" aria-hidden=\"true\"><use href=\"#far-image\"><\/use><\/svg><span class=\"filename\">Screenshot_20231210_002643_Chrome<\/span><span class=\"informations\">774\u00d71520 195 KB<\/span><svg class=\"fa d-icon d-icon-discourse-expand svg-icon\" aria-hidden=\"true\"><use href=\"#discourse-expand\"><\/use><\/svg><\/div>\n<p><\/a><\/div>\n<p> <a class=\"attachment\" href=\"\/community\/uploads\/short-url\/1lARk7sDSaRjFh6LCXUbEVHXSmr.css\">style.css<\/a> (36.8 KB)<br \/>Often people use all sort of plugins with WP, which insert their own CSS in all sorts of places. I recently helped with a WP site using Elementor, and the number of locations CSS was stored was mind-boggling. You basically have to use the browser devtools to track down where each style is coming from and then work out where that style is stored within the godforsaken mess that\u2019s euphemistically known as WordPress.<br \/>In principle, there is no plugin that adds CSS, as far as I know. The issue is that the theme\u2019s design is not mine, and I don\u2019t know where it might come from. It\u2019s not built with any builder like Elementor or Divi; rather, it\u2019s done directly with code. This makes me think that the mentioned adjustments should be in the CSS file attached earlier, although I cannot identify it. The blog post where the applied code is most clearly visible is this one: <a href=\"https:\/\/www.fotov60.com\/2023\/12\/06\/nightshade-envenenamiento-datos\/\" rel=\"noopener nofollow ugc\">Nightshade Poisoning Data<\/a><br \/>There are at least four CSS files in there, and various ones set line heights for the text. All text seems to be set at 1.8 em in various sheets, but the one that is prevailing is <a href=\"https:\/\/www.fotov60.com\/wp-content\/litespeed\/css\/5dcb158dce52540584d3bae115f63f3c.css?ver=bf25a\">this one<\/a>.<br \/>I don\u2019t see a specific line height set for headings. I guess the author didn\u2019t think about what would happen if headings stretched over multiple lines.<br \/>You could perhaps go into any style sheet, or create a custom one (ah WordPress) and maybe set line height to something like this:<br \/><a class=\"mention\" href=\"\/community\/u\/ralphm\">@ralphm<\/a> It\u2019s the challenge of working with code created by someone else; you\u2019re unfamiliar with many of these aspects. So, are there 4 style sheets in the same sheet? Are they redundant? Would what you linked be the main one? As far as I know, the mobile version was done through CSS, correct? Would it change for both versions of the website?<br \/>The CSS example I provided would only affect the line spacing of the headers, leaving the other attributes unchanged. And what is a rem?<br \/>To make the change to the default paragraph text without having to inline it as in this post, what would I need to look for, the <code>&lt;p&gt;<\/code> tag in the CSS sheet?<br \/>So, are there 4 style sheets in the same sheet? Are they redundant?<br \/>As far as I can see, there are five separate style sheets, and more inline styles in the head of each page. They each probably have a lot in them, with various overlaps and duplications that fight it out with each other in the \u201ccascade\u201d (the C is CSS). Unfortunately, I don\u2019t really know the answers to your questions. My suggestion would be to create your own custom style sheet in WP and set any style modifications there, such that they override any styles in those other style sheets. (That\u2019s what I do when I help people with WordPress, which is thankfully very rare.)<br \/>Here\u2019s a screen shot of the CSS files I see in the inspector:<\/p>\n<div class=\"lightbox-wrapper\"><a class=\"lightbox\" href=\"https:\/\/global.discourse-cdn.com\/sitepoint\/original\/3X\/1\/6\/1678cd670ea920874b4a1a7f39bc87908a41aadf.png\" data-download-href=\"\/community\/uploads\/short-url\/3cNjYx5zIUWsQXKheUTWfOSv53F.png?dl=1\" title=\"styles\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/global.discourse-cdn.com\/sitepoint\/original\/3X\/1\/6\/1678cd670ea920874b4a1a7f39bc87908a41aadf.png\" alt=\"styles\" data-base62-sha1=\"3cNjYx5zIUWsQXKheUTWfOSv53F\" width=\"690\" height=\"232\" data-dominant-color=\"DFE2E9\"><\/p>\n<div class=\"meta\"><svg class=\"fa d-icon d-icon-far-image svg-icon\" aria-hidden=\"true\"><use href=\"#far-image\"><\/use><\/svg><span class=\"filename\">styles<\/span><span class=\"informations\">760\u00d7256 31.5 KB<\/span><svg class=\"fa d-icon d-icon-discourse-expand svg-icon\" aria-hidden=\"true\"><use href=\"#discourse-expand\"><\/use><\/svg><\/div>\n<p><\/a><\/div>\n<p>The one that\u2019s highlighted seems to be the one setting the line height for your text and headings (at least on desktop screens). I don\u2019t think there\u2019s any value in trying to modify those. Best to leave them alone.<br \/><a class=\"mention\" href=\"\/community\/u\/ralphm\">@ralphm<\/a> Upon seeing the less descriptive names of the CSS sheets, it occurred to me that they might have been created by the Litespeedcache cache plugin, which minifies, combines, etc., the CSS. That would explain why I can\u2019t find them on my server, and they might be \u201cconfusing\u201d the browser\u2019s developer console. Is that possible?<br \/> You can access a version of the website before Litespeedcache applies any adjustments if you want to check: <a href=\"https:\/\/www.fotov60.com\/2023\/12\/06\/nightshade-envenenamiento-datos\/?LSCWP_CTRL=before_optm\" rel=\"noopener nofollow ugc\">https:\/\/www.fotov60.com\/2023\/12\/06\/nightshade-envenenamiento-datos\/?LSCWP_CTRL=before_optm<\/a><br \/>Ah, I see. Interesting. Looking at the pre-Lightspeed version does seem to show just one CSS file.<br \/>The line height is set at line 152:<br \/>But that\u2019s really for all elements inside the <code>.entry<\/code> element. You can just set your desired line heights for your headings anywhere in that file. You just need to give them higher specifity than the rule copied above.<br \/>Then I must write something like this?<br \/>Sure. That will help for the H2 elements, but not the H3. You might find that spreads the lines <em>too<\/em> far apart, but just play with the setting to get it how you like it.<br \/><a class=\"mention\" href=\"\/community\/u\/ralphm\">@ralphm<\/a> I\u2019ve made the changes, and finally, I added<code> line-height: 1em;<\/code>, which seems to provide good separation. What do you think about the current styles for h2, h3, h4, etc.? <a href=\"https:\/\/www.fotov60.com\/?LSCWP_CTRL=before_optm\" rel=\"noopener nofollow ugc\">https:\/\/www.fotov60.com\/?LSCWP_CTRL=before_optm<\/a> Are they consistent, or would you change any parameters like font-size, font-weight, or any other for any of them to make their appearance correspond to their order of importance? I don\u2019t know much about CSS, but it seems like this stylesheet is quite disorganized, with elements defined in various parts of it, isn\u2019t it?<br \/>Looks okay to me. Certainly readable. I tend to like a bit more space between the lines, but as long as it\u2019s readable, that\u2019s really all that matters.<br \/>I don\u2019t know much about CSS, but it seems like this stylesheet is quite disorganized, with elements defined in various parts of it, isn\u2019t it?<br \/>That\u2019s quite common as a stylesheet gets longer and longer. There are ways of writing CSS that are designed to make things less messy, but I\u2019m not sure how much difference they really make.<br \/>Don\u2019t you think that h3 and h2 are perhaps too similar, and it might be confusing which one is more important? Or is it just me paying too much attention? <img decoding=\"async\" src=\"https:\/\/emoji.discourse-cdn.com\/apple\/joy.png?v=12\" title=\":joy:\" class=\"emoji\" alt=\":joy:\" loading=\"lazy\" width=\"20\" height=\"20\"><br \/>They are different enough from each other. But I prefer each next heading to be smaller, just to make it obvious to the visual reader what the hierarchy is.<br \/>But I prefer each next heading to be smaller, just to make it obvious to the visual reader what the hierarchy is.<br \/>Can you recommend me what to change to make the hierarchy more obviously?<br \/>Your <code>&lt;h3&gt;<\/code> text is appearing bold (on my browser at least) because bold is a default for <code>&lt;h3&gt;<\/code> text. It is not being declared bold by CSS.<br \/>Edit:<br \/>to:<br \/>Your <code>&lt;h3&gt;<\/code> text is appearing bold (on my browser at least) because bold is a default for <code>&lt;h3&gt;<\/code> text.<br \/>Happens the same to h4,h5 or h6?<br \/>To modify the paragraph style how I can do it? Now in the last post I used <code>&lt;p class=\"has-text-align-justify has-medium-font-size\"&gt;<\/code> to obtain something acceptable, because without it watches so small. I want to use orkney and serif fonts, an appropriate size to default text, and justified text if it is possible. What style lines I must write to achieve it?<br \/>Default headings are shown here:<br \/> <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\/Element\/Heading_Elements#examples\">https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\/Element\/Heading_Elements#examples<\/a><br \/> I am surprised the H5 and H6 fonts are so small.<br \/>Your CSS for <code>&lt;h1&gt;<\/code> to <code>&lt;h6&gt;<\/code> is in this file:<br \/> <a href=\"https:\/\/www.fotov60.com\/wp-content\/litespeed\/css\/5dcb158dce52540584d3bae115f63f3c.css?ver=bf25a\">https:\/\/www.fotov60.com\/wp-content\/litespeed\/css\/5dcb158dce52540584d3bae115f63f3c.css?ver=bf25a<\/a><br \/>As the code has been minified, you can unminify it using <a href=\"https:\/\/unminify.com\/\">https:\/\/unminify.com\/<\/a> (or a similar website). You will then see that the CSS for <code>&lt;h1&gt;<\/code> to <code>&lt;h6&gt;<\/code> starts at line 171.<br \/>Instead of editing that code, you could append CSS to it which will overrule previous declarations of the same properties.<br \/>You can use the shorthand font property:<br \/>W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.<br \/>. . . and the CSS color property:<br \/>W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.<br \/>As far as I can see your webpage is not downloading the Orkney font.<br \/>Now you know why I would never use WordPress <img decoding=\"async\" src=\"https:\/\/emoji.discourse-cdn.com\/apple\/grinning.png?v=12\" title=\":grinning:\" class=\"emoji\" alt=\":grinning:\" loading=\"lazy\" width=\"20\" height=\"20\">.<br \/>Your CSS for <code>&lt;h1&gt;<\/code> to <code>&lt;h6&gt;<\/code> is in this file:<br \/> <a href=\"https:\/\/www.fotov60.com\/wp-content\/litespeed\/css\/5dcb158dce52540584d3bae115f63f3c.css?ver=bf25a\" rel=\"noopener nofollow ugc\">https:\/\/www.fotov60.com\/wp-content\/litespeed\/css\/5dcb158dce52540584d3bae115f63f3c.css?ver=bf25a <\/a><br \/>As the code has been minified, you can unminify it using <a href=\"https:\/\/unminify.com\/\" rel=\"noopener nofollow ugc\">https:\/\/unminify.com\/<\/a> (or a similar website). You will then see that the CSS for <code>&lt;h1&gt;<\/code> to <code>&lt;h6&gt;<\/code> starts at line 171.<br \/>If you want see the CSS sheet before Litespeed cache optimize it you can se trough this url as I sayed in a post before<br \/><a href=\"https:\/\/www.fotov60.com\/?LSCWP_CTRL=before_optm\" rel=\"noopener nofollow ugc\">https:\/\/www.fotov60.com\/?LSCWP_CTRL=before_optm<\/a><br \/>As far as I can see your webpage is not downloading the Orkney font<br \/>Is strange, almost h1, h2\u2026et are declared with this fonts<br \/>Now you know why I would never use WordPress <img decoding=\"async\" src=\"https:\/\/emoji.discourse-cdn.com\/apple\/grinning.png?v=12\" title=\":grinning:\" class=\"emoji\" alt=\":grinning:\" loading=\"lazy\" width=\"20\" height=\"20\">.<br \/>I dont understand, dont use the same CSS rules as the others tools?<br \/>I want to obtain the cleanest CSS possible, thats why Im editing source CSS stylesheet. Later I must eliminate some things like references to lastfm or other things I never use because are outdated. Thats why I whant to make a rule to style text like this as I say in my previous post:<br \/><code>\u00bfAlguna vez te has preguntado qu\u00e9 sucede con tus obras de arte cuando las subes a internet? Imagina que cada trazo, cada pixel, puede convertirse en una arma secreta contra aquellos que intentan apropiarse de tu creatividad sin tu permiso. Bueno, resulta que ahora hay una herramienta que permite a los artistas hacer precisamente eso. \u00a1Bienvenido a la era del envenenamiento de datos!<\/code><br \/>The Orkney font is available to download from a number of websites. It is a sans-serif font, nothing like the font that I see on my browser or as seen in your own screenshot in post <span class=\"hashtag-raw\">#1<\/span>.<br \/>As it is not a Google font, I would expect to see the font downloaded to site visitors\u2019 browsers by <span class=\"mention\">@font-face<\/span>:<br \/>W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.<br \/>Of course you would need to upload the font file to your server.<br \/>Powered by <a href=\"https:\/\/www.discourse.org\">Discourse<\/a>, best viewed with JavaScript enabled<\/p>\n<p><a href=\"https:\/\/news.google.com\/rss\/articles\/CBMiTGh0dHBzOi8vd3d3LnNpdGVwb2ludC5jb20vY29tbXVuaXR5L3QvaGVscC10by1tb2RpZnktY3NzLWluLXdvcmRwcmVzcy80MzM2ODjSAQA?oc=5\">source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Could you help me find in this CSS file what I need to modify so that the underlined titles (h2, h3, etc.) have the correct line spacing for easy reading and so that the font size of the paragraph is like what it looks like now (currently, I have to&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-246","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.yellowfalconmedia.com\/blog\/wp-json\/wp\/v2\/posts\/246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yellowfalconmedia.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yellowfalconmedia.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yellowfalconmedia.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yellowfalconmedia.com\/blog\/wp-json\/wp\/v2\/comments?post=246"}],"version-history":[{"count":0,"href":"https:\/\/www.yellowfalconmedia.com\/blog\/wp-json\/wp\/v2\/posts\/246\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yellowfalconmedia.com\/blog\/wp-json\/wp\/v2\/media?parent=246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yellowfalconmedia.com\/blog\/wp-json\/wp\/v2\/categories?post=246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yellowfalconmedia.com\/blog\/wp-json\/wp\/v2\/tags?post=246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}