PhotoshopForums.com Home
Navigate Contact FAQ Search Members
How to create rectangles with rounded edges... and more...
Post new topic   Reply to topic    PhotoshopForums.com Forum Index -> General Photoshop and Design Discussion
 See a User Guidelines violation? Please contact us.
Author Message

nme

Joined: 04 Oct 2004
Posts: 2



PostPosted: Mon Oct 04, 2004 6:34 pm    Post subject: How to create rectangles with rounded edges... and more... Reply with quote

ok, so take a look at this link.

http://www.national-lottery.co.uk/

see the image to the right with title "rollover email alerts"

I've been trying unsuccesfully to create a similiar rectangular shape - similiar to the above with rounded edges on opposite corners, and I just cannot get this to work right. I've looked at the source, and I figure that they are doing this by drawing a rectangle with circular edges and using tables, where you set the corners of the tables to use the circular corner images, as backgrounds - thats fine. Now, how do you get the straight sides to work? I need the tables to grow or shrink relative to the content in the table. If I use a static image, i get the following behaviour

http://mediamagic.webhostme.com/index.html

so looking further at the table images, i see that for the straight edges, they use a table cell that is 1 pixel wide, with a background color the same as the color of the table corners. Great - this should work, but i'm getting all sorts of distortion with my tables, and can't really afford to spend hours on each seperate table. Can anyone suggest the following :

1. a tutorial to outline step by step the best way to achieve this.
2. whether there exist any applications that will do this for you.
3. how best to create outlines of rectangular shapes with round edges.
View user's profile Send private message

BryanDowning

Joined: 05 Jul 2004
Posts: 1554
Location: California, USA


PostPosted: Mon Oct 04, 2004 9:45 pm    Post subject: Reply with quote

It's actually pretty simple.

HERE'S THE CODE:

Code:

<table cellpadding="0" cellspacing="0" border="0" width="500" height="300">
<tr>
<td height="20" width="20"><img src="topleft.gif" height="20" width="20"></td>
<td><img src="top.gif" height="20" width="100%"></td>
<td height="20" width="20"><img src="topright.gif" height="20" width="20"></td>
</tr>

<tr>
<td><img src="left.gif" height="100%" width="20"></td>
<td>HELLO!!!</td>
<td><img src="right.gif" height="100%" width="20"></td>
</tr>

<tr>
<td height="20" width="20"><img src="bottomleft.gif" height="20" width="20"></td>
<td><img src="bottom.gif" height="20" width="100%"></td>
<td height="20" width="20"><img src="bottomright.gif" height="20" width="20"></td>
</tr>
</table>


KEY POINTS:

- Make sure you have border, cellpadding and cellspacing set to zero.

- Make sure the corner images are in their own table datas with specified widths and heights.

- Make sure the top and bottom images have a width of 100%, and the left and right have a height of 100%.

- Use width and height in the table tag to define to size of your rectangle.

- Put all your content in the middle table data of the middle row. (Use valign="top" in the <td > if you want it to be aligned top.

CLICK HERE TO SEE IT ON THE WEB

_________________
Best Regards,
Bryan Downing
bryandowning.com
View user's profile Send private message Send e-mail Visit poster's website AIM Address

BryanDowning

Joined: 05 Jul 2004
Posts: 1554
Location: California, USA


PostPosted: Mon Oct 04, 2004 9:52 pm    Post subject: Reply with quote

You may also be able to do it in CSS.

You can do it using background colors for a cell as well if you want to cut back on load time.

_________________
Best Regards,
Bryan Downing
bryandowning.com
View user's profile Send private message Send e-mail Visit poster's website AIM Address

nme

Joined: 04 Oct 2004
Posts: 2



PostPosted: Tue Oct 05, 2004 7:37 am    Post subject: Reply with quote

Hi Oybro,

thanks for the rapid response. This seems like what i want to do, except i'd prefer to do it with CSS, to improve load times. Additionally, your example in the link above, when using purely images, distorts just like mine have in the past - take a look.

I'd be interested in hearing more about how you'd achieve the above with CSS - that would surely avoid the distortion we're seeing with full images.

how does the 1x1 transparent placeholder image work?

suggestions?

thanks

nme
View user's profile Send private message

BryanDowning

Joined: 05 Jul 2004
Posts: 1554
Location: California, USA


PostPosted: Tue Oct 05, 2004 5:41 pm    Post subject: Reply with quote

Agh... I didn't test it in IE. It works now. Here's the updated code:

Code:
<table cellpadding="0" cellspacing="0" border="0" width="500" height="300">
<tr>
<td height="20" width="20"><img src="topleft.gif" height="20" width="20"></td>
<td><img src="top.gif" height="20" width="100%"></td>
<td height="20" width="20"><img src="topright.gif" height="20" width="20"></td>
</tr>

<tr>
<td height="100%"><img src="left.gif" height="100%" width="20"></td>
<td>HELLO!!!</td>
<td height="100%"><img src="right.gif" height="100%" width="20"></td>
</tr>

<tr>
<td height="20" width="20"><img src="bottomleft.gif" height="20" width="20"></td>
<td><img src="bottom.gif" height="20" width="100%"></td>
<td height="20" width="20"><img src="bottomright.gif" height="20" width="20"></td>
</tr>
</table>



I don't know off hand how to do it in CSS. I'd have to research it. I can look around if you'd like.

A 1x1 transparent image place holder is easy. You take a 1x1 pixel image in photoshop and make sure its trasparent. Save it as a gif. Then you can make it whatever size you want with the html code. Like this:
Code:
<img src="tgt.gif" height="300" width="100">

_________________
Best Regards,
Bryan Downing
bryandowning.com
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    PhotoshopForums.com Forum Index -> General Photoshop and Design Discussion All times are GMT - 6 Hours
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Contact - User Guidelines >

Copyright © 2003-2016. PhotoshopForums.com, iFroggy Network. All Rights Reserved.
Powered by phpBB © phpBB Group. phpBB SEO. Privacy Policy.
We are in no way affiliated with Adobe. Photoshop, Adobe and related marks are registered trademarks of Adobe.
PhotoshopForums.com