The Style of pre Tag That I Like

By Zhiqiang Ma On Nov 27, 2012

I use <pre> tag a lot in the html. I believe the guys that usually past codes into the pages will like it too.

I use the pre tag to list programming code such as C/C++, php, Linux shell output and some other content that is suitable for Monospace font.

The effect is what it is here. It has a scroll bar and it has a solid frame which will make it clear.

The style of pre tag I like most is this one:

pre {
    border: 1px dashed #888;
    padding: 5px 10px;
    margin: 0 0 1em 0;
    overflow: auto;
}

/* no vertical scrollbars for standards-compliant browsers / / no vertical scrollbars for IE 7 / *:first-child+html pre:hover { padding-bottom: 20px; overflow-y: hidden; overflow: visible; overflow-x: auto; } / no vertical scrollbars for IE 6 */ * html pre:hover { padding-bottom: 20px; overflow: visible; overflow-x: auto; }

By: Zhiqiang Ma Last updated: Nov 27, 2012 Views: 516
Tags: , ,

About Zhiqiang Ma

Zhiqiang Ma is a PhD candidate at Dep. of CSE, HKUST. He is interested in system software for cloud computing, virtualization of large-scale distributed system, etc. Find Zhiqiang on Facebook, Twitter, LinkedIn and Google+.

Like this post? Subscribe Fclose.com's RSS feed.
Have questions not covered here? Ask Fclose.
One Comment to The Style of pre Tag That I Like | Add Comment
Add your comments, share your thoughts

Be nice. Keep it clean. Stay on topic. No spam.