Author Topic: [code] CSS  (Read 5009 times)

0 Members and 1 Guest are viewing this topic.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
[code] CSS
« on: December 04, 2010, 08:52:15 am »
Hello, in my website:

www.davidgom.co.cc


I'd like to post some code (Python and Calculator code) and I would like to know if any of you has the
Code: [Select]
tags CSS, I've checked Omnimaga's CSS, but it's divided into 3 CSS classes and I don't get it.


Bottom of the question, does anyone have a CSS Class code for programming code (not highlighted, just that box with background, specific size, font, etc)


Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: [code] CSS
« Reply #1 on: December 04, 2010, 11:25:20 am »
in http://www.omnimaga.org/Themes/omnimaga4/style.css, search for "code".  This is the style for the box.  The box is made up of codeaheader and code.  Wherever you have the div attribute for code, just do <div class="code"> or <div class="codeheader">
Code: [Select]
.code
{
color: #000000;
background-color: #FFFFFF;
font-family: "courier new", "times new roman", monospace;
font-size: small;
line-height: 1.3em;
/* Put a nice border around it. */
border: 1px solid #000000;
margin: 1px auto 1px auto;
padding: 1px;
width: 99%;
/* Don't wrap its contents, and show scrollbars. */
white-space: nowrap;
overflow: auto;
/* Stop after about 24 lines, and just show a scrollbar. */
max-height: 24em;
}

/* The "Quote:" and "Code:" header parts... */
.quoteheader, .codeheader
{
color: #000000;
text-decoration: none;
font-style: normal;
font-weight: bold;
font-size: x-small;
line-height: 1.2em;
}

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: [code] CSS
« Reply #2 on: December 04, 2010, 01:18:57 pm »
in http://www.omnimaga.org/Themes/omnimaga4/style.css, search for "code".  This is the style for the box.  The box is made up of codeaheader and code.  Wherever you have the div attribute for code, just do <div class="code"> or <div class="codeheader">
Code: [Select]
.code
{
color: #000000;
background-color: #FFFFFF;
font-family: "courier new", "times new roman", monospace;
font-size: small;
line-height: 1.3em;
/* Put a nice border around it. */
border: 1px solid #000000;
margin: 1px auto 1px auto;
padding: 1px;
width: 99%;
/* Don't wrap its contents, and show scrollbars. */
white-space: nowrap;
overflow: auto;
/* Stop after about 24 lines, and just show a scrollbar. */
max-height: 24em;
}

/* The "Quote:" and "Code:" header parts... */
.quoteheader, .codeheader
{
color: #000000;
text-decoration: none;
font-style: normal;
font-weight: bold;
font-size: x-small;
line-height: 1.2em;
}

Thanks much, I can use that in my website, right?

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [code] CSS
« Reply #3 on: December 04, 2010, 07:43:21 pm »
(Note: In Omnimaga CSS, do not use the stuff for CODE tags elsewhere. It's buggy in Opera and I haven't figured out how to fix them yet.)
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: [code] CSS
« Reply #4 on: December 04, 2010, 09:04:34 pm »
How is it buggy in opera? I could work on it if you want.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [code] CSS
« Reply #5 on: December 04, 2010, 09:44:53 pm »
With long lines of text, it stretches outside the screen and the topic gets impossible to browse. I believe someone tried to help me fix it a while ago, but it didn't work...

On SMF I saw some code that might fix it but I didn't have time to do it. I'll need to check again later.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: [code] CSS
« Reply #6 on: December 05, 2010, 09:42:53 am »
With long lines of text, it stretches outside the screen and the topic gets impossible to browse. I believe someone tried to help me fix it a while ago, but it didn't work...

On SMF I saw some code that might fix it but I didn't have time to do it. I'll need to check again later.

Hum... So has anyone got other code CSS?

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: [code] CSS
« Reply #7 on: December 05, 2010, 10:56:15 am »
With long lines of text, it stretches outside the screen and the topic gets impossible to browse. I believe someone tried to help me fix it a while ago, but it didn't work...

On SMF I saw some code that might fix it but I didn't have time to do it. I'll need to check again later.

Hum... So has anyone got other code CSS?

The CSS does work, it's just got that glitch in Opera, which isn't really obvious unless you have a single line of code long enough to stretch past the entire page. Not sure about this, but try it but without the white-space:nowrap line.
« Last Edit: December 05, 2010, 11:03:00 am by Deep Thought »




Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: [code] CSS
« Reply #8 on: December 05, 2010, 01:39:07 pm »
With long lines of text, it stretches outside the screen and the topic gets impossible to browse. I believe someone tried to help me fix it a while ago, but it didn't work...

On SMF I saw some code that might fix it but I didn't have time to do it. I'll need to check again later.

Hum... So has anyone got other code CSS?

The CSS does work, it's just got that glitch in Opera, which isn't really obvious unless you have a single line of code long enough to stretch past the entire page. Not sure about this, but try it but without the white-space:nowrap line.

I'll go with that code since almost nobody uses Opera :)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [code] CSS
« Reply #9 on: December 05, 2010, 08:15:32 pm »
Well there are a bunch who does, just far less much than Firefox and Chrome. Opera was never as popular as the others because it used to not be free. Now it's free but sometimes they fall behind in web standards (although not as much as IE)
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: [code] CSS
« Reply #10 on: December 06, 2010, 07:47:19 am »
Well there are a bunch who does, just far less much than Firefox and Chrome. Opera was never as popular as the others because it used to not be free. Now it's free but sometimes they fall behind in web standards (although not as much as IE)

I would say Chrome is gaining popularity and Safari is almost exclusively used in Macs

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [code] CSS
« Reply #11 on: December 06, 2010, 12:33:56 pm »
Yeah I keep hearing about Chrome since the past year. A lot of people loved Firefox, but they were annoyed at the crashes around version 1.5 until 3.0 came out and it takes a long while to startup. On my Intel Core i7 860 @ 2.80 GHz with 8 GB of RAM, it still takes up to 5 seconds to startup. Opera and IE8 takes half a second and Chrome 1 second. Imagine on older computers. I wouldn't be surprised if Chrome topped Firefox soon. I personally stick to Opera but if I notice they start getting too far behind in web standards and that too much valid code stops working, they will lose me as user.

As for Safari, it's not any faster than IE on Windows but it renders pages more properly. It's more useful on Mac.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: [code] CSS
« Reply #12 on: December 07, 2010, 03:50:00 pm »
Yeah I keep hearing about Chrome since the past year. A lot of people loved Firefox, but they were annoyed at the crashes around version 1.5 until 3.0 came out and it takes a long while to startup. On my Intel Core i7 860 @ 2.80 GHz with 8 GB of RAM, it still takes up to 5 seconds to startup. Opera and IE8 takes half a second and Chrome 1 second. Imagine on older computers. I wouldn't be surprised if Chrome topped Firefox soon. I personally stick to Opera but if I notice they start getting too far behind in web standards and that too much valid code stops working, they will lose me as user.

As for Safari, it's not any faster than IE on Windows but it renders pages more properly. It's more useful on Mac.

I like Chrome due to speed, less visual, more speed, just like my programs.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [code] CSS
« Reply #13 on: December 08, 2010, 12:04:20 am »
The only thing I dislike about it is how the last tab opened closes the entire program when trying to close the tab and how there are no Windows title bar at the top of Chrome Window.

Opera switched to that look as well recently and I simply re-installed an old theme that reverted the change. Sadly, Chrome themes won't let me change this...
« Last Edit: December 08, 2010, 12:05:19 am by DJ Omnimaga »
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: [code] CSS
« Reply #14 on: December 09, 2010, 11:11:44 am »
Maybe tonight I'll implement code feature in my website :)