How to create a slanting border with css
Tags: html,css,html5,css3,transform
Problem :
I want to cut my border as the image below displays:
They areas that are cut away should be transparent if possible.
This is my code at the moment:
.main {
height: 50px;
background-color: #d6d6d6;
}
footer {
height: 93px;
background-color: #ff6138;
position: relative;
}
.footer-info {
position: absolute;
bottom: 27px;
left: 33px;
}
footer span {
color: #ffff9d;
text-transform: uppercase;
font-weight: 300;
letter-spacing: 0.05em;
font-size: 1.1875em;
}
footer .tel {
color: #fff;
font-weight: 400;
font-size: 1em;
margin-left: 24px;
}
body {
background-color: #ff9200;
}
Link to code http://jsfiddle.net/NpX23/
Solution :
Using :before/:after and rotate
.
Add position:relative to .main
and footer
.
.main:after, footer:before {
content: " ";
width: 100%;
height: 40px;
background: inherit;
position: absolute;
-webkit-transform: rotate(-1deg);
-moz-transform: rotate(-1deg);
-o-transform: rotate(-1deg);
-ms-transform: rotate(-1deg);
transform: rotate(-1deg);
z-index: -1;
}
.main:after {
bottom: -20px;
}
footer:before {
top: -20px;
}
Working: http://jsfiddle.net/NpX23/8/
CSS Howto..
Don't do it. There's no point to doing this since: Scrollbars are browser UI elements and you shouldn't screw with their styles as that might confuse users Only IE and...
You need some Javascript for that. For instance: document.body.addEventListener( 'mouseover', function( event ) { if( event.target.classList.contains( 'hov' ) ) { [].forEach.call(document.getElementsByClassName( 'hov' ), function( elem ) { elem.classList.add( 'hover' );...
Demo use display: inline-block; css .menu a { display: inline-block; } ...
First, know your audience; this lets you know what browsers your site will be accommodating. Second, make sure you have a good grasp of CSS. Third, get familiar with the...
You can easily do this with a little bit of javascript (jQuery to be specific) JS: $(function(){ $('.tabs label').click(function(){ $('.images img').hide(); $('#tab'+($(this).parent('li').index()+1)+'-img').show(); }); }); FIDDLE: http://jsfiddle.net/EZ33Y/1/ (i replaced the images...
I think you want li:hover { background-color: New Color; } Here is a really simple dropdown menu I made Html <div id="newsletter" class="navigation"> <span style="display:block;" id="newsletterMain" href="index.html">Newsletter</span> <a style="margin-top:19px; border-top:...
You can try : div.playTitleDurationContainer.cinema-large > div.qualityMarker{ } ...
I'm not sure the idea of 50% the height is the best approach. Try this: body{ background-color: #832029; background-image: url(../images/light/background.png); background-repeat: repeat-x; } Resizing background images (which you are not...
Used <table> tags and given width="100%" and work-break:break-all.My problem is solved
local() tries to use the font when it is already installed on the user's computer. Font-weight defines the boldness of the font, font-style allows you to display your font in...
Edit the contents.css file that's located in the main CKEditor directory or use the config.contentsCss setting to load a different file. I see that you confused the styles system settings...
As the divs are contained in the wrapper, you could remove display: table-cell on the two small divs so they naturally collapse underneath each other but inline with the larger...
If I understand you correctly, you want to the "Name" to appear to the left while everything else is to the right? So, like this: http://jsbin.com/gejefiji/1/edit The only thing I...
If you restructure your HTML slightly you can do this with pure HTML and CSS. Something like this as a snippet: HTML <label for="ship-sfc-CNQM" class="radio"> <input type="radio" name="shipping" value="sfc_CNQM" id="ship-sfc-CNQM"...
If you created the project using compojure template with lein, then there is a directory under your project root named ${project_root}/resources/public. The static files like .html, .js,, .css can reside...
I think this might help you. Just showing you the way how to achieve what you want. html, body { margin: 0; padding: 0; height: 100%; } #wrapper { min-height:...
With the given markup, javascript would not be even necessary for links inside #myDropdown: you could just use :focus pseudoclass like so #myDropdown a:focus + div { display: block; }...
You can use the following attributes for webkit, which reach into the shadow DOM: ::-webkit-scrollbar { /* 1 */ } ::-webkit-scrollbar-button { /* 2 */ } ::-webkit-scrollbar-track { /* 3...
links.Length IMHO should be length (small letter) this.setAttribute("class","a_hover"); (use this, there was a missing '"') window.onload = function() { links = document.getElementsByTagName("a"); //Getting ALL of the <a> tags for(var...
How to apply css class to a based on respective $value in a of that row in a repeat region
Try this: <table> <tr class="<?php echo $recordset['columnname1'] ?>"> ...... </tr> </table> Then it'll add class to the entire row of those td....
you can use <span> like this $("#display").html("<span style='font-weight: bold; font-size: 30px'>" + day +"</span><br/>"+realMonth);}); ...
You could try something such as: hr { width: 100%; height: 1px; color: #CCC; margin-top: -2px; } Not sure if there is any risk is using negative margins... I'm certainly...
Since you are using Angular JS, this can be done elegantly in Angular way. When clicking on the button, you can introduce a variable to list to indicate whether the...
This could be a way. Split your shadow boxes from your timers, so you can use z-index to put them behind the timers. .timer-container { font-size: 0; position: relative; }...
If you want to set height: 100%; to the <img/>, you should make it display: block; and give some height to the parent block. height: 100%; works only when it's...
Use pixel values, not just -sm or -sm-max instead enter your value where the breakpoint happen.
Assuming this is Wordpress (it looks a lot like Wordpress). The action hook that you want is wp_enqueue_scripts, not enqueue_scripts. Change your last line to add_action( 'wp_enqueue_scripts', 'register_wprs' ); ...
You need to use css-loader when creating bundle with wepback. Install it: npm install css-loader --save-dev And add it to loaders in your webpack configs: module.exports = { module: {...
You need to take the sticky footer toggle out the sticky footer div. The following code should work for you: HTML: <div class="stickyfooter"> <div id="sticky_footer_title"><a class="show_hide" href="#">Toggle Menu ▼</a></div> <div...
While it may seem like an anti-pattern, all above-the-fold CSS you inline into your document SHOULD be duplicated in your external CSS document. That way, you can make a single...
Try this: <table> <tr class="<?php echo $recordset['columnname1'] ?>"> ...... </tr> </table> Then it'll add class to the entire row of those td....
you can use <span> like this $("#display").html("<span style='font-weight: bold; font-size: 30px'>" + day +"</span><br/>"+realMonth);}); ...
You could try something such as: hr { width: 100%; height: 1px; color: #CCC; margin-top: -2px; } Not sure if there is any risk is using negative margins... I'm certainly...
Since you are using Angular JS, this can be done elegantly in Angular way. When clicking on the button, you can introduce a variable to list to indicate whether the...
This could be a way. Split your shadow boxes from your timers, so you can use z-index to put them behind the timers. .timer-container { font-size: 0; position: relative; }...
If you want to set height: 100%; to the <img/>, you should make it display: block; and give some height to the parent block. height: 100%; works only when it's...
Use pixel values, not just -sm or -sm-max instead enter your value where the breakpoint happen.
Assuming this is Wordpress (it looks a lot like Wordpress). The action hook that you want is wp_enqueue_scripts, not enqueue_scripts. Change your last line to add_action( 'wp_enqueue_scripts', 'register_wprs' ); ...
You need to use css-loader when creating bundle with wepback. Install it: npm install css-loader --save-dev And add it to loaders in your webpack configs: module.exports = { module: {...
You need to take the sticky footer toggle out the sticky footer div. The following code should work for you: HTML: <div class="stickyfooter"> <div id="sticky_footer_title"><a class="show_hide" href="#">Toggle Menu ▼</a></div> <div...
While it may seem like an anti-pattern, all above-the-fold CSS you inline into your document SHOULD be duplicated in your external CSS document. That way, you can make a single...