Click here to Skip to main content
Licence 
First Posted 18 Sep 2007
Views 30,947
Bookmarked 9 times

Round Corners Div

By | 10 Oct 2007 | Article
Round Corners Div

Download round_corner_div1.zip - 6.4 KB

Screenshot - round_corner_div1.gif

Introduction

This javascript will help you to create div with round corner without using image and .css file. Few lines of javascript codes will create rounded corner for a div on the fly. Just pass the parameters (div id and which corner i.e. LT=LeftTop or RT=RightTop or LB=LeftBottom or RB=RightBottom you want to round) to the javascript function and you will have it. The attached sample file round_corners_div.aspx will show few examples. This javascript was only tested on Microsoft Internet Explorer version 6.0 in VWD 2005 Express Edition environment. This is a free javascript distributed in the hope that it will be useful but without any warranty.

Background

Ok, backgoround for this code is to make your div tag look more fancy with rounded corner. I have been searching web for javascript which can round a div tag corners without using images but could not find something straight forward, short and simple hence I decided to write my own.

Using the code

Copy and past the javascript functions in web page then call it from body tag as shown in the example file round_corners_div.aspx.

The javascript functions are quite simple and flexible. Flexible in the sence that it gives you option to select which corner of a div tag you want to round.

Download and unzip the attached file. The main file which contains javascript and html codes is named 'round_corners_div.aspx'. The other file round_corners_div.gif is screenshot of the output.

Points of Interest

It is quite cool. You do not need to use images or .css file to round the corners of any div element. The few lines of codes will round the corners of a div on the fly.

It only works on IE6.0.

History

Created by: Muhammad Shoaib

Created on: 7 Sept 2007

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Muhammad Shoaib Patel



Malaysia Malaysia

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralAnother option Pinmemberlmcnutt20:00 16 Jun '09  
GeneralAwsome PinmemberMuhammad Azam20:47 1 Jun '09  
GeneralNifty Corners Cube Pinmemberbitbusta4:39 11 Oct '07  
GeneralBrowser Compatibility PinmemberTereska21:28 18 Sep '07  
AnswerRe: Browser Compatibility PinmemberMuhammad Shoaib Patel19:45 8 Nov '07  
QuestionHeya PinmemberBen Daniel20:33 18 Sep '07  
AnswerRe: Heya PinmemberMuhammad Shoaib Patel20:59 18 Sep '07  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web03 | 2.5.120517.1 | Last Updated 10 Oct 2007
Article Copyright 2007 by Muhammad Shoaib Patel
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid