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.

CSS3 Rounded Corner for Div

Featured Replies

Hi Guys

 

I can't figure out why my code for rounded corners around a div is not working !!

 

Here is the CSS code:

 

#bottomBox {

border-width: 1px;
-moz-border-radius: 15px;
border-radius: 15px;
border-color: #b0b0b0;

}

 

And here is the HTML code:

 

<div id="bottomBox">

				<h2>Lorem ipsum</h2>

				<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>

			</div><!-- End of Bottom Box -->

 

I would greatly appreciate any help. I'm checking it in Chrome by the way.

 

Thank you.

I'm checking it in Chrome by the way

 

 

That's your problem. Your code is specific for Mozilla browsers only i.e. Firefox. To use this properly you should do the following:

 

-moz-border-radius: 15px;
-webkit-border-radius: 15px;
border-radius: 15px;

 

Chrome is a webkit browser, so the '-webkit' part will make it work in Chrome. The last line of code future-proofs it so when CSS3 is officially released this will override any vendor properties.

  • Author

Hi MrChristoph

 

Thanks for that. However it still did not work. Still I get no border, not even straight ones, never mind rounded ones :(

 

EDIT: Are there things that I need to write at the start of a CSS3 file, to tell the browser that it is in fact a CSS3 ?

#bottomBox {
       border: 1px solid #b0b0b0;
       -moz-border-radius: 15px;
       -webkit-border-radius: 15px;
       border-radius: 15px;
}

 

If this code doesn't work are you sure your CSS is linked properly?

  • Author

Yeah the CSS file is linked properly since all the other css code is working fine !!

 

EDIT: I have just uploaded the files to my server, so that I can make the " helping " process easier for us all.

 

The Website

 

I am confused.

Do you have a link? What CSS code shows in Firebug when you select the div? The above code really should work unless I've gone mental.

 

nope, your not going mental, it works

  • Author

Oops Read my Previous Post please ! I gave a link to the site on there :blush1:

  • Author

Thank You So Much It worked.

 

I had forgotten the { Solid } bit to the border. That is why I was not getting anything.

 

Thanks for the help guys, really appreciate it. :give_rose:

will be nice when it does get standardised and we don't have to use three properties for the cool stuff :)

 

when is it due, does anyone know?

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.