Forums / Templates, Stylesheets, Page Layout / Rounding off the top corners of my layout boxes

Rounding off the top corners of my layout boxes

Started by mighty_midget on 13 Jan 2012, 6:35 PM · Views: 1,897

Results 1 to 20 of 23
13 Jan 2012, 6:35 PM
#1
mighty_midget avatar

mighty_midget

New Zenner

Join Date:
Sep 2011
Location:
UK
Posts:
72
Plugin Contributions:
0

Rounding off the top corners of my layout boxes

Hi,

I have been looking into this for a while now and im not sure where to start i was just wondering how to go about rounding off the top corners of my layout boxes etc... I have read a few threads but not sure what to do exactly.

13 Jan 2012, 6:48 PM
#2
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: Rounding off the top corners of my layout boxes

You will need to create a new image for use on your sideboxes. The image being used is called tile_back.gif. It is also being used for your EZ-Pages header. So, you will need to create an image of a different name and edit your stylesheet to reflect that name:

.leftBoxHeading, .centerBoxHeading, .rightBoxHeading {
margin: 0em;
background-color: #FFA3A2;
background-image: url (../images/tile_back.gif);
padding: 0.5em 0.2em;
background-repeat: repeat-x;
}

You would make the image 150px wide and upload it to your template images folder. You would also need to remove background-repeat: repeat-x;

To make rounded corners on images, I use this site:

http://www.roundpic.com

The best way to learn is to try stuff. But, back it up first.

13 Jan 2012, 6:51 PM
#3
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: Rounding off the top corners of my layout boxes

You can see rounded images I created at that site here:

http://www.oozix.com/store3

The best way to learn is to try stuff. But, back it up first.

13 Jan 2012, 7:00 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Rounding off the top corners of my layout boxes

Since this is purely a styling issue and not related to useability, you can make a simple addition to your stylesheet that will round the sidebox corners on all modern browsers (even IE9:). (Older browsers will just show square corners.)

.leftBoxHeading, .centerBoxHeading, .rightBoxHeading {
margin: 0em;
background-color: #FFA3A2;
background-image: url (../images/tile_back.gif);
padding: 0.5em 0.2em;
background-repeat: repeat-x;
border-radius: 7px 7px 0 0;
}

This will round the top left and top right corners with a 7px radius. Adjust to taste.

13 Jan 2012, 7:04 PM
#5
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: Rounding off the top corners of my layout boxes

gjh42:

Since this is purely a styling issue and not related to useability, you can make a simple addition to your stylesheet that will round the sidebox corners on all modern browsers. (Older browsers will just show square corners.)

.leftBoxHeading, .centerBoxHeading, .rightBoxHeading {
margin: 0em;
background-color: #FFA3A2;
background-image: url (../images/tile_back.gif);
padding: 0.5em 0.2em;
background-repeat: repeat-x;
border-radius: 7px 7px 0 0;
}

This will round the top left and top right corners with a 7px radius. Adjust to taste.

That won't work in IE8. Needs a little help from a small script. There are a couple different ones out there. I use PIE.htc. Would look like this:

behavior: url (PIE.htc);

PS: I learned something new, though. I didn't know border radius worked on images. Would have saved me a lot of time!

The best way to learn is to try stuff. But, back it up first.

13 Jan 2012, 7:17 PM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Rounding off the top corners of my layout boxes

It works on background images - not sure about foreground images. It might depend on whether the image is the element being rounded, or is contained inside a wrapper that is rounded. In the latter case it doesn't really work right.

I did say all "modern" browsers:) If IE8 or earlier support for this appearance feature is important, then you do need special treatment for IE.

13 Jan 2012, 7:23 PM
#7
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: Rounding off the top corners of my layout boxes

Yeah, I'm not sure if any version of IE can ever be considered "modern". :laugh:

The best way to learn is to try stuff. But, back it up first.

13 Jan 2012, 7:27 PM
#8
mighty_midget avatar

mighty_midget

New Zenner

Join Date:
Sep 2011
Location:
UK
Posts:
72
Plugin Contributions:
0

Re: Rounding off the top corners of my layout boxes

Hi,

have tried it and its close to being right. the 150px is not quite wide enough and i keep getting a repeat pattern in the main center boxes . Also my search box is a seperate image as it got edited so will have to do that seperately. Any more advice would be great. Have reset to its original for now though.

13 Jan 2012, 7:30 PM
#9
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Rounding off the top corners of my layout boxes

If you're going to use a rounded image, you need to make it the same width as your sideboxes display, and separate the stylesheet rules to have different backgrounds for sideboxes and centerboxes.

Did you try the border-radius declaration?

13 Jan 2012, 7:35 PM
#10
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: Rounding off the top corners of my layout boxes

Okay, I just tested it in IE8. It doesn't work. It does work when using PIE.htc, but it needs position relative added. Like this:

.leftBoxHeading, .centerBoxHeading, .rightBoxHeading {
margin: 0em;
background-color: #xxxxxx;
background-image: url(../images/tile_back.gif);
padding: 0.5em 0.2em;
border-radius: 7px 7px 0 0;
behavior: url (PIE.htc);
position: relative;
}

You also need to edit this and remove the top border:

.leftBoxContainer, .rightBoxContainer {
margin: 0em;
border: 1px solid #xxxxxx;
border-bottom: 5px solid #xxxxx;
margin-top: 1.5em;
}

The best way to learn is to try stuff. But, back it up first.

13 Jan 2012, 7:47 PM
#11
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: Rounding off the top corners of my layout boxes

Here's something interesting. It works fine in Chrome, (of course), but if I add the crutch for IE8 it doesn't work. The same coding works in all the browsers for rounding corners on a standard border.

The best way to learn is to try stuff. But, back it up first.

13 Jan 2012, 8:18 PM
#12
mighty_midget avatar

mighty_midget

New Zenner

Join Date:
Sep 2011
Location:
UK
Posts:
72
Plugin Contributions:
0

Re: Rounding off the top corners of my layout boxes

gjh42:

If you're going to use a rounded image, you need to make it the same width as your sideboxes display, and separate the stylesheet rules to have different backgrounds for sideboxes and centerboxes.

Did you try the border-radius declaration?

No have not tried it yet. Will definately look into it though.
Thanks

14 Jan 2012, 2:21 PM
#13
mighty_midget avatar

mighty_midget

New Zenner

Join Date:
Sep 2011
Location:
UK
Posts:
72
Plugin Contributions:
0

Re: Rounding off the top corners of my layout boxes

Hi,

i have tried border-radius declaration and it works to a point. I still have a sqaure border line aswell as the curved edge. Any suggestions?

14 Jan 2012, 2:33 PM
#14
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Rounding off the top corners of my layout boxes

See post 10. The square edge is the container; you need to move the border from
.leftBoxContainer, .rightBoxContainer {
to

.sideBoxContent {
border: 1px solid #xxxxxx;
border-top: none;
border-bottom: 5px solid #xxxxx;
}

14 Jan 2012, 2:43 PM
#15
mighty_midget avatar

mighty_midget

New Zenner

Join Date:
Sep 2011
Location:
UK
Posts:
72
Plugin Contributions:
0

Re: Rounding off the top corners of my layout boxes

Hi,

Ive just added the border-radius: 20px 20px 0 0; to the sidebox containers but cant find the center box container.

14 Jan 2012, 3:10 PM
#16
mighty_midget avatar

mighty_midget

New Zenner

Join Date:
Sep 2011
Location:
UK
Posts:
72
Plugin Contributions:
0

Re: Rounding off the top corners of my layout boxes

Hi,

Managed to sort it. Tested it in IE and it all works fine too. Happy days!:clap: Thanks for the help guys.

14 Jan 2012, 7:06 PM
#17
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: Rounding off the top corners of my layout boxes

Which version of IE are you using? It isn't working for me in IE8.

The best way to learn is to try stuff. But, back it up first.

14 Jan 2012, 9:01 PM
#18
mighty_midget avatar

mighty_midget

New Zenner

Join Date:
Sep 2011
Location:
UK
Posts:
72
Plugin Contributions:
0

Re: Rounding off the top corners of my layout boxes

oh, using version 9. how can i fix it?

14 Jan 2012, 9:10 PM
#19
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: Rounding off the top corners of my layout boxes

To work in IE8, border radius requires a little script addition. See post #10.

The best way to learn is to try stuff. But, back it up first.

15 Jan 2012, 3:41 PM
#20
mighty_midget avatar

mighty_midget

New Zenner

Join Date:
Sep 2011
Location:
UK
Posts:
72
Plugin Contributions:
0

Re: Rounding off the top corners of my layout boxes

Hi,

I have done what you said regarding the top border but dont know if it has worked as IE8 is not supported on my system. Could you check it for me please. Thanks.