Home
Contact

Optimize the SharePoint Code

Delicious Bookmark this on Delicious

Remove Hard Coded Vertical Align Styles

In default.master, and all .aspx pages, remove the following hard coded vertical alignment HTML tags:





valign="top"

and





valign=top
Note: Some of the valign references in the out-of-the-box SharePoint have quotations, and some do not. Therefore, you need to search and replace for both in the code.

In the CORE.css, or your custom CSS file, add the following reference which will align all text and elements to the top of all table row cells.





TABLE, TR, TD {
   vertical-align: top;
}

Remove Hard Coded Border Styles

In Default.master, and all .ASPX pages, remove the following hard coded style attributes from the all table table, table row tr, and table data td tags.





border="0"
and





border=0
Note: Some of the border references in the out-of-the-box SharePoint have quotations, and some do not. Therefore, you need to search and replace for both in the code.

In the CORE.css or your alternative CSS file, add the following reference which will set





TABLE, TR, TD {
   border: 0px;
   padding: 0px;
   border-collapse: collapse;
}

Close soft breaks

In default.master, and all .aspx pages, close all soft breaks. This can easily be done executing a Find and Replace and adding a space and closing slash to the br tag.





<br>

A properly closed soft break br tag should look like the following.





<br />

Close Images

In default.master, and all .aspx pages, close the image img tags. This can be done by adding a space and a closing slash to all image tags. Additionally, best practices suggest all images should have an alternative description alt tag. The description should be short and descriptive of that image.





<img src="..." alt="Image Description">

A properly closed image img tag should look like the following.





<img src="..." alt="Image Description" />
Go Search
Photo Photo Photo Photo Photo Photo Photo Photo

<< Previous Play > Stop Next >>