pre {
white-space: pre-wrap;
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
word-wrap: break-word;
}
Archive for the ‘ css ’ Category
Fix Dodgy Font Rendering in CSS
Posted byIf your fonts don’t quite look smooth then apply the following CSS:
html {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
}
Vertically Align in CSS
Posted byIf you need to align anything vertically in CSS, apply the following class:
.verticalAlign {
position: relative;
top: 50%;
transform: translateY(-50%);
}
Fixing Drupal’s Clearfix CSS
Posted byDrupal’s default clearfix CSS leaves a gap at the bottom of the page, this removes this:
.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
font-size: 0;
}
.clearfix { display: inline-block; }
/* \*/
* html .clearfix { height: 1%; }
.clearfix { display: block; }
/* */
Html Form Buttons not displaying correctly in mobile safari [Solved]
Posted byThis is problem caused by safari attempting to default buttons in the mobile browser to its own apple look. A simple fix can be done using CSS. First add a class to your input button tag in the form which you may already have put there:
[sourcecode language=’html’][/sourcecode]
then in your stylesheet add the following to fix the issue once and for all:
[sourcecode language=’css’].mySubmitClass {
-webkit-appearance: none;
}[/sourcecode]
How to Make Italic Using CSS?
Posted byTo make text italic in CSS use the following:
font-style:italic;