The Essential Quick Code Sheets

Coding Critique is the place to post source code for peer review by other members of DevNetwork. Any kind of code can be posted. Code posted does not have to be limited to PHP. All members are invited to contribute constructive criticism with the goal of improving the code. Posted code should include some background information about it and what areas you specifically would like help with.

Popular code excerpts may be moved to "Code Snippets" by the moderators.

Moderator: General Moderators

Post Reply
User avatar
Sindarin
Forum Regular
Posts: 521
Joined: Tue Sep 25, 2007 8:36 am
Location: Greece

The Essential Quick Code Sheets

Post by Sindarin »

I took my time to write these files over time and I keep adding to them as I learn more code. The HTML and CSS snippets contain totally valid code.
They provide a useful reference to each language's useful (IMO) functions. They might come in handy for you as well.

HTML Snippets » download

CSS Snippets » download

JQuery » download

Actionscript 2 » download

PHP » download

C++ » download

Suggestions are welcome :)
Last edited by Sindarin on Sun Nov 01, 2009 3:09 pm, edited 18 times in total.
User avatar
Jammerious
Forum Commoner
Posts: 59
Joined: Sat Jun 27, 2009 11:30 am
Location: Slovenia (EU)

Re: The Essential HTML/CSS Code Sheets

Post by Jammerious »

Hello there,
this will come in handy, and I found out that there are still html tags I have not yet met, like the fieldset and definition list, so thank you mucho grande =)
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Re: The Essential HTML/CSS Code Sheets

Post by kaszu »

In CSS you have links styled twice.
No styles for headings? What about line-height?

Some CSS I would add:

Code: Select all

table {
    border-collapse: collapse;
}
input, select, textarea {
    /* Set box sizing for all except IE6 and 7. All inputs will be exactly 300px in all other browsers except IE6 and 7 where it will be 300+ */
    width: 300px;
    box-sizing: border;
    -moz-box-sizing: border;
    -webkit-box-sizing: border;
    -ms-box-sizing: border-box; /* this works only for IE8 */
}
textarea {
    font: 12px Verdana, Arial, Helvetica, sans-serif; /* default font looks weird IMO */
}
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: The Essential HTML/CSS Code Sheets

Post by papa »

I usually start out with http://www.blueprintcss.org/ and then edit it from there.
User avatar
Sindarin
Forum Regular
Posts: 521
Joined: Tue Sep 25, 2007 8:36 am
Location: Greece

Re: The Essential Quick Code Sheets

Post by Sindarin »

Added download links instead of posting code here and now supporting more standards for HTML!
Also added snippets for JQuery, Actionscript 2, PHP and C++ :D
Post Reply