Align Image on Left Side of Menu CSS - html

I am trying to create a menu that has the image on the left and a menu on the right. But can't get the menu to style correctly. Currently, the image is on the top and menu is underneath it. Any suggestions?
Thanks!
Code in my common menu:
<div class = "firstDiv">
<img class = "myImage" src="font.jpg">
<div class = "secondDiv">
<nav>
<ul>
<li>Home</li>
<li>Page 1</li>
<li>Page 2</li>
<li>Page 3</li>
<li>Page 4</li>
<li>Page 5</li>
<li>Page 6</li>
</ul>
</nav>
</div>
</div>
CSS Sheet:
nav{
display: block;
width: 100%;
overflow: hidden;
text-align: center;
}
nav ul {
padding: .7em;
list-style: none;
background: #2f2b23;
box-shadow: 0 1px 0 rgba(255,255,255,.5), 0 2px 1px rgba(0,0,0,.3) inset;
border: 3px solid black;
/* added*/
display: inline-block;
}
nav li {
float:left;
}
nav a {
float:left;
padding: .8em .7em;
text-decoration: none;
color: black;
text-shadow: 0 1px 0 rgba(255,255,255,.5);
font: bold 1.1em/1 'trebuchet MS', Arial, Helvetica;
letter-spacing: 1px;
text-transform: uppercase;
border-width: 1px;
border-style: solid;
border-color: #black #BF7530;
background: #BF4630;
}
nav a:hover, nav a:focus {
outline: 0;
color: #black;
text-shadow: 0 1px 0 rgba(0,0,0,.2);
background: #FFDB73;
}
nav a:active {
box-shadow: 0 0 2px 2px rgba(0,0,0,.3) inset;
}
nav li:first-child a {
border-left: 0;
border-radius: 4px 0 0 4px;
}
nav li:last-child a {
border-right: 0;
border-radius: 0 4px 4px 0;
}
.firstDiv{
margin: 0 auto;
background: #a4d25d;
padding-top: 5px;
padding-bottom: 5px;
padding-left: 10px;
padding-right: 10px;
border: 5px solid black;
width:1140px;
height: 362px;
}
.myImage {float:left; border: 5px solid black; margin:5px;}
.secondDiv{
border-spacing: 15px;
border: 4px solid black;
background-color: #FF8700;
margin: 0 auto;
}

Assuming that there is enough room for your image and menu (you didn't specify the image size) you just need to float .secondDiv
Example
.secondDiv{
float: left;
}

I believe you want to achieve similar like this demo does but you are complicating your design by not using right css and html markup:
html:
<header class="clearfix">
<div class="firstDiv">
<img class="myImage" src="font.jpg">
</div>
<div class="secondDiv">
<nav>
<ul>
<li>Home
</li>
<li>Page 1
</li>
</ul>
</nav>
</div>
</header>
CSS:
.firstDiv {
border: 5px solid black;
width:100px;
height: 110px;
float:left;
}
header{
padding: 5px;
background: #999;
}
.secondDiv {
border-spacing: 15px;
border: 4px solid black;
background-color: #FF8700;
float:left;
}
.clearfix:before,
.clearfix:after {
content: " "; /* 1 */
display: table; /* 2 */
}
.clearfix:after {
clear: both;
}
Feel free to add your color styles again.

Related

Basic HTML help needed

I simply want the nav bar to stretch to full height.
i'm quite new to html,css and have little knowledge about it. have tried almost every solution on the internet but still nothing.below is the styling and html code.I gave all the parent containers full height.Don't know what's causing the problem. I picked the style up from the internet and understand what most of it does.I don't
body,
html {
height: 100vh;
}
div {
overflow: hidden;
height: 100%;
position: relative;
background-color: aqua;
}
nav {
display: block;
text-align: center;
height: 100vh !important;
float: left;
position: absolute;
}
nav ul {
margin: 0;
padding: 0;
list-style: none;
height: unset !important;
}
.nav a {
display: block;
background: #111;
color: #fff;
text-decoration: none;
padding: 0.8em 1.8em;
text-transform: uppercase;
font-size: 80%;
letter-spacing: 2px;
text-shadow: 0 -1px 0 #000;
position: relative;
}
.nav {
vertical-align: top;
display: inline-block;
box-shadow: 1px -1px -1px 1px #000, -1px 1px -1px 1px #fff, 0 0 6px 3px #fff;
border-radius: 6px;
height: 100vh !important;
}
.nav li {
position: relative;
}
.nav>li {
float: left;
border-bottom: 4px #aaa solid;
margin-right: 1px;
}
.nav>li>a {
margin-bottom: 1px;
box-shadow: inset 0 2em .33em -0.5em #555;
}
.nav>li:hover,
.nav>li:hover>a {
border-bottom-color: orange;
}
.nav li:hover>a {
color: orange;
}
.nav>li:first-child {
border-radius: 4px 0 0 4px;
}
.nav>li:first-child>a {
border-radius: 4px 0 0 0;
}
.nav>li:last-child {
border-radius: 0 0 4px 0;
margin-right: 0;
}
.nav>li:last-child>a {
border-radius: 0 4px 0 0;
}
.nav li li a {
margin-top: 1px;
}
.nav li a:first-child:nth-last-child(2):before {
content: "";
position: absolute;
height: 0;
width: 0;
border: 5px solid transparent;
top: 50%;
right: 5px;
}
/* submenu positioning*/
.nav ul {
position: absolute;
white-space: nowrap;
border-bottom: 5px solid orange;
z-index: 1;
left: -99999em;
}
.nav>li:hover>ul {
left: auto;
margin-top: 5px;
min-width: 100%;
}
.nav>li li:hover>ul {
left: 100%;
margin-left: 1px;
top: -1px;
}
/* arrow hover styling */
.nav>li>a:first-child:nth-last-child(2):before {
border-top-color: #aaa;
}
.nav>li:hover>a:first-child:nth-last-child(2):before {
border: 5px solid transparent;
border-bottom-color: orange;
margin-top: -5px
}
.nav li li>a:first-child:nth-last-child(2):before {
border-left-color: #aaa;
margin-top: -5px
}
.nav li li:hover>a:first-child:nth-last-child(2):before {
border: 5px solid transparent;
border-right-color: orange;
right: 10px;
}
<div>
<nav>
<ul class="nav">
<li>About</li>
<li>
Portfolio
<ul>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
</ul>
</li>
<li>
Resume
<ul>
<li>item a lonng submenu</li>
<li>
item
<ul>
<li>Ray</li>
<li>Veronica</li>
<li>Bushy</li>
<li>Havoc</li>
</ul>
</li>
<li>item</li>
<li>item</li>
</ul>
</li>
<li>Download</li>
<li>
Rants
<ul>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
</ul>
</li>
<li>Contact</li>
</ul>
</nav>
</div>
why would you want to set the max height oft the nav element to 100vh? If you want it to use the full width you need to set the width: 100vw; vw = "Relative to 1% of the width of the viewport" and vh is the height.
a simple bar would be like:
<body>
<nav></nav>
</body>
<script>
body { padding: 0; margin: 0}
nav { width: 100vw;height: 50px;background-color: blue;position: fixed;top: 0}
</script>

Position of dropdown menu

I can't figure out how to position a dropdown menu below the list item that activates it. Right now each dropdown menu is placed independently.
ul{
display:inline-block;
list-style:none;
text-align:center;
width: 100%;
margin:0 auto;
}
ul li
{
display:inline;
padding:10px;
background-color:black;
color:white;
}
#listaUgn
{
display:block;
position:absolute;
}
#listaUgn li
{
display:block;
padding:10px;
background-color:black;
color:white;
max-width: 100px;
}
<div class="izborSrednji">
<ul id="listaSrednja">
<li class="izborLinije">Programiranje I</li>
<li class="izborLinije">WRD</li>
<li class="izborLinije" >Klikni za jos
<ul id="listaUgn" >
<li class="izborLinijeUg">Programiranje I</li>
<li class="izborLinijeUg">WRD</li>
<li class="izborLinijeUg">PSR</li>
<li class="izborLinijeUg">SP</li>
</ul>
</li>
<li class="izborLinije">SP</li>
</ul>
</div>
If you add position: relative to the dropdown element's parent, then the dropdown will be positioned absolutely, relative to it's parent element.
For example:
ul{
display:inline-block;
list-style:none;
text-align:center;
width: 100%;
margin:0 auto;
}
ul li
{
display:inline;
padding:10px;
background-color:black;
color:white;
position: relative;
}
ul li:hover #listaUgn {
display: block;
}
#listaUgn
{
display:none;
position:absolute;
padding: 0;
left: 0;
}
#listaUgn li
{
display:block;
padding:10px;
background-color:black;
color:white;
max-width: 100px;
}
<div class="izborSrednji">
<ul id="listaSrednja">
<li class="izborLinije">Programiranje I</li>
<li class="izborLinije">WRD</li>
<li class="izborLinije" >Klikni za jos
<ul id="listaUgn" >
<li class="izborLinijeUg">Programiranje I</li>
<li class="izborLinijeUg">WRD</li>
<li class="izborLinijeUg">PSR</li>
<li class="izborLinijeUg">SP</li>
</ul>
</li>
<li class="izborLinije">SP</li>
</ul>
</div>
this site can be a good reference for you: https://css-tricks.com/targetting-menu-elements-submenus-navigation-bar/
Update:
nav {
display: block;
text-align: center;
}
nav ul {
margin: 0;
padding: 0;
list-style: none;
}
.nav a {
display: block;
background: #111;
color: #fff;
text-decoration: none;
padding: 0.8em 1.8em;
text-transform: uppercase;
font-size: 80%;
letter-spacing: 2px;
text-shadow: 0 -1px 0 #000;
position: relative;
}
.nav {
vertical-align: top;
display: inline-block;
box-shadow: 1px -1px -1px 1px #000, -1px 1px -1px 1px #fff, 0 0 6px 3px #fff;
border-radius: 6px;
}
.nav li {
position: relative;
}
.nav>li {
float: left;
border-bottom: 4px #aaa solid;
margin-right: 1px;
}
.nav>li>a {
margin-bottom: 1px;
box-shadow: inset 0 2em .33em -0.5em #555;
}
.nav>li:hover,
.nav>li:hover>a {
border-bottom-color: orange;
}
.nav li:hover>a {
color: orange;
}
.nav>li:first-child {
border-radius: 4px 0 0 4px;
}
.nav>li:first-child>a {
border-radius: 4px 0 0 0;
}
.nav>li:last-child {
border-radius: 0 0 4px 0;
margin-right: 0;
}
.nav>li:last-child>a {
border-radius: 0 4px 0 0;
}
.nav li li a {
margin-top: 1px;
}
.nav li a:first-child:nth-last-child(2):before {
content: "";
position: absolute;
height: 0;
width: 0;
border: 5px solid transparent;
top: 50%;
right: 5px;
}
/* submenu positioning*/
.nav ul {
position: absolute;
white-space: nowrap;
border-bottom: 5px solid orange;
z-index: 1;
left: -99999em;
}
.nav>li:hover>ul {
left: auto;
margin-top: 5px;
min-width: 100%;
}
.nav>li li:hover>ul {
left: 100%;
margin-left: 1px;
top: -1px;
}
/* arrow hover styling */
.nav>li>a:first-child:nth-last-child(2):before {
border-top-color: #aaa;
}
.nav>li:hover>a:first-child:nth-last-child(2):before {
border: 5px solid transparent;
border-bottom-color: orange;
margin-top: -5px
}
.nav li li>a:first-child:nth-last-child(2):before {
border-left-color: #aaa;
margin-top: -5px
}
.nav li li:hover>a:first-child:nth-last-child(2):before {
border: 5px solid transparent;
border-right-color: orange;
right: 10px;
}
<html>
<head>
<title>test</title>
</head>
<body>
<nav>
<ul class="nav">
<li>About</li>
<li>Portfolio
<ul>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
</ul>
</li>
<li>Resume
<ul>
<li>item a lonng submenu</li>
<li>item
<ul>
<li>Ray</li>
<li>Veronica</li>
<li>Bushy</li>
<li>Havoc</li>
</ul>
</li>
<li>item</li>
<li>item</li>
</ul>
</li>
<li>Download</li>
<li>Rants
<ul>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
</ul>
</li>
<li>Contact</li>
</ul>
</nav>
</body>
</html>

Weird extra space in the bottom of a div

I'm very confused. #top div has a weird extra space in the bottom of it, setting height of course works, but the problem is that I want to add back compatibility, so if a custom font doesn't load, it uses Verdana, which is wider, so it takes more place, and if the navbar gets bigger, it won't properly fit in the #top
The code is:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Sidebar test</title>
</head>
<style>
div {
border: 1px solid #999;
}
body { font-family: Verdana, sans-serif; font-size: 17px; }
#navbar {
border-radius: 6px;
overflow: hidden;
display: inline-block;
margin: 0;
padding: 0;
}
#navbar ul {
list-style-type: none;
padding: 0;
margin: 0;
float: left;
}
#navbar ul li {
display: inline;
color: black;
text-decoration: none;
}
#navbar ul a {
float: left;
padding: 10px 18px;
text-decoration: none;
color: black;
background-color: #f1f1f1;
-webkit-transition: background-color 0.02s;
transition: background-color 0.02s;
}
#navbar ul a:hover {
background-color: #e6e6e6;
}
#navbar ul a:selected {
background-color: #c7c7c7;
}
#content {
padding: 35px 50px 60px 50px;
}
#container {
width: 900px;
margin: 20px auto;
border-radius: 5px;
box-shadow: 0px 2px 2px 1px #d5d5d5;
}
</style>
<body>
<div id="container">
<div id="top">
<img alt="logo" height="27px" src="http://static.tumblr.com/zicio7x/Tphntwm0j/yvemiro.svg">
<div id="navbar">
<ul>
<li>Link 1</li>
<li>Link 2</li>
<li>Link 3</li>
<li>Link 4</li>
</ul>
</div>
</div>
<div id="content">
Content
</div>
</div>
</body>
</html>
By default, inline elements are vertically aligned to the baseline. Now the navbar contains an image and the menu bar next to each other, so it has to shift these up and down a bit in order to align them.
Solution: give these things vertical-align:middle (or any other value that doesn't require shifting the blocks out of center).
div {
border: 1px solid #999;
}
body {
font-family: Verdana, sans-serif;
font-size: 17px;
}
#top > a > img { /* this was added */
vertical-align: middle;
}
#navbar {
border-radius: 6px;
overflow: hidden;
display: inline-block;
margin: 0;
padding: 0;
vertical-align: middle; /* and this */
}
#navbar ul {
list-style-type: none;
padding: 0;
margin: 0;
float: left;
}
#navbar ul li {
display: inline;
color: black;
text-decoration: none;
}
#navbar ul a {
float: left;
padding: 10px 18px;
text-decoration: none;
color: black;
background-color: #f1f1f1;
-webkit-transition: background-color 0.02s;
transition: background-color 0.02s;
}
#navbar ul a:hover {
background-color: #e6e6e6;
}
#navbar ul a:selected {
background-color: #c7c7c7;
}
#content {
padding: 35px 50px 60px 50px;
}
#container {
width: 900px;
margin: 20px auto;
border-radius: 5px;
box-shadow: 0px 2px 2px 1px #d5d5d5;
}
<div id="container">
<div id="top">
<a href="#">
<img alt="logo" height="27" src="http://static.tumblr.com/zicio7x/Tphntwm0j/yvemiro.svg">
</a>
<div id="navbar">
<ul>
<li>Link 1
</li>
<li>Link 2
</li>
<li>Link 3
</li>
<li>Link 4
</li>
</ul>
</div>
</div>
<div id="content">
Content
</div>
</div>

Displaced elements of navigation menu

I try to create a horizontal navigation, but there are some problems:
The first element is displaced
Is there a better way to place the Text centered below the icon. Now I did that just with a . And how should I use the optional arrow-down-icon - here I used the span-tag. I think the html-markup for that is not the best.
And the second-level ul (=subelements) isn't shown correctly and doesn't enclose the subelements.
JSFiddle: http://jsfiddle.net/pqubgt2d/
nav {
background-color: #f2f2f2;
padding: .3em 0;
border-radius: 7px;
}
nav ul {
list-style: none;
height: 2.5em;
padding: .25em;
color: #555;
margin: 0;
}
nav ul li {
font-family: "Source Sans Pro";
font-size: .5em;
margin: .5em 0;
display: inline-block;
width: 4em;
text-align: center;
}
nav ul li i {
font-size: 3em !important;
}
nav ul li ul {
font-size: 3em;
background-color: #f2f2f2;
}
.button-arrow-down {
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid #B4B4B4;
margin: 0 auto;
position: relative;
bottom: -7px;
}
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet"/>
<nav>
<ul>
<li><i class="fa fa-file-o"></i><br>New</li>
<li>
<i class="fa fa-floppy-o"></i><br>
Save<br>
<span class="button-arrow-down"></span>
<ul>
<li>Subelement 1</li>
<li>Subelement 2</li>
<li>Subelement 3</li>
</ul>
</li>
</ul>
</nav>
nav {
background-color: #f2f2f2;
padding: .3em 0;
border-radius: 7px;
height: 2.5em;
}
nav > ul {
list-style: none;
padding: .25em;
color: #555;
margin: 0;
}
nav > ul > li {
font-family:"Source Sans Pro";
font-size: .5em;
margin: .8em;
text-align: center;
float:left;
width:4em;
}
nav > ul > li i {
font-size: 2.8em !important;
}
nav > ul > li>ul {
font-size: 3em;
background-color: #f2f2f2;
}
.button-arrow-down {
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid #B4B4B4;
margin: 0 auto;
position: relative;
bottom: -7px;
}
.drop {
float:left;
display:none;
}
li:hover > .drop {
display:block;
}
.drop {
list-style-type:none;
font-family:"Source Sans Pro";
font-size: 20px;
}
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet"/>
<nav>
<ul>
<li class="item"><i class="fa fa-file-o"></i>New</li>
<li class="item"><i class="fa fa-floppy-o"></i>Save<span class="button-arrow-down"></span>
<ul class="drop">
<li>Subelement 1</li>
<li>Subelement 2</li>
<li>Subelement 3</li>
</ul>
</li>
</ul>
</nav>
Try this. This looks more like you want it. If it helps +1.
Edit. I have updated the answer due to your comment.

How to set width and text-align for button with CSS

There are my problems:
The width's buttons are not the same as (1 & 2) in my image below.
Shorten the distance between Yearly, Monthly and Weekly as (3)
Please tell me how to correct this.
Demo
HTML:
<!-- Make a menu with Yearly, Monthly and Weekly -->
<ul id="out_per_chart">
<li>
<div class="yearly">
<div class="title">2014</div>
<div class="container1">
<ul class="sub-menu1">
<li class="year"><a class="_link" href="/Lists/ChartIndex.aspx?week=1&month=1&year=2014">Yearly</a>
</li>
<li>
<div class="monthly">
<div class="title">Monthly</div>
<div class="container2">
<ul class="sub-menu2"></ul>
</div>
</div>
</li>
<li>
<div class="weekly">
<div class="title">Weekly</div>
<div class="container3">
<ul class="sub-menu3"></ul>
</div>
</div>
</li>
</ul>
</div>
</div>
</li>
</ul>
CSS:
#out_per_chart li {
list-style-type: none;
}
#out_per_chart .title {
border: 2px solid #2676ac;
padding: 10px 30px;
width: 40px;
color: #2676ac !important;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
margin-bottom: 10px;
/* added */
}
#out_per_chart .title:hover {
border: 2px solid #259add;
cursor: default !important;
background: #259add;
color: #FFF !important;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
text-decoration: none !important;
}
.container1 {
position: absolute;
padding-left: -10px;
padding-top: -5px;
display: none;
}
.container2 {
position: absolute;
margin-top: -15px;
margin-left: 50px;
}
.container3 {
position: absolute;
margin-top: -15px;
margin-left: 50px;
}
._link {
text-decoration: none;
border: 2px solid #2676ac;
padding: 7px 20px 7px 20px;
width: 30px;
color: #2676ac !important;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
._link:hover {
text-decoration: underline;
cursor: pointer;
border: 2px solid #259add;
background: #259add;
color: #FFF !important;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
#out_per_chart li {
width: 300px;
height: 30px;
margin-bottom: 25px;
}
#out_per_chart li.week_num, #out_per_chart li.month_num {
margin-left: 60px;
margin-top: -25px;
margin-bottom: 25px;
}
#out_per_chart li.year {
margin: 0 0 5px 0;
}
Your HTML markup is inconsistent, which won't make things easier. The menu for the first list item goes:
<li> > <a> then the child list elements have:
<li> > <div> > <div> > <ul>
The simplest way to achieve a consistent nested list/menu is something like this:
<ul id="main-list">
<li>Top level list item 1</a>
<ul>
<li>Second level list
<ul>
<li>Third level list item</li>
</ul>
</li>
</ul>
</li>
<li>Top level list item 2</a>
<li>Top level list item 3</a>
</ul>
Each menu is a child of the parent list item. Here's a Fiddle example of it in action.
It also addresses the width problem you're having.
By setting the <a> tags in the Fiddle example as block level, you can manipulate the width. By default, <a> tags are an inline element, and do not respond to width and height properties unless display:block is assigned.
If you absolutely must have an anchor link in some list items and not in others, then you'd need to set the widths on the parent element, in this case, the <li>
Structure Your HTML
http://jsfiddle.net/ug8rU/
Add your JS
http://jsfiddle.net/AywLf/
Add your CSS
http://jsfiddle.net/9v7tC/
here is the full code:
HTML
<ul class="record">
<li class="main-year">
2014
<ul class="main-menu">
<li class="cat-menu yearly">
Yearly
</li>
<li class="cat-menu monthly">
Monthly
<ul class="menu month-menu">
<li class="">Month 1</li>
<li class="">Month 2</li>
<li class="">Month 3</li>
</ul>
</li>
<li class="cat-menu weekly">
Weekly
<ul class="menu week-menu">
<li class="">Week 1</li>
<li class="">Week 2</li>
<li class="">Week 3</li>
</ul>
</li>
</ul>
</li>
</ul>
CSS
.record{
width:300px;
}
.main-year{
width:300px;
}
.menu{
position:relative;
left:60px;
top:0px;
}
.menu{
top:-25px;
z-index:100;
}
.record li{
list-style:none;
height:25px;
margin:1px 3px;
}
.record a{
text-decoration:none;
border:2px solid #2676ac;
color: #2676ac !important;
width:90px;
padding:2px;
display:block;
text-align:center;
border-radius:5px;
}
JS
$(document).ready(function () {
$('.main-menu').hide();
$('.menu').hide();
$(".main-year").hover(function () {
$(this).children('.main-menu').show();
},
function () {
$(this).children('.main-menu').hide();
});
$(".monthly").hover(function () {
$(this).children('.month-menu').show();
},
function () {
$(this).children('.month-menu').hide();
});
$(".weekly").hover(function () {
$(this).children('.week-menu').show();
},
function () {
$(this).children('.week-menu').hide();
});
});
// ok test you this css code
#out_per_chart li {
list-style-type: none;
}
#out_per_chart .title {
border: 2px solid #2676AC;
border-radius: 5px;
color: #2676AC !important;
height: 40px;
line-height: 40px;
text-align: center;
width: 100px;
}
#out_per_chart .title:hover,
#out_per_chart li a:hover {
border: 2px solid #259add;
cursor: default !important;
background: #259add;
color: #FFF !important;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
text-decoration: none !important;
}
.sub-menu1{
padding:0;
margin:0;
}
.sub-menu1 li > a{
border: 2px solid #2676AC;
border-radius: 5px;
color: #2676AC !important;
height: 40px;
line-height: 40px;
text-align: center;
width: 100px;
display:block;
}
.container1 {
position: absolute;
padding-left: -10px;
padding-top: -5px;
display: none;
top:60px;
}
.container2 {
left: 45px;
position: absolute;
top: 43px;
}
.container3 {
position: absolute;
}
._link {
text-decoration: none;
border: 2px solid #2676ac;
color: #2676ac !important;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
._link:hover {
text-decoration: underline;
cursor: pointer;
border: 2px solid #259add;
background: #259add;
color: #FFF !important;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
#out_per_chart li.week_num, #out_per_chart li.month_num {
margin-left: 60px;
}
Give a class for each box and have .class{width:"70px";margin-top:"3px";} in your css.
you can give a percent instead of giving it in px
.title
{
width: 80px;
text-align: center;
}
and the problem solved. If text doesn't align center between top and bottom you can
padding-top: 10px;
padding-bottom: 10px;
now you can see your text in center.
Sorry for bad english.