Solved

Liquid CSS rounded corners CSS

Posted on 2010-09-23
8
670 Views
Last Modified: 2013-12-25
Hello.
I need to modify a css in order to get a liquid rounded corner (top only) effect using a longer (compared with the box dimension) png image with both sides rounded.
Unfortunatelly I have poor to no possibility to modify the HTML, so I need to do everything by css.
This is the css code I am actually using
 
.block 
{
    margin-bottom: 15px;
	padding-bottom: 5px;
	padding-left: 0;
	color: #FFFFFF;
	background: transparent url(images/BlockHeader.png) no-repeat bottom right;
}

.block .title
{
	font-size: 0.9em;
	font-weight: bold;
	text-transform: uppercase;
	padding: 7px 10px;
	color: #ff9933;
	background: transparent url(images/BlockHeader.png) no-repeat bottom right;
	
}

.block .listbox
{
	font-size: 11px;
	padding: 5px 10px 10px;
	line-height: 18px;
	
	background-color:#404040 ;
	margin: 0px;
}

.block .listbox ul
{
	margin: 0px 0px 0px 0px;
	padding: 0px 0px 0px 10px;
	color: #3664A5;
	background-color: inherit;
}

.block a
{
	color: #FFF;
	font-weight: bold;
	text-decoration: none;
}

.block li
{
    list-style: none;
}

.block li.separator
{
	height: 1px;
	line-height: 1px;
	background: #ff9933;
	width: 140px;
	font-size: 1px;
	margin: 5px 0 5px 0;
}



.block-category-navigation, .block-manufacturer-navigation, .block-recently-viewed-products, 
.block-info, .block-shoppingcart, .block-newsletter, .block-livechat, .block-popular-tags,
.block-popular-blogtags, .block-blog-archive
{
	
}

Open in new window

This is a box example:
 
<div class="block block-info">
    <div class="title">
    </div>
    <div class="clear">
    </div>
    <div class="listbox">

    </div>
</div>

Open in new window

As you can notice I would like to use the subclass (present in each box to sort out this problem.
Please help.
Thanks!
0
Comment
Question by:giuseppepi
8 Comments
 
LVL 7

Accepted Solution

by:
Gene_Cyp earned 500 total points
ID: 33743428
Most of the "rounding" tricks are actually done with a combination of CSS and the use of images.

A "curve" is essentially part of a circle.

Thus create an image of a circle (in whichever way you want it to look) and then use CSS to show only a section of that circle

Having said that, here are some tutorials that can help you:


http://www.search-this.com/2007/02/12/css-liquid-round-corners/

http://home.tiscali.nl/developerscorner/liquidcorners/liquidcorners.htm
0
 
LVL 3

Author Comment

by:giuseppepi
ID: 33743691
Hello Gene,
thanks for your answer.
I took a look to the sample but both are using multiple images. I have the necessity to show only the left side and only the right side of the same image.
Thanks for supporting
0
 
LVL 7

Expert Comment

by:Gene_Cyp
ID: 33743720
Create a circle in photoshop or paint or Paint.Net (free downloadable paint with advanced settings)

Then using css show the top left "section" of that circle for the top elft corner and the top right section of that circle for the top right corner.
0
The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

 
LVL 7

Expert Comment

by:Gene_Cyp
ID: 33743728
You can even "cut" that part u want to show within photoshop / paint itself and save it as an image.
0
 
LVL 3

Expert Comment

by:jchook
ID: 33749990
If you are able to use javascript I can recommend CurvyCorners: http://www.curvycorners.net/
0
 
LVL 9

Expert Comment

by:Bob Stone
ID: 33753297
Here are two alternate solutions

Pure CSS Rounded Box -
http://wizard-enterprises.com/CSSround.html

Single image auto resize -
http://www.schillmania.com/projects/dialog2/
0
 
LVL 4

Expert Comment

by:bastianr
ID: 33754216
I've used the sliding doors approach with a single, very wide (1600px) image which I think is similar to your goal here. You need to align the background image to opposite sides on the two elements and then set a right or left margin on one of the elements so that the rounded corner shows through from behind. Try something like this:
.block .title {
background: transparent url(images/BlockHeader.png) no-repeat bottom left;
margin: 0 6px 0 0;  /* adjust px value to show corner */
}
 
0
 
LVL 4

Expert Comment

by:acashok
ID: 33755897
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
"Go Fund Me" type plugin 5 25
Are these icons a web font? 3 21
How to control cache of some js files ? 7 44
Programming Language for Wordpress 7 43
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question