Coding Standards for Web Development

Similar documents
Chapter 7 Page Layout Basics Key Concepts. Copyright 2013 Terry Ann Morris, Ed.D

CSS. CSS - cascading style sheets CSS - permite separar num documento HTML o conteúdo do estilo. ADI css 1/28

CSS for Page Layout. Key Concepts

How To Create A Web Page On A Windows (For Free) With A Notepad) On A Macintosh (For A Freebie) Or Macintosh Web Browser (For Cheap) On Your Computer Or Macbook (

CST 150 Web Design I CSS Review - In-Class Lab

Web layout guidelines for daughter sites of Scotland s Environment

Web Design Basics. Cindy Royal, Ph.D. Associate Professor Texas State University

Development Perspective: DIV and CSS HTML layout. Web Design. Lesson 2. Development Perspective: DIV/CSS

Dreamweaver CS4 Day 2 Creating a Website using Div Tags, CSS, and Templates

Simply download Beepip from and run the file when it arrives at your computer.

Web Authoring CSS. Module Descriptor

{color:blue; font-size: 12px;}

Contents. Downloading the Data Files Centering Page Elements... 6

Web Design for Print Designers WEB DESIGN FOR PRINT DESIGNERS: WEEK 6

Essential HTML & CSS for WordPress. Mark Raymond Luminys, Inc mraymond@luminys.com

Further web design: Cascading Style Sheets Practical workbook

Klik op deze albums als u de foto s van onze evenementen wil ontdekken.

Web Design and Databases WD: Class 7: HTML and CSS Part 3

CREATING A NEWSLETTER IN ADOBE DREAMWEAVER CS5 (step-by-step directions)

CREATING HORIZONTAL NAVIGATION BAR USING ADOBE DREAMWEAVER CS5

Creating the Surf Shop website Part3 REVISED

CS134 Web Site Design & Development. Quiz1

ICE: HTML, CSS, and Validation

What is CSS? Official W3C standard for controlling presentation Style sheets rely on underlying markup structure

CSS - Cascading Style Sheets

Web Design with CSS and CSS3. Dr. Jan Stelovsky

Style & Layout in the web: CSS and Bootstrap

HTML and CSS. Elliot Davies. April 10th,

Creating a Resume Webpage with

JJY s Joomla 1.5 Template Design Tutorial:

Slicing and Coding the Navigation Background in CSS

CHAPTER 10. When you complete this chapter, you will be able to:

Links Getting Started with Widgets, Gadgets and Mobile Apps

Last week we talked about creating your own tags: div tags and span tags. A div tag goes around other tags, e.g.,:

Contents. Introduction Downloading the Data Files... 2

Outline of CSS: Cascading Style Sheets

Code View User s Guide

HTML5 and CSS3 Design with CSS Page 1

Level 1 - Clients and Markup

Chapter 1. Introduction to web development

Selectors in Action LESSON 3

How to Properly Compose HTML Code : 1

ITNP43: HTML Lecture 4

Fortis Theme Update Guide

CIS 467/602-01: Data Visualization

LAB 4 HTML TABLES AND FORMS

Mobile Web Site Style Guide

Chapter 1 Introduction to web development and PHP

Introduction to Adobe Dreamweaver CC

Responsive Design

GUIDE TO CODE KILLER RESPONSIVE S

.NET Best Practices Part 1 Master Pages Setup. Version 2.0

HTML5 and CSS3. new semantic elements advanced form support CSS3 features other HTML5 features

Using Style Sheets for Consistency

Web Design for Programmers. Brian Hogan NAPCS Slides and content 2008 Brian P. Hogan Do not reproduce in any form without permission

Campaign Guidelines and Best Practices

Base template development guide

Basics of HTML (some repetition) Cascading Style Sheets (some repetition) Web Design

We automatically generate the HTML for this as seen below. Provide the above components for the teaser.txt file.

COMMONWEALTH OF PENNSYLVANIA DEPARTMENT S OF Human Services, INSURANCE, AND AGING

Web Publishing Basics 2

8 STEPS TO CODE KILLER RESPONSIVE S

Advanced Editor User s Guide

Creator Coding Guidelines Toolbox

Creating Web Pages with Dreamweaver CS 6 and CSS

How to Display Weather Data on a Web Page

Pliki.tpl. boxes/facebooklike/box.tpl. boxes/login/box.tpl. boxes/pricelist/box.tpl

Stylesheet or in-line CSS CSS attributes, used in stylesheets or in-line, can define:

Microsoft Expression Web Quickstart Guide

Introduction to web development and JavaScript

Basic tutorial for Dreamweaver CS5

Table of Contents Find out more about NewZapp

HTML CSS Basic Structure. HTML Structure [Source Code] CSS Structure [Cascading Styles] DIV or ID Tags and Classes. The BOX MODEL

Advanced Drupal Features and Techniques

The Training Floor s. Webmaster s. Bible

Cascading Style Sheet (CSS) Tutorial Using Notepad. Step by step instructions with full color screen shots

Table of Contents THE DESIGNER S GUIDE TO CREATING NEWZAPP DRAG AND DROP TEMPLATES... 6 THE NEWZAPP SYSTEM... 7

<Insert Picture Here>

C:\wamp\www\webdok\07bootstrap\bootstrap dist\css\bootstrap.css 2. juli :18

Building a Horizontal Menu in Dreamweaver CS3 Using Spry R. Berdan

Responsive Web Design: Media Types/Media Queries/Fluid Images

Self Service Ticketing in ServiceCenter 6.1

WTP-101 Developing Rich Internet Applications with Java Web Frameworks

Making Responsive s

Intro to Web Design. ACM UIUC

Web Development I & II*

Create Your own Company s Design Theme

Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence

Web publishing: An introduction to CSS

HTML5 and CSS3 Part 1: Using HTML and CSS to Create a Website Layout

Cascading Style Sheets (CSS)

Citywide User Experience Design Guidelines: NYC.gov Style Guide. Final Public 11/8/2013

Click on the links below to find the appropriate place in the document

Introduction to Web Development

Advanced Online Media Dr. Cindy Royal Texas State University - San Marcos School of Journalism and Mass Communication

How to craft a modern, mobile-optimized HTML template. Jason Samuels, NCFR IT Manager DrupalCamp Twin Cities May 2012

Web Building Blocks. Joseph Gilbert User Experience Web Developer University of Virginia Library

WordPress and HTML Basics

WEB PROGRAMMING LAB (Common to CSE & IT)

Responsive HTML and Drupal

Transcription:

DotNetDaily.net Coding Standards for Web Development This document was downloaded from http://www.dotnetdaily.net/ You are permitted to use and distribute this document for any noncommercial purpose as long as you retain this license & copyrights information. This document is provided on As-Is basis. The author of this document will not be responsible for any kind of loss for you due to any inaccurate information provided in this document.

2 Coding Standards for Web Development Contents 1 HTML Coding Standards... 3 1.1 HTML General Rules... 3 1.2 HTML Markup Formatting... 4 2. CSS Coding Standards... 4 2.1 CSS General Rules... 4 2.2 CSS Formatting... 5

3 Coding Standards for Web Development 1 HTML Coding Standards 1.1 HTML General Rules 1.1.1 Always close your tags; 1.1.2 Keep your tag names lowercase: Good: Bad: <div> <p>lorem lipsum sit dolorem. </p> <DIV> <P>Lorem lipsum sit dolorem. </P> </DIV> 1.1.3 Use H1 H6 tags. For semantic and SEO reasons, try to use heading tags. The hierarchy of them in the page is important too. 1.1.4 Wrap navigation with an unordered list; <ul id="nav"> <li><a href="#">home</a></li> <li><a href="#">about</a></li> <li><a href="#">contact</a></li> </ul> 1.1.5 Always complete the alt attribute of an image; 1.1.6 For naming ID's of HTML tags, use Camel Case and for naming classes use lower case: <ul id="navcontainer" class="nav-container"> <li><a href="#">home</a></li> <li><a href="#">about</a></li> <li><a href="#">contact</a></li> </ul> 1.1.7

4 Coding Standards for Web Development 1.2 HTML Markup Formatting 1.2.1 Place a comment tag at the end of each important HTML container that notifies the end of that specific tag; <div id="loginwrapper"> <form action="" method="post"> <input type="text" name="username" class="loginusername" value="please type your email address"/><br/> <input type="password" name="password" class="loginpassword" value="please type your password"/><br/> <input type="submit" value="" class="login-button" /><br/> </form> <!-- End of #LoginWrapper --> 1.2.2 When you want to add comments inside ASP.NET Web Controls, use this syntax: <%-- ASP.NET syntax for comments --%> 1.2.3 Use one blank line to separate important HTML containers; <div id="page"> <div id="header"> <!-- HTML code --> <div id="content"> <!-- HTML code --> <div id="footer"> <!-- HTML code --> 1.2.4 Use TAB for indentation. Do not use spaces. Recommended TAB size is 4; 2. CSS Coding Standards 2.1 CSS General Rules

5 Coding Standards for Web Development 2.1.1 Use margin: 0px auto; as a CSS attribute for centering a div inside container; 2.1.2 Use.px as measurement unit in design. It s easier to control than.em and all the developers on a project can understand it; 2.1.3 Use CSS reset class, example: *{margin: 0px; padding: 0px}. You can add additional attributes to this class depending on your requirements. 2.1.4 Use structural naming convention instead of a presentational naming convention: Good: <p> Lorem lipsum sit <a href="#" class="article-link">dolorem</a></p> Bad: <p> Lorem lipsum sit <a href="#" class="red-link">dolorem</a></p> 2.1.5 2.2 CSS Formatting CSS: 2.2.1 Use Single-Line formatting. This is the most space and size efficient way to write div.wrapper { margin:0 auto; padding:200px 0 0 0; width:960px; z-index:2 } ul.nav { position:absolute; top:0; left:430px; padding:120px 0 0 0 } ul.nav li { display:inline; margin:0 10px 0 0 } div.column { float:left; margin:0 70px 0 0; padding:0 0 0 70px; width:340p x } div.post-wrapper { bottom center norepeat; margin:0 0 40px 0; padding:0 0 40px 0 } div.wrapper img, div.wrapper a img, div.article_illustration_mini { backgr ound:#d3d4cb; padding:10px; border:1px solid #999 } div.wrapper a:hover img { background:#fff } 2.2.2 Use one blank line to separate logical groups of styling: table thead tr th.left-corner { /* CSS style */ }

6 Coding Standards for Web Development table thead tr th.right-corner { /* CSS style */ } table#addnewuser{ /* CSS style */ } table#addnewuser thead tr th h3{ /* CSS style */ } 2.2.3 Order your CSS properties. For example, if you are styling a <h1> tag, put first the font-related declarations then color-related declarations and finally the position-related declarations: h1 { /* Font */ font-size: 2em; font-weight: bold; /* Color */ color: #c00; background: #fff; /* Box model */ padding: 10px; margin-bottom: 1em; } Comments are optional, so is the formatting. 2.2.4 Order the CSS items in groups. This way you can easily read the contents and jump straight to a particular section. Prepending each heading with a dollar sign makes it unique, so that a search will yield only headings: /* $DEFAULTS ----------------------------------------------------------*/ body { background: #b6b7bc; font-size:.80em; fontfamily: "Helvetica Neue", "Lucida Grande", "Segoe UI", Arial, Helvetica, Verdana, sans-serif; margin: 0px; padding: 0px; color: #696969;} a:link, a:visited{ color: #034af3;} a:hover{ color: #1d60ff; text-decoration: none;} a:active{ color: #034af3;} p{ margin-bottom: 10px; line-height: 1.6em;} /* $HEADINGS ----------------------------------------------------------*/ h1, h2, h3, h4, h5, h6{ font-size: 1.5em; color: #666666; font-variant: smallcaps; text-transform: none; font-weight: 400; margin-bottom: 0px;} h1{ font-size: 1.6em; padding-bottom: 0px; margin-bottom: 0px;} h2{ font-size: 1.5em; font-weight: 600;} h3{ font-size: 1.2em;}

7 Coding Standards for Web Development h4{ font-size: 1.1em;} h5, h6{ font-size: 1em;}