Background Only Applying to Half Page - html

I am setting the Background of My application using ngStyle
like this <div [ngStyle]="{'background-image': 'url(' + photo + ')','height':'100%','width':'100%','margin':'0px'}" >
But in One of my Components that gets loaded by router-outlet the data is less and only half page gets the background, in rest all other pages its fine.
How to solve this error.
The component Template where the data is less
<div *ngIf="visibleTournament">
<div class = "row">
<div *ngFor="let entry of competitionTeams | keys">
<div class="col-md-4" (mouseleave)= "entry.hideme = false">
<div>
<div (click) = "entry.hideme = !entry.hideme" >
<div class = "groupBox"><div class="placed"><h3><span class = "label label-warning">Group - {{entry.key}}</span></h3></div></div>
</div>
<div class="well box" [hidden] = "!entry.hideme">
<table class="table">
<thead class="thead-inverse">
<tr>
<th>#</th>
<th>Team</th>
<th>Played Games</th>
<th>Points</th>
<th>Goals</th>
<th>GA</th>
<th>GD</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let subValue of entry.value">
<th scope="row">{{subValue.rank}}</th>
<td><img class="img-thumbnail small" src="{{subValue.crestURI}}">{{subValue.team}}</td>
<td>{{subValue.playedGames}}</td>
<td>{{subValue.points}}</td>
<td>{{subValue.goals}}</td>
<td>{{subValue.goalsAgainst}}</td>
<td>{{subValue.goalDifference}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
CSS file of this component
.avatar{
width:30px;
height:30px;
margin-right: 10px;
background: rgba(0,0,0,0);
border: none;
}
.inline{
display: inline-block;
margin: 10px 20px;
}
.check{
min-width: 500px;
}
.selector{
cursor: pointer;
}
.placed{
margin: 0 auto;
}
.box{
/*position: absolute;*/
text-align: center;
background: #ccffda;
padding: 10px 20px;
max-width: 500px;
border: darkgray 1px solid;
z-index: 1;
}
.groupBox{
/*position: relative;*/
text-align: center;
background: rgba(0,0,0,0.3);
padding: 20px 20px;
margin: 2px;
border: darkgray 1px solid;
cursor: pointer;
}
th {
white-space: nowrap;
}
.col-md-4{
margin-bottom: 80px;
}
.fix{
position: absolute;
}
.group{
/*background: rgba(0,0,0,0.4);*/
}
table th {
font-weight: bolder;
/*color:#49fb35;*/
}
.small{
width:20px;
height:20px;
background: rgba(0,0,0,0);
border: none;
}
For Ref My app component
<div [ngStyle]="{'background-image': 'url(' + photo + ')','height':'100%','width':'100%','margin':'0px'}" >
<nav class="navbar navbar-inverse">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" routerLink = "home">Football Data</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class = "container">
<div class = "row">
<div class = "col-md-12">
<div *ngIf="loading">
<!-- show something fancy here, here with Angular 2 Material's loading bar or circle -->
<div class = "parent">
<div class="spinner">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
</div>
</div>
<!--<progress-bar [value]="50" [max]="100"></progress-bar> // Simple Progess Bar-->
</div>
<router-outlet></router-outlet>
</div>
</div>
</div>
</div>
Appcomponent css
html, body{
height: 100%;
font-family: Arial, Helvetica, sans-serif
}
a.active {
background-color: gray;
}
h1 {
color: #00BCD4;
}
.parent{
position: fixed;
left:0;
right:0;
top: 0;
bottom: 0;
background: rgba(0,0,0,0.1);
display: flex; /* establish flex container */
flex-direction: column; /* make main-axis vertical */
justify-content: center; /* align items vertically, in this case */
align-items: center; /* align items horizontally, in this case */
}
.spinner {
margin: 100px auto;
width: 50px;
height: 40px;
text-align: center;
font-size: 10px;
}
.spinner > div {
background-color: black;
height: 100%;
width: 6px;
display: inline-block;
-webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;
animation: sk-stretchdelay 1.2s infinite ease-in-out;
}
.spinner .rect2 {
-webkit-animation-delay: -1.1s;
animation-delay: -1.1s;
}
.spinner .rect3 {
-webkit-animation-delay: -1.0s;
animation-delay: -1.0s;
}
.spinner .rect4 {
-webkit-animation-delay: -0.9s;
animation-delay: -0.9s;
}
.spinner .rect5 {
-webkit-animation-delay: -0.8s;
animation-delay: -0.8s;
}
#-webkit-keyframes sk-stretchdelay {
0%, 40%, 100% { -webkit-transform: scaleY(0.4) }
20% { -webkit-transform: scaleY(1.0) }
}
#keyframes sk-stretchdelay {
0%, 40%, 100% {
transform: scaleY(0.4);
-webkit-transform: scaleY(0.4);
} 20% {
transform: scaleY(1.0);
-webkit-transform: scaleY(1.0);
}
}
How the component Loads up in browser

I don't know what you think this does
<div [ngStyle]="{'background-image': 'url(' + photo + ')','height':'100%','width':'100%','margin':'0px'}" >
but here's the result in plain CSS:
{
background-image: url(photo);
height: 100%;
width: 100%;
margin: 0;
}
Now maybe you think that's supposed to make your background-image stretch to 100% width and height of the <div> but... it's really not.
If (photo) is smaller than the div, you must set your div's background-size property in order to make the image cover all background.
You should set it to cover.
Tip: Whenever you need help with CSS, if you skip the AngularJS part, and just ask: this is my resulting CSS, why isn't my picture full size? you drastically increase chances of getting a proper answer fast and it might even come from someone who doesn't know AngularJS (and who doesn't need to know it in order to help you).
If my answer doesn't solve your problem you need to create a minimal, complete and verifiable example, so we can inspect and see why your background-image doesn't apply. Whatever happens in your app, it still outputs HTML + CSS + JS. And that's what you need help with.

Related

How to add content and icons to the right side in top navbar in vue.js?

I developed one top navbar which is fixed at the top , i am trying to add right side icons and some content into the top navbar [like this]1with two icons and below the content like profile and cart that must be inside the right side top navbar , i am trying to fix that but it's not happening please help me to fix this issue
.
Dashboard.vue
<template>
<div class="main">
<nav class="navbar navbar-default navbar-fixed-top">
<div class="navbar-header">
<img src="../assets/education.png" alt="notFound" />
</div>
<ul class="nav navbar-nav">
<li>
<p>Bookstore</p>
</li>
</ul>
<div class="input-group">
<i class="fas fa-search"></i>
<div class="form-outline">
<input type="search" class="form-control" placeholder='search...' />
</div>
</div>
<ul class="nav navbar-nav navbar-right">
<li><a> <i class="far fa-user"></i></a></li>
<p>profile</p>
<li><a><i class="fas fa-cart-plus"></i></a></li>
<p>cart</p>
</ul>
</nav>
</div>
</template>
<style lang="scss" scoped>
#import "colors";
.navbar-default {
background: $redish_brown;
height: 60px;
}
li p {
margin-top: 5px;
margin-left: -1250px;
width: 91px;
height: 26px;
text-align: left;
font: normal normal normal 18px/26px Roboto;
letter-spacing: 0px;
color: $pale_white;
text-transform: capitalize;
opacity: 1;
}
img {
background: transparent 0% 0% no-repeat padding-box;
opacity: 1;
width: 31px;
height: 24px;
margin-top: -12px;
margin-left: 194px;
}
.input-group{
margin-left:345px;
}
input[type="search"]{
width: 490px;
height: 33px;
margin-top:-40px;
background: #FCFCFC 0% 0% no-repeat padding-box;
border-radius: 3px;
margin-left:3px;
opacity: 1;
}
// .fa-user{
// margin-left:1064px;
// width: 31px;
// height: 36px;
// opacity: 1;
// margin-top:-25%;
// }
.input-group {
display: flex;
align-items: center; // to center the icon vertically
}
.input-group .fas {
position: absolute;
margin-left: 8px;
}
.fa-search{
margin-top:-40px;
opacity: 1;
}
.input-group input[type="search"] {
padding: 8px 8px 8px 32px;
}
a i{
// display:flex;
float:right;
}
</style>
Since the navbar is fixed at the top then you can use
ul{
position: absolute;
display: flex;
right: 0;
flex-direction: row !important; // because navbar-nav direction set to column
gap: 1rem;
margin-right: 1rem;
}

How to position a button at the bottom and center of div?

I'm having a real issue trying to position a button at the bottom and center of a div. I ended up finally getting it to look right in full screen mode but I know the methodology is totally wrong.
I was able to align the text the way I wanted but the button not working the same with position and translate. I tried using bootstraps columns but that did not work. I'm not sure I fully understand positioning things relative to their parent elements or position at all. In addition, I tried
vertical-align:bottom
vertical-align:baseline
Neither of these worked.
What is the best practice for positioning a button or any element at the bottom and center of a div
.navbar-brand {
font-family: 'Great Vibes', cursive;
font-size: 30px;
margin: 5px 0px 5px 1px;
}
.navbar-brand {
color: #F05F40 !important;
}
.jumbotron {
background: url('http://i65.tinypic.com/1213l9y.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
height: 100vh;
width: 100vw;
margin-left: -15px;
}
.jumbotron h1 {
font-family: 'Great Vibes', cursive;
font-size: 75px;
color: white;
position: relative;
top: 50%;
transform: translateY(-50%);
}
.jumbotron h4 {
font-family: 'Great Vibes', sans-serif;
font-size: 25px;
color: white;
position: relative;
top: 50%;
transform: translateY(-50%);
}
.btn-primary {
color: white;
background-color: #F05F40;
border-color: #F05F40;
-webkit-transition: all 0.35s;
-moz-transition: all 0.35s;
transition: all 0.35s;
margin-top: 25%;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary.focus,
.btn-primary:active,
.btn-primary.active,
.open>.dropdown-toggle.btn-primary {
color: white;
background-color: #ee4b28;
border-color: #ed431f;
}
.btn-primary:active,
.btn-primary.active,
.open>.dropdown-toggle.btn-primary {
background-image: none;
}
.btn-primary.disabled,
.btn-primary[disabled],
fieldset[disabled] .btn-primary,
.btn-primary.disabled:hover,
.btn-primary[disabled]:hover,
fieldset[disabled] .btn-primary:hover,
.btn-primary.disabled:focus,
.btn-primary[disabled]:focus,
fieldset[disabled] .btn-primary:focus,
.btn-primary.disabled.focus,
.btn-primary[disabled].focus,
fieldset[disabled] .btn-primary.focus,
.btn-primary.disabled:active,
.btn-primary[disabled]:active,
fieldset[disabled] .btn-primary:active,
.btn-primary.disabled.active,
.btn-primary[disabled].active,
fieldset[disabled] .btn-primary.active {
background-color: #F05F40;
border-color: #F05F40;
}
.btn-primary .badge {
color: #F05F40;
background-color: white;
}
.btn {
font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
border: none;
border-radius: 300px;
font-weight: 700;
text-transform: uppercase;
}
.btn-xl {
padding: 15px 30px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<header class="navbar navbar-inverse navbar-fixed-top bs-docs-nav" role="banner">
<div class="navbar-header">
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
The Authentic Gentleman
</div>
<nav class="pull-right collapse navbar-collapse bs-navbar-collapse" role="navigation">
<ul class="nav navbar-nav">
<li>
Home
</li>
<li>
Blog
</li>
<li>
Advice
</li>
<li class="#">
About
</li>
</ul>
</nav>
</div>
</header>
<div class="container-fluid">
<div class="jumbotron">
<h1 class="text-center">The Authetnic Gentelman</h1>
<h4 class="text-center">Refine your life</h4>
<div class="text-center">
Find Out More
</div>
</div>
</div>
You can set it using position: absolute;. updated codepen
<div class="text-center btnDiv">
Find Out More
</div>
.jumbotron {
position: relative;
}
.btnDiv {
width: 100%;
left: 0;
bottom: 10px;
position: absolute;
}
You can also give this a try.
.parent{
text-align:center;
}
.button{
position:fixed;
bottom:0;
}
<div class='parent'>
<button class='button'>Save</button>
</div>
So add position:relative; to parent div and add the following css to the button:
position: absolute;
bottom: 0;
CSS:
#parent{
position:relative;
}
#button{
position:absolute;
bottom:0;
}
This will help you.
css:
#parent{
height: 200px;
width: 100%;
position: relative;
border: 1px solid blue;
}
#parent #child{
width:100%;
margin: auto;
text-align: center;
bottom: 0px;
position: absolute;
}
<div id="parent">
<div id="child">
<button>click here</button>
</div>
</div>
Cleaned up your code a little bit - you don't need to give class="text-center" to every element. Put text-align: center; in the parent div instead so the child elements get that attribute down too.
https://codepen.io/julysfx/pen/vZqXgj
You don't need to complicate the code with position: absolute;
You can do this simply with display:table;
Code is mentioned bellow...
<div class="parent">
<div class="buttonWrap">
<button>button</button>
</div>
</div>
.parent {
height: 200px;
width: 300px;
padding-bottom: 10px;
background: #444;
display: table;
}
.buttonWrap {
display: table-cell;
vertical-align: bottom;
}
button {
margin: 0 auto;
display: block;
}

Linking back from popup on devices

I build a simple page with popup links. Works fine on desktop.
I don't know how to solve an issue in a right way, i mean, i can find a crappy solution but i would like to know the correct one. On cell phone when clicking back from the popup image, its return to somewhere on the middle of the main page, not on the top of the page. This is an online sample to try:
online page
html, a {text-decoration:none;}
div {margin:0 auto 10px auto; height:200px; width:200px}
h1 {font: normal 90px Helvetica, Sans-Serif;
letter-spacing: 0.5px;
line-height:1px;
position: relative;
top:100px;
text-align: center;
margin: 0;
left:0;
right:0;
font-weight: 800;
color:#000000}
.popup {
position: absolute;
padding-top:30px;
width: 100%;
height: 100%;
display: none;
text-align:center;
z-index: 200;
opacity:1;
}
.popup:target {
display: block;
-webkit-animation-name: fadein 0,2s;
animation-name: fadein;
animation-duration: 0.2s;
}
.popup img {
padding: 4px;
width: 80%;
z-index: 120;
border: solid 1px gray;
cursor: pointer;
background-color:#FFFFFF;
}
#media only screen and (max-width: 540px) {
div {margin:0 auto 10px auto; height:200px; width:auto}
}
<body bgcolor="gray">
<div class="button" style="background-color:#049EA4;"><h1>01</h1>
</div>
<div style="background-color: #F1FB00"><h1>02</h1>
</div>
<div style="background-color: #1779F0;"><h1>03</h1>
</div>
<div style="background-color: #FF00CF;"><h1>04</h1>
</div>
<div style="background-color: #FFA200;"><h1>05</h1>
</div>
<div style="background-color: #0042FF;"><h1>06</h1>
</div>
<div style="background-color: #A01CF0;"><h1>07</h1>
</div>
<div style="background-color: #0DF186;"><h1>08</h1>
</div>
<div id="01" class="popup"><img src="http://www.ikea.com/gb/en/images/products/pekann%C3%B6t-plant-pot-rattan__0132102_pe286857_s4.jpg" alt="01"></div>
<div id="02" class="popup"><img src="http://www.ikea.com/gb/en/images/products/or%C3%A4dd-plant-pot-in-outdoor-beige__0108864_pe258535_s4.jpg" alt="02"></div>
<div id="03" class="popup"><img src="http://www.ikea.com/gb/en/images/products/socker-plant-pot-in-outdoor-galvanised__0107648_pe257427_s4.jpg" alt="03"></div>
<div id="04" class="popup"><img src="http://www.ikea.com/us/en/images/products/huson-plant-pot__12045_PE089408_S4.JPG" alt="04"></div>
<div id="05" class="popup"><img src="http://www.ikea.com/gb/en/images/products/ingef%C3%A4ra-plant-pot-with-saucer-outdoor-terracotta__0313254_pe513840_s4.jpg" alt="05"></div>
<div id="06" class="popup"><img src="http://www.ikea.com/us/en/images/products/ragkorn-plant-pot__0134053_PE289885_S4.JPG" alt="06"></div>
<div id="07" class="popup"><img src="http://www.ikea.com/gb/en/images/products/skurar-plant-pot-in-outdoor-off-white__0114580_pe267097_s4.jpg" alt="07"></div>
<div id="08" class="popup"><img src="http://www.ikea.com/us/en/images/products/hasselnot-plant-pot__0119553_PE275934_S4.JPG" alt="08"></div>
Thanks
It's because your image is popping up at the bottom of your page, so when you close the image, you're looking at the bottom of the page.
To make your popup appear at the top of the page, add top: 0; to your .popup class:
.popup {
position: absolute;
top: 0;
padding-top:30px;
width: 100%;
height: 100%;
display: none;
text-align:center;
bgcolor:yellow;
z-index: 200;
opacity:1;
}

Transition css with hover

I am trying do a transition, that it comes out below
with a delay but I do not get it.
I only want to use CSS, no jquery or js.
Hover works,but not the transition.
Anyone can help me?
Edit: Some like this: link. The examples below
.tools-link {
text-align: center;
}
.tools {
margin: 15px 0;
text-align: center;
height: 280px;
overflow: hidden;
}
.tool-dedicaciones-slide-title {
height: 50px;
margin: 20px 0 5px;
width: 100%;
top: 50%;
transform: translateY(25%);
}
.tool-dedicaciones-slide {
padding: 10px 10%;
background-color: #fff;
height: 100%;
}
.tool-dedicaciones-slide:hover {
position: absolute;
top: 0;
transition: all .4s ease-in-out .1s;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<div class="col-xs-12 col-sm-6 col-md-15 tools tool-dedicaciones">
<a class="remove-underline tools-link" href="">
<!-- <img src="/assets/img/tools/01-maiap-02.png" class="image-dedicaciones"/> -->
<div style="background-color: #725d98; height: 200px; "></div>
<div class="tool-dedicaciones-slide">
<div class="tool-dedicaciones-slide-title" >Dedicacion#s</div>
<div class="tool-dedicaciones-slide-description">
<p>Herramienta para el control y la gestión de dedicaciones profesionales. Autentificación y autorización en servicios terceros. Control de caducidad del Token de sesión. BDD encriptada.</p>
</div>
</div>
</a>
</div>
Not sure what you are trying to apply the transition to, but generally you have do define the property in both the "normal" state and the hover state.
Example:
<style>
.box {
width:500px;
height:500px;
background-color:blue;
transition:0.5s all 0.5s;
}
.box:hover {
background-color:red;
}
</style>
<div class="box"></div>
https://jsfiddle.net/7zszjbw0/

Wedge shaped menu

I've been digging into how to create a wedge shaped menu and came across the following stackoverflow post: Diagonal Wedge Shaped CSS - Edge to Edge Centered in Browser
I've re-purposed the example image Varazi drew up to better explain my own situation (please excuse the old writing on it). I've added 2 menu items, home and contact, to show what I'm trying.
The code I have been playing around with (found from the above link).
HTML
<div class="shape">
<div class="top"></div>
<div class="bottom"></div>
</div>
CSS
.shape {
width:400px;
margin:0 auto;
}
.top {
height:0;
border-width:0 0 150px 400px;
border-style:solid;
border-color:transparent #d71f55 #d71f55 transparent;
}
.bottom {
height: 50px;
background-color:#d71f55;
}
/* Support transparent border colors in IE6. */
* html .top {
filter:chroma(color=#123456);
border-top-color:#123456;
border-left-color:#123456;
}
Update: After playing quite a lot with it, really fun challenge I must say, I have finally gotten it exactly the way I needed it to be with the helpful tip by Talkingrock (thanks man!). My remaining challenge would be showing the .sub-menu inside an overflow: hidden element (#masthead), but it's not overly important as I can have the links plastered on the homepage in the relevant content sections.
Hope the below code helps a poor soul out, such as myself, who needed help. Enjoy! :)
HTML (I'm using WordPress/Bootstrap)
<header id="masthead" class="site-header" role="banner">
<nav id="site-navigation" class="navbar navbar-default" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="http://demo.dev/" title="demo" rel="home">
<img width="159" height="134" src="http://demo.dev/wp-content/uploads/2014/10/logo.png" class="img-responsive" alt="logo">
</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul id="menu-main-menu" class="nav navbar-nav pull-right">
<li>Home</li>
<li>About Us</li>
<li>Services
<ul class="sub-menu">
<li>Industrial Electrical</li>
<li>Commercial Electrical</li>
<li>Domestic Electrical</li>
</ul>
</li>
<li>Contact</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
</header>
CSS (using Less)
/* --- header */
#masthead {
overflow: hidden;
position: relative;
bottom: 50px; height: 200px;
background: red;
transform: skew(0deg, -3deg);
}
/* --- main navigation */
#site-navigation {
position: relative;
bottom: -50px;
height: 100%;
margin-bottom: 0;
border-radius: 0;
background: none;
border: none;
transform: skew(0deg, 3deg);
.container,
.navbar-collapse {
height: 100% !important;
}
.nav {
height: 100%;
&>li {
height: 100%;
&>a {
height: 100%;
padding: 80px 15px 0;
color: #fff;
}
&.current-menu-item,
&:hover {
&>a {
background-color: #tree-poppy;
}
}
}
}
}
Update2: Just wanted to quickly mention you can also attach the wedge part to an existing element easily without using any additional elements as well!
CSS
#masthead:after {
content: "";
position: absolute;
top: -45px; left: 0;
z-index: -1;
width: 100%; height: 80px;
background-color: red;
transform: skew(0deg, -3deg);
}
Here's what I came up with:
The HTML:
<header>
<nav>
Home
Contact
About
</nav>
</header>
The CSS:
header {
overflow: hidden;
margin-top: -550px;
height: 850px;
margin-bottom: -50px;
}
nav {
width: 120%;
margin: 0 -10%;
transform: rotate(-12deg);
background: red;
padding: 0 10%;
overflow: hidden;
}
nav a {
color: #fff;
text-decoration: none;
display: block;
float: left;
transform: rotate(12deg);
background: purple;
padding-top: 500px;
padding-bottom: 1000px;
margin-bottom: -900px;
text-align: center;
width: 80px;
position: relative;
}
.link-1 {
top: -36px;
}
.link-2 {
top: -18px;
}
Here's a working example: http://codepen.io/btpoe/pen/GavLk
Please note that this would not work in IE8 or less and would need some sort of fallback.