Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to code certain css shapes?

Tags:

html

css

I am trying to make the shape below in CSS. Any ideas how to do this? Or know a tutorial site that can help? I am talking about the tag like shapes that are yellow.

enter image description here

Also secondly does anyone know how to make a shape with css that is a square/rectangle that has two rounded edges at the bottom but right angled corners at the top?

Thanks!

James

like image 836
James Avatar asked Nov 04 '11 13:11

James


People also ask

How do I draw a polygon shape in CSS?

CSS | polygon() Function The polygon() function is an inbuilt function in CSS which is used with the filter property to create a polygon of images or text. Syntax: polygon( percentage | length); Parameter: This function accepts two parameter percentage or length which is used to hold the value of polygon size.


2 Answers

To answer your second question first, you use border-radius

div{
    border:1px solid black;
    border-radius:0 0 4px 4px;
    -moz-border-radius:0 0 4px 4px;
    -webkit-border-radius:0 0 4px 4px;
    height:100px;
    width:100px;
    margin:2em;
}

The -moz and -webkit are specific vendor prefixes.

You can change the numbers as you wish, but they follow this pattern

1st # = top left corner
2nd # = top right corner
3rd # = bottom right corner
4th # = bottom left corner

Example: http://jsfiddle.net/9VbFn/

As for the first question, here is a tutorial to help you

http://debiprasad.net/coding-and-logic/create-a-price-tag-using-css

like image 163
Jason Gennaro Avatar answered Sep 20 '22 20:09

Jason Gennaro


Yes; you can do this with pure CSS & with gradient also.

Check this http://jsfiddle.net/9EEEP/3/

with border & circle http://jsfiddle.net/9EEEP/2/

you can adjust the css as per your requirement like this http://jsfiddle.net/9EEEP/5/

like image 38
sandeep Avatar answered Sep 20 '22 20:09

sandeep