Need help making h1 appear over-top of image - html

I've got a few lines of type set in a stylized h1 (type is skewed, underlined with border, etc). I'd like the h1 to appear over the top of the "bg-image" div class, but I'm having trouble. I'm new to using DIV structure.
.bg-image h1 {
display:inline-block;
font-size:48px;
font-family: "sofia-pro",sans-serif;
font-weight:900;
text-transform:uppercase;
color:#fff;
border-bottom:7px solid #fff;
padding-bottom:5px;
margin-top:4px;
-webkit-transform: rotate(-15deg) skew(-15deg, 0);
-moz-transform: rotate(-15deg) skew(-15deg, 0);
-ms-transform: rotate(-15deg) skew(-15deg, 0);
-o-transform: rotate(-15deg) skew(-15deg, 0);
transform: rotate(-15deg) skew(-15deg, 0);
text-transform: uppercase;
}
.bg-image {
position: relative;
}
.bg-image img {
display: block;
width: 100%;
background-size:cover;
max-width: 2000px; /* corresponds to max height of 450px */
margin: 0 auto;
}
<div class="bg-image">
<img src="http://s27.postimg.org/h12ymqn9v/Web_Hdr_Bground_1.jpg">
<h1>Nobody</h1>
<br>
<h1>Ever Says</h1>
<br>
<h1>Seize</h1>
<br>
<h1 class="skewed">Tomorrow.</h1>
</div>

You can use background-image on .bg-image class so you have more control.
Like this:
.bg-image h1 {
display:inline-block;
font-size:48px;
font-family: "sofia-pro",sans-serif;
font-weight:900;
text-transform:uppercase;
color:#fff;
border-bottom:7px solid #fff;
padding-bottom:5px;
margin-top:4px;
-webkit-transform: rotate(-15deg) skew(-15deg, 0);
-moz-transform: rotate(-15deg) skew(-15deg, 0);
-ms-transform: rotate(-15deg) skew(-15deg, 0);
-o-transform: rotate(-15deg) skew(-15deg, 0);
transform: rotate(-15deg) skew(-15deg, 0);
text-transform: uppercase;
}
.bg-image {
position: relative;
width: 500px;
height: 500px;
background: url('http://s27.postimg.org/h12ymqn9v/Web_Hdr_Bground_1.jpg') center;
background-size: cover;
}
<div class="bg-image">
<h1>Nobody</h1>
<br>
<h1>Ever Says</h1>
<br>
<h1>Seize</h1>
<br>
<h1 class="skewed">Tomorrow.</h1>
</div>

You have to play with position: relative and the distance in pixels you feel like for h1 to achieve your desired result. I just tried adding position: relative; and top: -450px;
.bg-image h1 {
display:inline-block;
font-size:48px;
font-family: "sofia-pro",sans-serif;
font-weight:900;
text-transform:uppercase;
color:#fff;
border-bottom:7px solid #fff;
padding-bottom:5px;
margin-top:4px;
-webkit-transform: rotate(-15deg) skew(-15deg, 0);
-moz-transform: rotate(-15deg) skew(-15deg, 0);
-ms-transform: rotate(-15deg) skew(-15deg, 0);
-o-transform: rotate(-15deg) skew(-15deg, 0);
transform: rotate(-15deg) skew(-15deg, 0);
text-transform: uppercase;
position: relative;
top: -450px;
}
.bg-image {
position: relative;
}
.bg-image img {
display: block;
width: 100%;
background-size:cover;
max-width: 2000px; /* corresponds to max height of 450px */
margin: 0 auto;
}
<div class="bg-image">
<img src="http://s27.postimg.org/h12ymqn9v/Web_Hdr_Bground_1.jpg">
<h1>Nobody</h1>
<br>
<h1>Ever Says</h1>
<br>
<h1>Seize</h1>
<br>
<h1 class="skewed">Tomorrow.</h1>
</div>

I am new to code and just saw this question. Have you tried the z-index? The z-index controls the z axis (up and down) of the webpage. Try putting z-index: -1 on css to make sure the picture will appear under the text on the webpage. Hope this helped!

Related

How to create a circular spinning navigation bar

I am having problems creating a Navigation bar that can spin in a circle in CSS3 and HTML. How can I do this? Below is a picture of the idea from an old game. I want the same animation type that it uses. When it is on the active circle, the page is shown. As you move left and right, the page will change. Is there a way to accomplish this? How can I create this in CSS3 and HTML5.
I have added a code snippet of what I have done so far as a basic idea. I need two buttons that would allow the animation to move left or right instead of 1,2,3,4.
The idea comes from SliderDock. A dock for Windows and MacOS.
CSS3 should be able to accomplish this task if i'm not mistaken.
http://img05.deviantart.net/d13f/i/2011/139/7/4/altimit_mine_os_by_tenshi_no_chi-d3gowsq.png
* {
margin: 0;
padding: 0;
-webkit-backface-visibility: hidden;
}
/*HEADER*/
.header {
height: 25px;
background: #222;
color: #eee;
text-align: center;
font: 10px/25px Helvetica, Verdana, sans-serif;
}
.header a {
color: #999;
}
/*WRAPPER*/
.wrapper {
position: relative;
overflow: hidden;
margin: 20px auto;
width: 370px;
}
.menu a {
margin-right: -4px;
padding: 10px 30px;
width: 50px;
color: #333;
text-decoration: none;
font: 15px/25px Helvetica, Arial, sans-serif;
}
.menu a:hover {
background: #eee;
}
/*INNER CIRCLE*/
.wrapper:before {
content: "Menu";
text-align: center;
font: 30px/120px Georgia, Times, serif;
color: #black;
position: absolute;
top: 140px;
left: 110px;
z-index: 10;
width: 130px;
height: 130px;
border-radius: 50%;
background: #fff;
-webkit-box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.3);
box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.3);
}
/*MAIN CIRCLE*/
.circle {
position: relative;
margin-top: 30px;
margin-bottom: 20px;
margin-left: 25px;
width: 300px;
height: 300px;
border-radius: 50%;
background: #white;
box-shadow: inset 0px 0px 30px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: inset 0px 0px 30px rgba(0, 0, 0, 0.3);
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-ms-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
/*LITTLE CIRCLES*/
.circle li {
position: absolute;
width: 50px;
height: 50px;
border-radius: 50%;
background: white;
list-style-type: none;
text-align: center;
font: 20px/50px Helvetica, Arial, sans-serif;
top: 0;
left: 0;
}
.circle li:nth-child(1) {
top: 15px;
left: 125px;
}
.circle li:nth-child(2) {
top: 125px;
left: 235px;
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg);
}
.circle li:nth-child(3) {
top: 235px;
left: 125px;
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
-ms-transform: rotate(180deg);
-o-transform: rotate(180deg);
transform: rotate(180deg);
}
.circle li:nth-child(4) {
top: 125px;
left: 15px;
-webkit-transform: rotate(270deg);
-moz-transform: rotate(270deg);
-ms-transform: rotate(270deg);
-o-transform: rotate(270deg);
transform: rotate(270deg);
}
/*HOVER STATES*/
.menu > .one:hover ~ .circle {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}
.menu > .two:hover ~ .circle {
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
transform: rotate(-90deg);
}
.menu > .three:hover ~ .circle {
-webkit-transform: rotate(-180deg);
-moz-transform: rotate(-180deg);
-ms-transform: rotate(-180deg);
-o-transform: rotate(-180deg);
transform: rotate(-180deg);
}
.menu > .four:hover ~ .circle {
-webkit-transform: rotate(-270deg);
-moz-transform: rotate(-270deg);
-ms-transform: rotate(-270deg);
-o-transform: rotate(-270deg);
transform: rotate(-270deg);
}
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<meta name="description" content="description">
<title>Nav Menu</title>
<link rel="stylesheet" type="text/css" media="screen" href="style.css" />
</head>
<body>
<div class="header"></div>
<div class="wrapper">
<div class="menu">
1
2
3
4
<div class="circle">
<ul>
<li>Home</li>
<li>World</li>
<li>Games</li>
<li>AboutUs</li>
</ul>
</div>
</div>
</div>
</body>
</html>
you can do it with CSS3 also. To do this use animation rotate on hover of that numbers and rotate the menu image.
you can do it by using javascript with onmousehover and onmouseleave event.

Dropdown menu hiding behind content?

so I'm new to this and have been trying to put in a dropdown menu on a theme I found online. I've gotten it to work for the most part, however, the dropdown menu is hiding behind the main content. I know this is the problem because it works when I adjust the top padding for ".menu ul #listcontain" but it moves the photo to a place I don't want it. I feel like I've tried everything (adjusting z-indexes, positions, etc.) and still cannot figure it out. I just started doing this a month ago can someone help me out? Many thanks.
So then for the CSS I have this (Just the menu. It's a big page so I'm trying to include just the part I need):
*{padding:0; margin:0;}
body{ font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#1491c1; background:url(../images/bg.jpg) repeat;}
img{border:none;}
h1{ font-family: 'Droid Serif', serif; font-weight:normal; color:#fff;}
h2{ font-family: 'Droid Serif', serif; font-weight:normal; color:#fff; font- size:18px;}
P{ line-height:20px;}
a{text-decoration:none; color:#1491c1;}
a:hover{color:#fff;}
/*-------------------------------------------------
GENERAL CLASSES
-------------------------------------------------*/
.mar-top{ margin-top:40px;}
.mar-top30{ margin-top:30px;}
.mar-bottom{ margin-bottom:40px;}
.mar-Right{ margin-right:40px;}
.mar-right115{ margin-right:115px;}
.float-left{ float:left;}
.float-right{ float:right;}
.clearing { clear:both;}
.bor-bottm-non{border-bottom:none!important;}
.panel{}
.title{}
.content{}
.wrap{width:960px; margin:0 auto;overflow:hidden; background:url(../images/page-bg.jpg);}
.page{ width:580px; margin:0 auto;overflow:hidden; padding-bottom:50px;}
.page-content{ width:580px; margin:0 auto;overflow:hidden; padding- bottom:30px; padding-top:30px;}
.block{padding:20px 20px 20px 20px; margin:0 auto;}
.block2{padding:20px 20px 20px 20px; margin:0 auto;}
.button a{text-decoration:none; display:block; width:70px; height:30px; background:#1491c1; color:#ffffff; font-family:Arial, Helvetica, sans-serif; line-height:30px; text-align:center;}
.button a:hover{ background:#0e5295;}
/*-------------------------------------------------
CONTENT CLASSES
-------------------------------------------------*/
.page-content{ width:580px; margin:0 auto;overflow:hidden; padding- bottom:30px; padding-top:30px;}
.page-content .content h3{ padding-bottom:20px;font-family: 'Droid Serif', serif; font-weight:normal; color:#fff; font-size:16px;}
.page-content .content p{ padding-bottom:15px;}
/*-------------------------------------------------
HEADER CLASSES
-------------------------------------------------*/
.header-wrap{ background:#083266; height:162px; width: 960; }
.header{ width:1200px; margin:0 auto; z-index: 11;}
.logo{ float:left; background:#1491c1; width:300px; }
.logo h1{font-size:25px; text-align:left; padding:40px 0px 36px 25px ;
}
.menu ul #listcontain{ list-style:none; float: left; border-right:#093e76 solid 1px; padding: 0px 20px 30px 20px; }
.menu ul #listcontain a{ text-decoration:none; color:#80d2f8; font- size:14px; text-align:center;padding-right: 5px;}
.menu ul #listcontain a:hover{ color:#1491c1;}
.menu ul #listcontain a.active{ color:#1491c1;}
* {
box-sizing: border-box;
}
#main {
position: relative;
list-style: none;
background: #083266;
font-weight: 400;
font-size: 0;
text-transform: none;
display: inline-block;
padding: 118px 0px 0px 0px;
margin: 0 auto;
}
#main li {
color: #ffffff;
font-size: 0.8rem;
display: inline-block;
position: relative;
padding: 13px 20px;
cursor: pointer;
z-index: 5;
min-width: 120px;
}
li {
margin: 0;
}
#marker {
height: 6px;
background: #1491c1 !important;
position: absolute;
bottom: 0;
width: 120px;
z-index: 2;
-webkit-transition: all 0.35s;
-moz-transition: all 0.35s;
-ms-transition: all 0.35s;
transition: all 0.35s;
}
#main li:nth-child(1):hover ul div {
-webkit-transform: translate(0, 0);
-moz-transform: translate(0, 0);
-ms-transform: translate(0, 0);
transform: translate(0, 0);
}
#main li:nth-child(1):hover ~ #marker {
-webkit-transform: translate(0px, 0);
-moz-transform: translate(0px, 0);
-ms-transform: translate(0px, 0);
transform: translate(0px, 0);
}
#main li:nth-child(2):hover ul div {
-webkit-transform: translate(0, 0);
-moz-transform: translate(0, 0);
-ms-transform: translate(0, 0);
transform: translate(0, 0);
}
#main li:nth-child(2):hover ~ #marker {
-webkit-transform: translate(130px, 0);
-moz-transform: translate(130px, 0);
-ms-transform: translate(130px, 0);
transform: translate(133px, 0);
}
#main li:nth-child(3):hover ul div {
-webkit-transform: translate(0, 0);
-moz-transform: translate(0, 0);
-ms-transform: translate(0, 0);
transform: translate(0, 0);
}
#main li:nth-child(3):hover ~ #marker {
-webkit-transform: translate(260px, 0);
-moz-transform: translate(260px, 0);
-ms-transform: translate(260px, 0);
transform: translate(269px, 0);
}
#main li:nth-child(4):hover ul div {
-webkit-transform: translate(0, 0);
-moz-transform: translate(0, 0);
-ms-transform: translate(0, 0);
transform: translate(0, 0);
}
#main li:nth-child(4):hover ~ #marker {
-webkit-transform: translate(360px, 0);
-moz-transform: translate(380px, 0);
-ms-transform: translate(360px, 0);
transform: translate(397px, 0);
}
#main li:nth-child(5):hover ul div {
-webkit-transform: translate(0, 0);
-moz-transform: translate(0, 0);
-ms-transform: translate(0, 0);
transform: translate(0, 0);
}
#main li:nth-child(5):hover ~ #marker {
-webkit-transform: translate(360px, 0);
-moz-transform: translate(380px, 0);
-ms-transform: translate(360px, 0);
transform: translate(529px, 0);
}
#drops {
overflow: hidden;
list-style: none;
position: absolute;
padding: 0;
width: 100%;
left: 0;
top: 58px;
}
#drops div {
-webkit-transform: translate(0, -100%);
-moz-transform: translate(0, -100%);
-ms-transform: translate(0, -100%);
transform: translate(0, -100%);
-webkit-transition: all 0.5s 0.1s;
-moz-transition: all 0.5s 0.1s;
-ms-transition: all 0.5s 0.1s;
transition: all 0.5s 0.1s;
position: relative;
}
#drops li {
display: block;;
padding: 0;
width: 100%;
background: #3E8760 !important;
z-index: 10;
}
<link href='http://fonts.googleapis.com/css?family=Droid+Serif' rel="stylesheet" type="text/css">
<nav>
<div class="wrap">
<div class="header">
<div class="logo"><h1>JHT Market Development Team (MDT) Site</h1></div>
<div class="menu" id="main">
<ul>
<li id="listcontain">Home</li>
<li id="listcontain">MDT Resources
<ul class="drop" id="drops">
<div>
<li>MDT Calender</li>
<li>MDT Agendas</li>
<li>Meeting Materials</li>
</div>
</ul>
<li id="listcontain">Proposals </li>
<li id="listcontain"> CSO Priorities </li>
<li id="listcontain">Contact MDT</li>
<div id="marker"></div>
</ul>
</div>
</div>
</div>
</nav>
I believe the problem lies somewhere in one of the general classes but I can't figure out how to fix it without screwing up the whole page.
I'm guessing that since the DOM for the menu comes before the body the absolute positioning is causing the main content to stack on top.
Imagine two divs right next to each other, and the first one is given absolute positioning. The second div would show up over the first, because that's just how DOM renders.
As #will stated in his comment, adding a z-index is probably the best route to take here.
This cause because you giving to .wrap class overflow:hidden; so if you removed it the submenu will appear, Or if you add some content after .header the menu also will appear in this case
Change the z-index to z-index 1 for the menu and z-index 0 for the rest of the page. I think that that will work...

Center number with 1 and 2 digit

I have a shape which is a heart and I have a number inside. The problem is that I can have a number with 1 digit and a number with 2 digit and I am not able to center them into the heart.
https://jsfiddle.net/b7ggddqy/
.description{
position:relative;
height:100px;
}
.heart{
z-index:-500;
position: absolute;
top:70%;
right:20%;
width: 30px;
height: 30px;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
background-color: #BF4139;
}
.heart:before,
.heart:after{
position: absolute;
width: 30px;
height: 30px;
content: '';
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-o-border-radius: 50%;
border-radius: 50%;
background-color: #BF4139;
}
.heart:before{
bottom: 0px;
left: -15px;
}
.heart:after{
top: -15px;
right: 0px;
}
.heart p{
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
position:absolute;
z-index: 800;
left:10px;
top:-15px;
font-size:18px;
color:white;}
<div class="description">
<div class="heart">
<p>11</p>
</div>
</div>
<div class="description">
<div class="heart">
<p>3</p>
</div>
</div>
Just give a width to the paragraph and text-align:center
.heart p {
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
position:absolute;
z-index: 800;
left:3px;
top:0px;
font-size:18px;
color:white;
width:20px;
text-align:center;
}
Demo: https://jsfiddle.net/lotusgodkk/b7ggddqy/3/
Set p width to 100% and text-align:center.
Is this what you are looking for?
.heart p{
position:absolute;
text-align:center;
width:20px;
margin-left:-13px;
}
JSFiddle

Vertically center text on page

I'm having trouble to get a div (or the text inside) to get on the vertical center. Normally I have no trouble getting a div to be a certain percentage from the top of a page, but in some weird way, the % part gets completely ignored.
Here's a Fiddle
It's a very dumbed down version of my project, but it still screws up with the margin-top.
The result I'm aiming for is having the big text in the vertical middle of the page at all times. I have a feeling I'm actually approaching this completely wrong.
HTML
<div class="col-md-12 top-text">
<span class="top-title">Billetten <br /> Tjekliste</span>
</div>
CSS
.top-text {
text-align: center;
color: #000;
height: 10px;
margin-top:50%;
}
span.top-title {
font-family: 'art', helvetica, arial, sans-serif;
font-size: 180px;
line-height: 1em;
display: inline-block;
-webkit-transform: rotate(-10deg) skew(-10deg, 0);
-moz-transform: rotate(-10deg) skew(-10deg, 0);
-ms-transform: rotate(-10deg) skew(-10deg, 0);
-o-transform: rotate(-10deg) skew(-10deg, 0);
transform: rotate(-10deg) skew(-10deg, 0);
}
What I usually do to center stuff vertically, is set their position to absolute, give it a top value of 50% and then drag them up again by translating them with a negative 50% (referred to their own width).
Here's a fiddle: http://jsfiddle.net/y1muc7gr/1/
span.top-title {
font-family: 'art', helvetica, arial, sans-serif;
font-size: 180px;
line-height: 1em;
display: block;
position: absolute;
top: 50%;
width: 100%;
-webkit-transform-origin: 50% 50%;
-moz-transform-origin: 50% 50%;
-o-transform-origin: 50% 50%;
transform-origin: 50% 50%;
-webkit-transform: rotate(-10deg) skew(-10deg, 0) translateY(-50%);
-moz-transform: rotate(-10deg) skew(-10deg, 0) translateY(-50%);
-ms-transform: rotate(-10deg) skew(-10deg, 0) translateY(-50%);
-o-transform: rotate(-10deg) skew(-10deg, 0) translateY(-50%);
transform: rotate(-10deg) skew(-10deg, 0) translateY(-50%);
}
You are forgetting to minus the half text's height.
http://jsfiddle.net/y1muc7gr/2/
.top-text {
text-align: center;
color: #000;
height: 10px;
margin-top:-180px;
position: absolute;
top : 50%;
}
is that what you want?
i have make this jsfiddle
add position:relative in top-title
and bottom:200px; change it according to your desired position
span.top-title {
position:relative;
font-family: 'art', helvetica, arial, sans-serif;
font-size: 180px;
line-height: 1em;
display: inline-block;
-webkit-transform: rotate(-10deg) skew(-10deg, 0);
-moz-transform: rotate(-10deg) skew(-10deg, 0);
-ms-transform: rotate(-10deg) skew(-10deg, 0);
-o-transform: rotate(-10deg) skew(-10deg, 0);
transform: rotate(-10deg) skew(-10deg, 0);
bottom:200px;
}
http://jsfiddle.net/y1muc7gr/5/
jsfiddle example
setting the container with table-cell you can give it the vertical align properties to center the text inside.
.top-text {
text-align: center;
color: #000;
height: 600px;
display: table-cell;
vertical-align: middle;
}
the only problem is that you should have a fixed height container.

How to align a label vertically(270degree)?

I want to align a text vertically(That is 270 degree) and in the vertical middle of an image. This is what i actually want
I tried with CSS 'transform' property but its not working for me. Here i tried the code . And the HTML and CSS code i tried is
HTML :
<div id="img-container">
<label id="lblConfidence">Confidence</label>
<label id="lblHigh">High</label>
<div id="image"></div>
<label id="lblLow">Low</label>
</div>
CSS :
#img-container{
margin: 0 auto;
padding:0;
}
#image{
border:5px solid red;
margin-left:50px;
width:10px;
height:100px;
}
#lblConfidence{
vertical-align:middle;
transform:rotate(270deg) ;
-ms-transform:rotate(270deg) ; /* IE 9 */
-transform:rotate(270deg) ; /* Opera, Chrome, and Safari */
}
#lblLow{
margin-left:48px;
}
#lblHigh{
margin-left:48px;
}
Here's a solution that relies on pseudo-elements and thus uses minimal markup: http://jsfiddle.net/C49q7/1/. A particular emphasis has been placed on the alignment of elements. The #image element can be moved anywhere. The labels follow it precisely.
HTML:
<div id="image"><span></span></div>
CSS:
#image {
border:5px solid red;
width:100px;
height:20px;
text-align: center;
box-sizing: border-box;
position: relative;
font-family: Arial, Helvetica, Sans-Serif;
font-size: 12px;
-webkit-transform: rotate(-90deg);
transform: rotate(-90deg);
margin-top: 100px;
}
#image:before {
content: "Conidence";
position: absolute;
top: -24px;
left: 0;
right: 0;
text-align: center;
}
#image > span:before {
content: "High";
position: absolute;
right: -25px;
font-size: 10px;
top: 50%;
-webkit-transform: translateY(-50%) rotate(90deg);
transform: translateY(-50%) rotate(90deg);
}
#image > span:after {
content: "Low";
position: absolute;
left: -25px;
font-size: 10px;
top: 50%;
-webkit-transform: translateY(-50%) rotate(90deg);
transform: translateY(-50%) rotate(90deg);
}
add css to container.
#img-container {
position: relative;
}
add css to label.
#lblConfidence {
position: absolute;
top: 50%; -moz-transform:
rotate(270deg);
-webkit-transform: rotate(270deg);
-o-transform: rotate(270deg);
-ms-transform: rotate(270deg);
transform: rotate(270deg);
}
Here only given a style for align the label 50%. But it is depending on the length of the label. if this label is dynamic, please use a javascript to set the " top: 50%" style. and change the value relatively to the length of label.
Please replace lable with div and use below CSS for lblConfidence :
#lblConfidence
{
transform: rotate(-90deg);
-webkit-transform: rotate(-90deg); /* Safari/Chrome */
-moz-transform: rotate(-90deg); /* Firefox */
-o-transform: rotate(-90deg); /* Opera */
-ms-transform: rotate(-90deg); /* IE 9 */
writing-mode: tb-rl; /* IE 8 */
filter: flipv fliph; /* IE 8 */
margin-top: 100px;
width: 200px;
text-align: center;
height: 50px;
background:#ccc;
}
you can refer this solution : http://jsbin.com/joqofu/3
<div class="container">
<div class="left"><label>Confidence</label></div>
<div class="right">
<label id="lblHigh">High</label>
<div id="image"></div>
<label id="lblLow">Low</label>
</div>
</div>
and css
.container{
position:relative;
}
#image{
border:5px solid red;
width:10px;
height:100px;
}
.left {
position:absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
display:block;
height:120px;
width:100px;
text-align:left;
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}
.right{
margin-left:10px;
float:left;
text-align:left;
}