www.webdeveloper.com
Results 1 to 5 of 5

Thread: css3 gradient and border-radius

  1. #1
    Join Date
    Jan 2012
    Location
    Colombo
    Posts
    2

    Post css3 gradient and border-radius

    hi all,

    this is my first post so sorry in advance for any mistakes.

    the problem I'm facing is that i try to use both a gradient background and rounded corners on a div and it all works fine in chrome, firefox and opera but in ie the minute i use the gradient it flows out of the rounded corners.

    below is the code snippet for the css

    Code:
    .divcss3{
       border-radius:10px; /* rounded corners */
       height:70px;
       border:1px solid #000;
       background: #9a4a0d; /* Old browsers */
       background: -moz-linear-gradient(top,  #9a4a0d 0%, #611e03 100%); /* FF3.6+ */
       background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#9a4a0d), color-stop(100%,#611e03)); /* Chrome,Safari4+ */
       background: -webkit-linear-gradient(top,  #9a4a0d 0%,#611e03 100%); /* Chrome10+,Safari5.1+ */
       background: -o-linear-gradient(top,  #9a4a0d 0%,#611e03 100%); /* Opera 11.10+ */
       background: -ms-linear-gradient(top,  #9a4a0d 0%,#611e03 100%); /* IE10+ */
       background: linear-gradient(top,  #9a4a0d 0%,#611e03 100%); /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#9a4a0d', endColorstr='#611e03',GradientType=0 ); /* IE6-9 */
    }
    would appreciate any help regarding this.

  2. #2
    Join Date
    Dec 2011
    Posts
    55
    I can't really say why it's doing that since I've never tried actually coding a gradient. I've always just gone into Photoshop (or a similar image editing program) and created a blank document and filled it with the gradient I wanted, then set that image as the Div's background image. Just seems much cleaner to me.

  3. #3
    Join Date
    Jan 2012
    Location
    Colombo
    Posts
    2
    yeah i know but i'm actually trying to do it in css only. failing which i guess i'll have to go back to an image.

  4. #4
    Join Date
    Aug 2006
    Posts
    1,897
    I've resorted to not doing gradients in IE with the curved corners. As far as I can tell, this is a bug in the CSS3 implementation. Hopefully by the time the standard is solid and they come out with a conforming IE release, it'll be fixed.

    JW: Take a look at the CSS gradients, they make life very much easier (IMO) than doing the same with various little images made in PS. When it works, that is

    Dave

  5. #5
    Join Date
    Dec 2011
    Posts
    55
    I can understand that. I'm not all that proficient in PS myself honestly. But when it comes to that CSS working properly it's a big if, especially when dealing with IE

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles