Omnimaga

General Discussion => Technology and Development => Web Programming and Design => Topic started by: Munchor on December 04, 2010, 08:52:15 am

Title: [code] CSS
Post by: Munchor on December 04, 2010, 08:52:15 am
Hello, in my website:

www.davidgom.co.cc (http://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)

Title: Re: [code] CSS
Post by: jnesselr 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;
}
Title: Re: [code] CSS
Post by: Munchor 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?
Title: Re: [code] CSS
Post by: DJ Omnimaga 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.)
Title: Re: [code] CSS
Post by: jnesselr on December 04, 2010, 09:04:34 pm
How is it buggy in opera? I could work on it if you want.
Title: Re: [code] CSS
Post by: DJ Omnimaga 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.
Title: Re: [code] CSS
Post by: Munchor 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?
Title: Re: [code] CSS
Post by: Deep Toaster 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.
Title: Re: [code] CSS
Post by: Munchor 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 :)
Title: Re: [code] CSS
Post by: DJ Omnimaga 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)
Title: Re: [code] CSS
Post by: Munchor 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
Title: Re: [code] CSS
Post by: DJ Omnimaga 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.
Title: Re: [code] CSS
Post by: Munchor 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.
Title: Re: [code] CSS
Post by: DJ Omnimaga 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...
Title: Re: [code] CSS
Post by: Munchor on December 09, 2010, 11:11:44 am
Maybe tonight I'll implement code feature in my website :)