Sideways header - html

I've been trying to solve a sideways header problem. I intend on creating a globally sideways header like so on a website: sideways header
However, my problem arises trying to separate the type (it's also breaking on 2 lines). I can't seem to make the vertical line contained or centered within the rectangle . When I resize my browser window it does not stay contained within the rectangle box. I would GREATLY appreciate any suggestions and advice!
What I have so far:
.box {
height: 1326px;
width: 112px;
background-color: transparent;
border: 1px solid #f9f0e4;
}
.bottom {
text-align: center;
color: #000000;
/* Safari */
-webkit-transform: rotate(-90deg);
/* Firefox */
-moz-transform: rotate(-90deg);
/* IE */
-ms-transform: rotate(-90deg);
/* Opera */
-o-transform: rotate(-90deg);
/* Internet Explorer */
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}
.top {
text-align: center;
color: #000000;
/* Safari */
-webkit-transform: rotate(-90deg);
/* Firefox */
-moz-transform: rotate(-90deg);
/* IE */
-ms-transform: rotate(-90deg);
/* Opera */
-o-transform: rotate(-90deg);
/* Internet Explorer */
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}
.vl {
border-left: 1px solid #f9f0e4;
height: 620px;
position: absolute;
left: 50%;
top: 0;
}
<div class="container">
<div class="box">
<p class="bottom">CREATIVE STUDIO</p>
<div class="vl">
<p class="top">FLORENCE — ITALY</p>
</div>
</div>
</div>

You can instead consider rotation on the whole box and use vh unit so the width is relative to height since it's getting rotated :
.box {
background-color: transparent;
width: 80vh;
border: 1px solid;
transform: rotate(-90deg) translate(-50%, 0);
transform-origin: center;
}
.box {
display: flex;
justify-content: space-between;
text-align: center;
color: #000000;
}
.bottom {
text-align: center;
color: #000000;
margin-left: 10px;
}
.top {
text-align: center;
color: #000000;
margin-right: 10px;
}
<div class="box">
<p class="bottom">CREATIVE STUDIO</p>
<p class="top">FLORENCE — ITALY</p>
</div>

Related

HTML CSS rounded menu [duplicate]

This question already has answers here:
How to create a circle with links on border side
(8 answers)
Closed 5 years ago.
I'm looking but I can't find how create rounded menu like this on image. Is it posible only with html and css?
From 1 to 4 are buttons, any similar example would help.
i made your menu with html and css.
It was actually really simple:
HTML:
<div class='button-wrapper'>
<div class="btn1"></div>
<div class="btn2"></div>
<div class="btn3"></div>
<div class="btn4"></div>
</div>
CSS
.button-wrapper{
background-color: white;
width: 250px;
height: 250px;
padding: 50px;
position: relative;
transform: rotate(-45deg);
}
.btn1{
background: #EFE3B3;
width: 250px;
height: 125px;
border-top-left-radius: 150px;
border-top-right-radius: 150px;
}
.btn2{
background: #B6E438;
width: 125px;
height: 125px;
border-bottom-left-radius: 150px;
float: left;
}
.btn3{
background: #FEF035;
width: 125px;
height: 125px;
border-bottom-right-radius: 150px;
float: right;
}
.btn4{
background: #9BD9E9;
width: 50px;
height: 50px;
border-radius: 100px;
border: 20px solid #fff;
position: absolute;
top: 50%;
left: 50%;
transform: translate3d(-50%,-50%,0);
}
Also take a look at the plunkr I made.
if you want to have a pie chart, you can use highchart.js
or if you don't want to use highchart, you can use this code (this is what i found in code pen, it's a pen by patrick denny)
HTML
<div class="pie" data-start="0" data-value="30"></div>
<div class="pie highlight" data-start="30" data-value="30"></div>
<div class="pie" data-start="60" data-value="40"></div>
<div class="pie big" data-start="100" data-value="260"></div>
CSS
.pie {
position:absolute;
width:100px;
height:200px;
overflow:hidden;
left:150px;
-moz-transform-origin:left center;
-ms-transform-origin:left center;
-o-transform-origin:left center;
-webkit-transform-origin:left center;
transform-origin:left center;
}
.pie.big {
width:200px;
height:200px;
left:50px;
-moz-transform-origin:center center;
-ms-transform-origin:center center;
-o-transform-origin:center center;
-webkit-transform-origin:center center;
transform-origin:center center;
}
.pie:BEFORE {
content:"";
position:absolute;
width:100px;
height:200px;
left:-100px;
border-radius:100px 0 0 100px;
-moz-transform-origin:right center;
-ms-transform-origin:right center;
-o-transform-origin:right center;
-webkit-transform-origin:right center;
transform-origin:right center;
}
.pie.big:BEFORE {
left:0px;
}
.pie.big:AFTER {
content:"";
position:absolute;
width:100px;
height:200px;
left:100px;
border-radius:0 100px 100px 0;
}
.pie:nth-of-type(1):BEFORE,
.pie:nth-of-type(1):AFTER {
background-color:blue;
}
.pie:nth-of-type(2):AFTER,
.pie:nth-of-type(2):BEFORE {
background-color:green;
}
.pie:nth-of-type(3):AFTER,
.pie:nth-of-type(3):BEFORE {
background-color:red;
}
.pie:nth-of-type(4):AFTER,
.pie:nth-of-type(4):BEFORE {
background-color:orange;
}
.pie[data-start="30"] {
-moz-transform: rotate(30deg); /* Firefox */
-ms-transform: rotate(30deg); /* IE */
-webkit-transform: rotate(30deg); /* Safari and Chrome */
-o-transform: rotate(30deg); /* Opera */
transform:rotate(30deg);
}
.pie[data-start="60"] {
-moz-transform: rotate(60deg); /* Firefox */
-ms-transform: rotate(60deg); /* IE */
-webkit-transform: rotate(60deg); /* Safari and Chrome */
-o-transform: rotate(60deg); /* Opera */
transform:rotate(60deg);
}
.pie[data-start="100"] {
-moz-transform: rotate(100deg); /* Firefox */
-ms-transform: rotate(100deg); /* IE */
-webkit-transform: rotate(100deg); /* Safari and Chrome */
-o-transform: rotate(100deg); /* Opera */
transform:rotate(100deg);
}
.pie[data-value="30"]:BEFORE {
-moz-transform: rotate(31deg); /* Firefox */
-ms-transform: rotate(31deg); /* IE */
-webkit-transform: rotate(31deg); /* Safari and Chrome */
-o-transform: rotate(31deg); /* Opera */
transform:rotate(31deg);
}
.pie[data-value="40"]:BEFORE {
-moz-transform: rotate(41deg); /* Firefox */
-ms-transform: rotate(41deg); /* IE */
-webkit-transform: rotate(41deg); /* Safari and Chrome */
-o-transform: rotate(41deg); /* Opera */
transform:rotate(41deg);
}
.pie[data-value="260"]:BEFORE {
-moz-transform: rotate(260deg); /* Firefox */
-ms-transform: rotate(260deg); /* IE */
-webkit-transform: rotate(260deg); /* Safari and Chrome */
-o-transform: rotate(260deg); /* Opera */
transform:rotate(260deg);
}
JUST copy and paste this code to a fresh html page and see the changes

How to write bottom to top vertically with css

How to write vertically from bottom to up with HTML and CSS? I have tried many things writing-mod:tb-rl; but the issue not yet solved.
Create a div with class rotate
<div class="rotate"> Hello World </div>
Then define the CSS class
.rotate {
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
transform: rotate(-90deg);
-webkit-transform-origin: 50% 50%;
-moz-transform-origin: 50% 50%;
-ms-transform-origin: 50% 50%;
-o-transform-origin: 50% 50%;
transform-origin: 50% 50%;
}
Hope this is what you are looking for.
try using transforms.
.rotate {
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}
.rotate {
/* make width fit content */
display: inline-block;
/* rotate 90 degrees counterclockwise */
/* and move down on 100% of its height */
/* (actually width, but when rotated it looks like height) */
transform: rotate(-90deg) translateX(-100%);
/* perform this transformation relatively to the top left corner of block */
transform-origin: top left;
/* styles for demo */
padding: 10px;
background-color: red;
color: #fff;
text-transform: uppercase;
}
<div class="rotate">Profile</div>
But beware that transformed element takes its position the same if it wouldn't be transformed. So in case you'd have some siblings with text it will be overlapping them. Demo:
.rotate {
display: inline-block;
transform: rotate(-90deg) translateX(-100%);
transform-origin: 0 0;
/* just styles for current demo */
padding: 10px;
background-color: red;
color: #fff;
text-transform: uppercase;
}
<div class="container">
<div class="rotate">Profile</div>
<div>Some other text</div>
<div>Some other text</div>
<div>Some other text</div>
</div>
In this case you can apply absolute positioning to this element. Demo:
.container {
/* make absolute positioning relative to container */
position: relative;
/* some offset for its not rotated text */
/* need to be equal rotated element height + offset from rotated element */
padding-left: 45px;
}
.rotate {
display: inline-block;
transform: rotate(-90deg) translateX(-100%);
transform-origin: 0 0;
/* apply absolute positioning */
position: absolute;
/* move element to the left */
left: 0;
/* just styles for demo */
padding: 10px;
background-color: red;
color: #fff;
text-transform: uppercase;
}
<div class="container">
<div class="rotate">Profile</div>
<div>Some other text</div>
<div>Some other text</div>
<div>Some other text</div>
</div>

How to center rotated text?

What is the best way to center the rotated text (270deg) in current situation? It is currently position relatively but it isn't a very good solution.
HTML:
<div id="side" class="container">
<p id="sidetext" >Work</p>
</div>
<div id="cont" class="container">
<div id="row" class="row">
Hey yeah!
</div>
</div
And CSS:
#sidetext {
font-family: "Josefin Sans";
text-transform: uppercase;
display: block;
font-weight: 100;
font-size: 1.7em;
color: white;
-webkit-transform: rotate(270deg);
-moz-transform: rotate(270deg);
-o-transform: rotate(270deg);
-ms-transform: rotate(270deg);
transform: rotate(270deg);
transform: rotate(270deg);
position: relative;
top: 216px;
margin: 0 22px 10px;
}
you can try this css.
.tab-caption {
position: absolute;
top: 50%;
height: 2px; /* actual text will overlap! */
margin-top: -1px; /* subtract half the height */
line-height: 0px; /* centre the text on the base line */
text-align: center;
left: 50%; /* added */
transform: translateX(-50%) rotate(90deg); /* added translateX */
white-space: nowrap;
}

CSS rollover menu with animation not appearing correctly

This may seem like a repeat question and im sorry but i cannot fix this and its driving me mad. its probably something so simple too.
I have a hidden menu that appears on rollover of another div although it is behaving very funny. when i rollover the menu appears but it does not appear correctly. i have attached a fiddle and images of how it appears on my machine and how i would like it to appear.
/** Layout */
.ts-layout {
}
.ts-header {
width: 100%;
height: 74px;
border-bottom: 1px solid #000;
position: fixed;
display: inline-block;
z-index: 999;
background-color: #fff;
}
.ts-menu-activator {
width: 25px;
height: 100%;
background-color: #2E2E2E;
color: #fff;
position: fixed;
display: inline-block;
padding-top: 75px;
border-left: 1px solid #fff;
transition: 1s;
transform: translateX(0);
}
.ts-menu-activator:hover {
transition: 1s;
transform: translateX(150px);
}
.ts-menu-activator:hover + .ts-menu-area {
transition: 1s;
transform: translateX(0);
}
.ts-menu-area {
height: 100%;
width: 150px;
background-color: #2E2E2E;
color: #fff;
position: fixed;
transform: translate(-150px);
transition: 1s;
}
.ts-view {
width: 100%;
height: 100%;
padding-left: 25px;
padding-top: 75px;
}
/** Styling helpers */
.no-select {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.vertical-text {
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
transform: rotate(-90deg);
/* also accepts left, right, top, bottom coordinates; not required, but a good idea for styling */
-webkit-transform-origin: 50% 50%;
-moz-transform-origin: 50% 50%;
-ms-transform-origin: 50% 50%;
-o-transform-origin: 50% 50%;
transform-origin: 50% 50%;
/* Should be unset in IE9+ I think. */
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}
<div class="ts-layout" ng-controller="app.views.layout.header as vm">
<div class="ts-header">
<div class="row">
<div class="col-sm-6">Login Information</div>
<div class="col-sm-6">Controls</div>
</div>
</div>
<div class="ts-menu-activator">
<span class="vertical-text">TESTING</span>
</div>
<div class="ts-menu-area">
<i class="fa fa-home"></i>
Home
</div>
<div class="ts-view">
<div class="container">
<div class="angular-animation-container row">
<div class="shuffle-animation col-xs-12" ui-view></div>
</div>
</div>
</div>
</div>
Any help or suggestions is appreciated :)
also if anyone could tell me why my text is not displaying vertically that'd be great :)
Just change the <span> tag to a <p> tag see fiddle https://jsfiddle.net/DIRTY_SMITH/cvrhxm7p/12/
<div class="ts-menu-activator">
<p class="vertical-text">TESTING</p>
</div>

How to make a triangular shaped link without using image map?

What I am trying to do was keeping an anchor in my html which should be triangular shape and should be able to click only in that triangular portion but I am not supposed to use image map can anyone please suggest me a solution
Note : I know about CSS shapes but they are clickable in complete block. I just want it to be clickable in a tringle shape.
YES it is possible see the demo
You need this html:
<div id="link"> // Wrapper
<div id="square1"></div> // rotated square to cover the extra are
<a id="triangle-up" href="#"></a> // actual link
<div id="square2"></div> // rotated square to cover the extra are
</div>
CSS:
#link {
width:110px;
height:100px;
overflow:hidden;
margin:auto;
position:relative;
}
#triangle-up {
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 100px solid red;
position:absolute;
top:0px;
left:10px;
}
#square1 {
z-index: 10;
position: absolute;
display: inline-block;
width: 50px;
height: 110px;
// background: blue;
top: -16px;
left: -12px;
transform: rotate(26deg);
-ms-transform: rotate(26deg);/* IE 9 */
-webkit-transform: rotate(26deg); /* Safari and Chrome */
-o-transform: rotate(26deg); /* Opera */
-moz-transform: rotate(26deg); /* Firefox */
}
#square2 {
z-index: 10;
position: absolute;
display: inline-block;
width: 50px;
height: 110px;
// background: blue;
top: -16px;
left: 82px;
transform: rotate(-26deg);
-ms-transform: rotate(-26deg);/* IE 9 */
-webkit-transform: rotate(-26deg); /* Safari and Chrome */
-o-transform: rotate(-26deg); /* Opera */
-moz-transform: rotate(-26deg); /* Firefox */
}