/home/shakir

26 Dec, 2007

CSS for code block

Posted by: shakir in Information Insemination




If you’re wondering how do I actually get the nicely boxed code block in my blog as this;

 

then the answer to it is just to have this in my CSS:

pre {
        border: 1px dashed #bbb;
        font-size: 75%;
        padding: 5px;
        color: #808080;
        background: #F1F1FF;
        overflow: auto;
}

and later I would just wrap whatever text I want to be in the box with the pre tag in my HTML codes, like this;

<pre>
This is a code example
</pre>

and should get this output (including the dashed-box):

This is a code example

and that’s all. It’s just so easy..



Bookmark this page:


Subscribe to feed

 

Add to Google Reader or Homepage Subscribe in Bloglines

Powered by FeedBurner

Tags:

1 Response to "CSS for code block"

1 | Isaac Marquez

June 3rd, 2008 at 9:39 pm

Avatar

I am producing a DVD. It is my understanding that CSS will prevent unauthorized duplications. Is this correct? If not, how can i prevent unauthorized duplications?

Comment Form


  • tebu: nak tanya sikit, untuk maxis punya kenapa dia ada keluar error +CME ERROR: SIM PIN required. user: maxis pass: wap betui ka..sim pin tu nak ke
  • shakir: Ditesh: I'm still able to download the game here from my end, but anyway, I've emailed you the game. p/s: The new Golden Axe game is in the making
  • Ditesh Gathani: Hi, I've been trying to download the said software but the site keeps timing out. Would it be possible for you to share the software through email?
  • apis: he he T Bag....
  • apis: cayalah
  • achoi: Salam, Buku tentang network security xde ke bang. Klu ada nk tempah awl² skit.hee :D
  • shakir: I blog about this actually because I was frustrated when I got no reply from the hosting company after reporting to them about this, though there was
  • Danesh: Talk to the hosting company and get to sponsor you a co-hosted package for your discovery... :D
  • shakir: Thanks for the invite bang. But then, I'm just a (PHP) script kiddie, tak layak nak masuk competition ni.. :)
  • shakir: I've already updated the firmware, and I don't keep copy of it. Sorry.

About


Twitter

Disclaimer

The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my own personal opinion. Inappropriate comments will be deleted at the authors discretion. All code samples (if any, ever) are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.