Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Rounding corners with CSS

Featured Replies

I have problems creating round corners with CSS

 

The right top, right bottom and left bottom corners show up on the most outer part of the website. See attachment

 

Here is the html code

<div id="contact">
<span class="trr"></span><!--top_right-->
<h2>Contact Us</h2>
<p>Call us <strong>Toll Free at  -  -8888</strong> or <strong>Toronto Local 555-555-5555</strong>, send us an <a href="../html/contact_form.html">email</a> or go to our <a href="../html/contact_us.html">Contact Us</a> page for more details.
</p>
<span class="bll"></span><!--bottom_left-->
<span class="brr"></span><!--bottom_right-->
</div>

 

CSS code


   #contact {
background-color: #DDDDDD;
width: 165px;
padding-left: 21px;
padding-right: 10px;
padding-top: 1px;
float: right;
margin-top: 10px;
background-image: url(../images/tl.gif);
background-repeat: no-repeat;
   }

.trr, .bll, .brr {
width : 20px;
height : 20px;
display : block;
margin-bottom : -1px;
position: absolute;	
}

/* change position and image: top-right */
.trr {
background : url(../images/tr.gif) no-repeat;
top : 0;
right : 0;
}

/* change position and image: bottom-left */
.bll {
  background : url(../images/bl.gif) no-repeat;
  bottom : 0;
  left : 0;
}

/* change position and image: bottom-right */
.brr {
  background : url(../images/br.gif) no-repeat;
  right : 0;
  bottom : 0;
}

 

Any ideas why?

post-12110-125174144149_thumb.gif

I'd use CSS3 border-radius property to do that instead of wrappings divs/spans. It degrades nicely to plain square for older browsers and keeps your code clean and tidy.

Hi,

 

Look at this example, I think it can help you in a certain way: Link

 

CSS3 is going to help us in a few years! :D

 

Regards

I use css3 too, alot easier.

 

but for the image way, you need to make the containing div relative.

 

so add

 

position:relative;

 

to

 

#contact {}

  • Author

Thank you for the help guys. I'm new to CSS.... I did look in to CSS3 border-radius property but it does not work with EI

 

I'll stay with the images for now

If you're going to rely on images, which is OK, you should replace them with a sprite. Easily done: fewer server requests.

Sprites/Matrix's are pretty simple (sprites tend to be single column/row and matrix's tend to combine the too, sprites are easier to maintain).

 

This outlines the idea, whilst the example differs, it still applies.

 

http://www.cardeo.ca/2008/how-to-create-a-single-image-css-navigation-matrix

 

http://superfluousbanter.org/archives/2004/05/navigation-matrix/

 

So rather than the browser sending out 4 requests (one for each corner image) it can send out one request (for all four corners).

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.