473,394 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Rounded corners & IE

I want to achieve the following:
A small image in each of the corners of a box, like below:

+-------------------------------+
|[img] [img]+
| +
| +
| +
| +
| +
|[img] [img]+
+-------------------------------+

The images are rounded corners. The box grows/shrinks dynamically with
browser resizing (hor and vert), so a fixed image is not an option.

I have a nice working solution for Gecko-based browsers (or any other
that supports the :before and :after pseudo-classes) based on an extra
div inside another div and the :before and :after tricks (as used by
blogger.com, at least in the past, not sure if they still rely on it).

(Of course) MS IE6 and previous don't support these pseudo-classes.
Luckily IE ignores them completely, so viewers are stuck with sharp
corners instead. Not ideal but doable. Not sure if IE7 supports this
construct, I haven't got Windows, nor a working IE7 with wine.

An alternative is creating a div soup with top and bottom parts
separated to accomodate the images. Does anyone know of a more elegant
solution to the rounded corners box that DOES work for IE as well?

The page should degrade without problems to viewing without any style
applied. (ie. no weird separate corner images show up)

Thanks in advance for any good tip!
Sh.

Nov 28 '06 #1
6 5477
Hi

I tend to stick four divs in the box to have rounded corners, and style them
to be in the corners with appropriate background images. I don't think pure
css is an option unfortunatley.

Of course, rather than putting this in the html, you could add these to the
document when it is loaded using some java-script instead. Of course, this
wouldn't be that elegant either - in fact, it's workings might be a bit
obvious in slowing the rendering down.

M

"Schraalhans Keukenmeester" <bi*******@invalid.spamwrote in message
news:45*********************@news.xs4all.nl...
>I want to achieve the following:
A small image in each of the corners of a box, like below:

+-------------------------------+
|[img] [img]+
| +
| +
| +
| +
| +
|[img] [img]+
+-------------------------------+

The images are rounded corners. The box grows/shrinks dynamically with
browser resizing (hor and vert), so a fixed image is not an option.

I have a nice working solution for Gecko-based browsers (or any other that
supports the :before and :after pseudo-classes) based on an extra div
inside another div and the :before and :after tricks (as used by
blogger.com, at least in the past, not sure if they still rely on it).

(Of course) MS IE6 and previous don't support these pseudo-classes.
Luckily IE ignores them completely, so viewers are stuck with sharp
corners instead. Not ideal but doable. Not sure if IE7 supports this
construct, I haven't got Windows, nor a working IE7 with wine.

An alternative is creating a div soup with top and bottom parts separated
to accomodate the images. Does anyone know of a more elegant solution to
the rounded corners box that DOES work for IE as well?

The page should degrade without problems to viewing without any style
applied. (ie. no weird separate corner images show up)

Thanks in advance for any good tip!
Sh.

Nov 28 '06 #2
On Tue, 28 Nov 2006 14:55:06 +0100, Schraalhans Keukenmeester
<bi*******@invalid.spamwrote:
>I want to achieve the following:
A small image in each of the corners of a box, like below:
A very elegent solution which I currently use:
http://www.airtightov.com/lab/airtight_corners.html
Nov 28 '06 #3
Martin Eyles wrote:
"Schraalhans Keukenmeester" <bi*******@invalid.spamwrote in message
news:45*********************@news.xs4all.nl...
>I want to achieve the following:
A small image in each of the corners of a box, like below:

+-------------------------------+
|[img] [img]+
| +
| +
| +
| +
| +
|[img] [img]+
+-------------------------------+

The images are rounded corners. The box grows/shrinks dynamically with
browser resizing (hor and vert), so a fixed image is not an option.

I have a nice working solution for Gecko-based browsers (or any other that
supports the :before and :after pseudo-classes) based on an extra div
inside another div and the :before and :after tricks (as used by
blogger.com, at least in the past, not sure if they still rely on it).

(Of course) MS IE6 and previous don't support these pseudo-classes.
Luckily IE ignores them completely, so viewers are stuck with sharp
corners instead. Not ideal but doable. Not sure if IE7 supports this
construct, I haven't got Windows, nor a working IE7 with wine.

An alternative is creating a div soup with top and bottom parts separated
to accomodate the images. Does anyone know of a more elegant solution to
the rounded corners box that DOES work for IE as well?

The page should degrade without problems to viewing without any style
applied. (ie. no weird separate corner images show up)

Thanks in advance for any good tip!
Sh.
Hi

I tend to stick four divs in the box to have rounded corners, and style them
to be in the corners with appropriate background images. I don't think pure
css is an option unfortunatley.

Of course, rather than putting this in the html, you could add these to the
document when it is loaded using some java-script instead. Of course, this
wouldn't be that elegant either - in fact, it's workings might be a bit
obvious in slowing the rendering down.

M
I've considered some of the JavaScript-based solutions around and
dismissed those, on grounds of performance, the fact not everyone likes
to have Javascript switched on and design principles.

While working on the solution I mentioned I discovered there is a
possible issue with Mozilla FF 1.5 which appears to have some rounding
errors in some -rather unpredictable- situations leaving ugly 1px lines
below the bottom corners. Not sure this is the case on all OSes and with
the latest FF versions. Maybe someone knows, my Linux+FF shows no such
artifacts AFAIK. Besides, Konqueror does not only not recognize the
pesudo-tags, it renders the page with ugly 'error' imgs instead. Since
Safari used to be based on the same engine as Konqueror I suspect some
people using Macs won't be too happy either.

So my initial solution is out of the question.

Besides the promising (airtightcorners) solution offered by Brendan
Gillat in this same thread I found a candidate in "Sliding Doors" at 'a
list apart', see it at http://www.alistapart.com/articles/slidingdoors/

Since this topic is still very much alive I will probably end up
combining all my experiences on a new web page on my site, as I won't be
the only one looking for Columbus' egg.

Thanks for your suggestion Martin!
Kind Regards
Sh.
Nov 28 '06 #4
Brendan Gillatt wrote:
On Tue, 28 Nov 2006 14:55:06 +0100, Schraalhans Keukenmeester
<bi*******@invalid.spamwrote:
>I want to achieve the following:
A small image in each of the corners of a box, like below:

A very elegent solution which I currently use:
http://www.airtightov.com/lab/airtight_corners.html
This looks very elegant indeed. Kudos!
Please see my reply to Martin Eyles' suggestion for (a link to) an
alternative I found on the 'A list apart' site.

Thanks very much for this slick solution Brendan.
Kind regards,
Sh.
Nov 28 '06 #5
"Schraalhans Keukenmeester" <bi*******@invalid.spamwrote in message
news:45*********************@news.xs4all.nl...
Besides the promising (airtightcorners) solution offered by Brendan Gillat
in this same thread I found a candidate in "Sliding Doors" at 'a list
apart', see it at http://www.alistapart.com/articles/slidingdoors/

Since this topic is still very much alive I will probably end up combining
all my experiences on a new web page on my site, as I won't be the only
one looking for Columbus' egg.
Thanks for the link Sh. I take the odd peak at alistapart, but managed to
miss this little gem. I think I may actually have some uses for that on some
future projects, so I keep it in mind for them.

Martin
Nov 29 '06 #6
Martin Eyles wrote:
"Schraalhans Keukenmeester" <bi*******@invalid.spamwrote in message
news:45*********************@news.xs4all.nl...
>Besides the promising (airtightcorners) solution offered by Brendan Gillat
in this same thread I found a candidate in "Sliding Doors" at 'a list
apart', see it at http://www.alistapart.com/articles/slidingdoors/

Since this topic is still very much alive I will probably end up combining
all my experiences on a new web page on my site, as I won't be the only
one looking for Columbus' egg.

Thanks for the link Sh. I take the odd peak at alistapart, but managed to
miss this little gem. I think I may actually have some uses for that on some
future projects, so I keep it in mind for them.

Martin

Same here, I often seem to miss key items on the more interesting sites...
Not sure who mentioned this one and where, but did you see 'Nifty
Corners' as well? http://www.html.it/articoli/nifty/
I am using the classic version without Javascript and such for my
current project.Without ANY images. Slight disadvantage: the corners get
edgy when zooming in in the browser, apart from FF which keeps the
round look intact. Konqueror, Opera, IE7 all accept this one. Even with
text-indent and justification.

Airtightcorners works in FF, Opera, IE6, but -sigh- now IE7 is a problem
with rounded boxes of single line height. (lower half of the text
disappears, I am getting sooooo frustrated with yet another MS quirk)

Amaya, supposedly THE standards browser, has problems with nearly ALL
the available techniques. But, then again, who uses Amaya on a day to
day basis...

Rgds
Sh.
Nov 30 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Mel | last post by:
how can i have a rounded edge button in my forms using CSS ? thanks Mel
2
by: meltedown | last post by:
I noticed that the footer menu on the bottom with rounded corners only uses one image of a rounded corner:img/round15_bot.gif This one image seems to be used for all four corners, but that can't...
1
by: jimfortune | last post by:
The following Access VBA function creates a string that can be used in a pdf stream to draw or fill a rectangle of a given color with rounded corners: 'Begin code----------- Public Function...
2
by: Konrad | last post by:
Hi This is maybe simple question but how to render DataGrid and Tables with rounded corners? Thanks Konrad
8
by: TheCornjerker | last post by:
I've been looking into what method I should use to show rounded corners (and I've found a lot). My question is why does Google seems to mostly use the table method with an image in each corner. ...
5
by: Cindy Lee | last post by:
Is there anyway to put rounded corners on the grid views? When I bring it up in the brower I need to have rounded corners. There are some tricks I can do to regular html tables, but is there any...
1
by: kidelectric | last post by:
The issue I am having is that I would like to be able to drag-and-drop div elements that have rounded corners.* Since these elements will be dynamically created (including background color), I could...
4
by: PWS | last post by:
I am despertely trying get a DIV to look like a box with rounded corners. I can find load of examples this where the first line of text has the top graphic and the last line of text has the...
6
by: moondaddy | last post by:
I need to be able to make polygons with rounded corners. This will be to draw group outlines around shapes in a diagramming tool in wpf. all angles in the polygon will be 90 degrees, but somehow...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.