logo
Copyright 2019 TwentyEleven Web Design
Quick Tip: Practical CSS Shapes | TwentyEleven Web Design
400
post-template-default,single,single-post,postid-400,single-format-standard,bridge-core-1.0.7,ajax_fade,page_not_loaded,,qode_grid_1300,side_area_uncovered_from_content,footer_responsive_adv,qode-content-sidebar-responsive,qode-theme-ver-18.2.1,qode-theme-bridge,wpb-js-composer js-comp-ver-6.0.5,vc_responsive
 

Quick Tip: Practical CSS Shapes

Another really useful tutorial by Jeffery Way over at NETtuts:

A common design technique lately is to create a fold effect, where it appears as if a heading is wrapping behind its container. This is generally achieved through the use of tiny images; however, with CSS, we can mimic this effect quite easily. I’ll show you how in four minutes.

Useful CSS

Final HTML

<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”utf-8″>
<title>CSS Shapes</title>
<!–[if IE]>
<style>
.arrow { top: 100%; }
</style>
<![endif]–>
</head>
<body>
<div id=”container”>
<h1> My Heading <span class=”arrow”></span> </h1>
</div>
</body>
</html>

Final CSS

#container {
background: #666;
margin: auto;
width: 500px;
height: 700px;
padding-top: 30px;
font-family: helvetica, arial, sans-serif;
}
h1 {
background: #e3e3e3;
background: -moz-linear-gradient(top, #e3e3e3, #c8c8c8);
background: -webkit-gradient(linear, left top, left bottombottom, from(#e3e3e3), to(#c8c8c8));
padding: 10px 20px;
margin-left: -20px;
margin-top: 0;
position: relative;
width: 70%;
-moz-box-shadow: 1px 1px 3px #292929;
-webkit-box-shadow: 1px 1px 3px #292929;
box-shadow: 1px 1px 3px #292929;
color: #454545;
text-shadow: 0 1px 0 white;
}
.arrow {
width: 0; height: 0;
line-height: 0;
border-left: 20px solid transparent;
border-top: 10px solid #c8c8c8;
top: 104%;
left: 0;
position: absolute;
}

Tags:
, ,
No Comments

Post A Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.