html - CSS responsive layout with diagonal shapes -
i'm developing site one-page scrollable site each section diagonal shape. there way make more responsive where, regardless of screen size is, when sees home page can see little peach triangle on lower right corner word "our work" in it? also, if there better way set page, welcome suggestions.
the css , html can viewed in "view source"
<div id="logo" data-type="background" data-speed="10"> <h1><img src="<?php bloginfo('template_url'); ?>/images/logo.png"/></h1> <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2> <h4>inspiring people take leap , make ideas happen</h4> <div id="arrow"></div> </div> <section id="portfolio" data-type="background" data-speed="10"> <h3 id="work">our work</h3> </secion> <section id="contact"> <h3 id="touch">get in touch</h3> <?php echo do_shortcode( '[contact-form-7 id="9" title="contact form 1"]' ); ?> </section> <div id="shapes"> <div id="design-shape"></div> <div id="contact-shape"></div> </div>
css
#logo { height: auto; width: 1000px; text-align: center; margin: 100px auto; z-index: 15; margin-top: 100px; } #logo img { text-align: center; } #shapes { overflow-x:hidden; } #design-shape { background: none repeat scroll 0 0 #e98e82; position: absolute; transform:rotate(-45deg); -ms-transform:rotate(-45deg); -webkit-transform:rotate(-45deg); height: 1040px; top: 1200px; left:50%; width: 5000px; margin-left: -2500px; z-index: 6; } #contact-shape { background: none repeat scroll 0 0 #333333; position: absolute; transform:rotate(-45deg); -ms-transform:rotate(-45deg); -webkit-transform:rotate(-45deg); height: 1460px; top: 2757px; left:50%; width: 5000px; margin-left: -2500px; z-index: 1; } #portfolio { position: relative; left: 50%; margin-left: -210px; margin-top: -60px; width: 800px; z-index: 8; overflow: auto; } #contact { position: relative; left: 50%; z-index: 9; width: 800px; margin-left: 276px; margin-top: 580px; }
it's difficult make definition responsive suits expectations.
in case, it's easy adapt dimensions changes, not ratio changes.
anyway, 1 approach following, using vh units positioning (with technique, won't able support ie8, , safari buggy)
html
<div class="test">our work</div> <div class="diagonal"></div>
css
.test { position: absolute; top: 90vh; width: 98%; text-align: right; padding: 0px; z-index: 2; } .diagonal { background-color: yellow; position: absolute; top: 90vh; width: 98%; height: 200px; z-index: -1; -webkit-transform: skewy(-45deg); -webkit-transform-origin: 80% 0px; transform: skewy(-45deg); transform-origin: 80% 0px; }
Comments
Post a Comment