Add line-height to text within [syntax=php][/syntax] tags
Moderator: General Moderators
Add line-height to text within [syntax=php][/syntax] tags
At the moment it's quite difficult to read the code people provide because of the lack of line-height/leading. Using { line-height: 1.2; } seems to be the preferred option.
Re: Add line-height to text within [syntax=php][/syntax] tag
If you have Greasemonkey and somewhere to host a CSS file, you can modify the stylesheet however you want (as I do).
This Greasemonkey script appends a new link tag to the head tag of every page on forums.devnetwork.net. The link references a custom stylesheet hosted locally.
Here is the stylesheet I use.
This Greasemonkey script appends a new link tag to the head tag of every page on forums.devnetwork.net. The link references a custom stylesheet hosted locally.
Code: Select all
// ==UserScript==
// @name DevNetwork.net Custom Style
// @namespace http://localhost/
// @description Adds a custom stylesheet.
// @include http://forums.devnetwork.net/*
// ==/UserScript==
var link = document.createElement('link');
link.type = 'text/css';
link.href = 'http://localhost/custom.css';
link.rel = 'stylesheet';
document.head.appendChild(link);Code: Select all
.content .syntax {
background-color: inherit;
border-width: 0;
color: #444444;
display: block;
font-family: 'Courier New', Courier, monospace;
font-size: 0.9em;
line-height: 1.2em;
margin: 0 0 0 0.2em;
padding: 0;
width: auto;
}
.content .syntax-header {
border-width: 0;
color: #B4B9BF;
font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 0.8em;
font-weight: normal;
margin: 0;
padding: 0.2em 0;
text-align: right;
}
.syntax-header a:link, .syntax-header a:visited {
border-bottom: 1px dotted #B4B9BF;
color: #B4B9BF;
text-decoration: none;
}
.syntax-header a:hover, .syntax-header a:active {
border-bottom: 1px dotted #FF1010;
color: #FF1010;
text-decoration: none;
}
.syntax-content {
background-color: #F4F7F8;
border-color: #D4D9DF;
border-style: dotted;
border-width: 1px 0;
line-height: 1.2em;
margin: 0;
padding: 0;
}
.syntax-content div {
padding: 0.3em;
}- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: Add line-height to text within [syntax=php][/syntax] tag
I've found that lack of proper indentation and line-lengths of more than 80 characters makes this happen :\MichaelR wrote:At the moment it's quite difficult to read the code people provide because...
The Greasemonkey and stylesheet idea sounds pretty cool i might give it a go myself.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering