I am trying to divide a caption area into 2 div each 50%, align the text to left on the left div and align the text to right on the other one.
I cannot quite get the result I want, how can I fix this?
.tcaption {
width: 100%;
background-color: #cee7ff;
}
.tcaption-left-part {
color: blue;
width: 50%;
float: left;
text-align: left;
padding: 5px 0 5px 0;
font-weight: bold;
}
.tcaption-right-part {
color: blue;
width: 50%;
float: right;
text-align: right;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet"/>
<div class="form-wrapper">
<table class="ticket-table">
<caption class="tcaption">
<div class="tcaption-left-part">
Ticket Details
</div>
<div class="tcaption-right-part">
<a class=" btn btn-default " href="{% url 'ticket_edit' ticket.pk %} "><i class="fa fa-edit fa-2x "></i></a>
</div>
</caption>
<tbody>
<tr>
<td>Ticket Number:</td>
<td>{{ticket.pk}}</td>
</tr>
</tbody>
</table>
</div>
If you display these as a table-cells (using the display:table-cell css) it'd make things easier. I didn't swap in a blue colour, but focused on your position problem.
You can probably afford to make the columns different widths if what you want is one column to be far-left aligned and the other to be aligned to the far right (or just have both close to 100% - not quite 100 cos of padding/margins). But I'll leave it for you to mess with. I put in span tags around the Ticket Details for better css control.
.ticket-table, .tcaption {
width: 100%;
background-color: var(--myBlue3);
}
.tcaption .left-part,
.tcaption .right-part {
display: table-cell;
width: 50vh;
color: var(--myBlue6);
vertical-align:top;
}
.left-part, .left-part span {
text-align: left;
padding: 5px 0 5px 0;
font-weight: bold;
float:left;
}
.right-part, .right-part a {
text-align: right;
float: right;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet"/>
<div class="form-wrapper">
<table class="ticket-table">
<caption class="tcaption">
<div class="left-part">
<span>Ticket Details</span>
</div>
<div class="right-part">
<i class="fa fa-edit fa-2x">Ticket.pk</i>
</div>
</caption>
<tbody>
<tr>
<td>Ticket Number:</td>
<td class="right-part">{{ticket.pk}}</td>
</tr>
</tbody>
</table>
</div>
That's because the <caption> is only as big as it's parent <table>. Increase the width of the <table> and you should get what you want.
.tcaption {
width: 100%;
background-color: #cee7ff;
}
table {
width: 100%;
}
.tcaption-left-part {
color: blue;
width: 50%;
float: left;
text-align: left;
font-weight: bold;
}
.tcaption-right-part {
color: blue;
width: 50%;
float: right;
text-align: right;
}
<div class="form-wrapper">
<table class="ticket-table">
<caption class="tcaption">
<div class="tcaption-left-part">
Ticket Details
</div>
<div class="tcaption-right-part">
<a class="btn btn-default"><i class="fa fa-edit fa-2x">Right Aligned Text</i></a>
</div>
</caption>
<tbody>
<tr>
<td>Ticket Number:</td>
<td>{{ticket.pk}}</td>
</tr>
</tbody>
</table>
</div>
Related
How can I make the second line be one line and not broken up as it is now?
And look like this:
I tried to use the display: table and table-cell but it makes no difference.
I never seem to get along with CSS.
css:
<style>
.column1 {
float: left;
width: 10%;
font-size: 350%;
}
.column2 {
float: left;
width: 10%;
font-size: 350%;
}
.column3 {
float: left;
width: 80%;
font-size: 350%;
}
</style>
html:
<div class="row" style="display: table">
<div class="column1" style="background-color:#ccc;" display: table-cell;>
<b>col1</b><br>
<div style="background-color:#FF0000;">32</div>
<div style="background-color:#00FF00;">33</div>
</div>
<div class="column2" style="background-color:#ccc;" display: table-cell;>
<b>col2</b><br>
<div style="background-color:#FF0000;">11:00</div>
<div style="background-color:#00FF00;">12:00</div>
</div>
<div class="column3" style="background-color:#ccc;" display: table-cell;>
<b>col3</b><br>
<div style="background-color:#FF0000;">This is some text That will overflow the div by a few words</div>
<div style="background-color:#00FF00;">Next line</div>
</div>
If you want to use "table CSS" you might aswell adjust the markup. I made an example here
Demo here
table {
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1px solid black;
text-align: left;
padding: 8px;
}
th {
background-color: white;
}
tr:nth-child(odd) {
background-color: #00FF00;
}
tr:nth-child(even) {
background-color: #FF0000;
}
<table>
<tr>
<th>col1</th>
<th>col2</th>
<th>col3</th>
</tr>
<tr>
<td>31</td>
<td>11:00</td>
<td>This is some text That will overflow the div by a few words</td>
</tr>
<tr>
<td>32</td>
<td>12:00</td>
<td>Next line</td>
</tr>
</table>
This is how I was able to achieve it. To achieve word wrap properly, we need to use display:table-row as well
CSS:
.column1 {
float: left;
width: 10%;
font-size: 350%; //100%
}
.column2 {
float: left;
width: 10%;
font-size: 350%; //100%
}
.column3 {
float: left;
width: 80%;
font-size: 350%; //100%
}
.row1 {
background-color:#ccc;
display: table-row;
}
.row2 {
display: table-row;
background-color:#FF0000;
}
.row3 {
display: table-row;
background-color:#00FF00;
}
HTML
<div style= "display: table;">
<div class= "row1">
<div class= "column1" style= "display:table-cell"><b>col1</b></div>
<div class= "column2" style= "display:table-cell"><b>col2</b></div>
<div class= "column3" style= "display:table-cell"><b>col3</b></div>
</div>
<div class= "row2">
<div class= "column1" style="display:table-cell">32</div>
<div class= "column2" style= "display:table-cell">11:00</div>
<div class= "column3" style= "display:table-cell">This is some text That will overflow the div by a few words</div>
</div>
<div class= "row3">
<div class= "column1" style= "display:table-cell">33</div>
<div class= "column2" style= "display:table-cell">12:00</div>
<div class= "column3" style="display:table-cell">Next line</div>
</div>
Demo Link: http://jsfiddle.net/5qc7adf9/1/show/
It will display properly only in full screen result window as font size is 350% here. To view it properly in result window of jsfiddle, we would need to reduce font-size.
I want to create layout like this:
Desktop
Mobile
but do not know how to achieve that. So far I have this:
<aside class="container-fluid" role="complementary">
<div class="modal-container ">
<div class="row">
<div class="col-xl-4 col-lg-4 col-md-4 col-sm-6 col-xs-12">
<h2>Name</h2>
<ul class="menu">
<li>Jack</li>
<li>John</li>
<li>James</li>
</ul>
</div>
<div class="col-xl-4 col-lg-4 col-md-4 col-sm-6 col-xs-12">
<h2>Surname</h2>
<ul class="menu">
<li>Sales</li>
<li>Admin</li>
<li>Sales</li>
</ul>
</div>
<div class="col-xl-4 col-lg-4 col-md-4 col-sm-12 col-xs-12">
<h2>Action</h2>
Connect
Connect
Connect
</div>
</div>
<table>
<tr>
<td>Jack</td>
<td>Sales</td>
</tr>
<tr>
<td>Connect</td>
</tr>
<tr>
<td>John</td>
<td>Admin</td>
</tr>
<tr>
<td>Connect</td>
</tr>
<tr>
<td>James</td>
<td>Sales</td>
</tr>
<tr>
<td>Connect</td>
</tr>
</table>
</div>
</aside>
What's the most sane way to achieve these layouts?
(Should it be table combined with flex? Is it ok to use BS grid for this?)
Your total bootstrap grid understanding here is wrong. Also I dont want to write the whole code for you - please understand the concept and implement the mobile layout.
Below is the grid correction for desktop, you have to add more bootstrap classes for making this more responsive.
You don't need tables for this, you can achieve both layouts completely with BS alone.
Run the below snippet, open it full-screen and resize your browser - you will notice the beauty of BS grid
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<aside class="container-fluid" role="complementary">
<div class="modal-container ">
<div class="row">
<div class="col-xs-12">
<h2 class='col-xs-4'> Name</h2>
<h2 class='col-xs-4'> Surname</h2>
<h2 class='col-xs-4'> Action</h2>
</div>
<div class="col-xs-12">
<span class='col-xs-4'>Jack</span>
<span class='col-xs-4'>Sales</span>
<input type="button" value='Connect' class='col-xs-4'/>
</div>
<div class="col-xs-12">
<span class='col-xs-4'>John</span>
<span class='col-xs-4'>Admin</span>
<input type="button" value='Connect' class='col-xs-4'/>
</div>
<div class="col-xs-12">
<span class='col-xs-4'>James</span>
<span class='col-xs-4'>Sales</span>
<input type="button" value='Connect' class='col-xs-4'/>
</div>
</div>
</div>
</aside>
Concept
Make <tr> into a flexbox on smaller screens
#media (max-width: 575.98px) {
.my-table tr {
display: flex;
flex-wrap: wrap;
}
.my-table tr>td:not(:last-child) {
flex: 1;
}
.my-table tr>td:last-child {
width: 100%;
}
}
It looks like
In total
body {
margin: 0;
}
header {
background: #00ADEE;
color: white;
height: 110px;
}
header h1 {
padding: 0.5rem;
margin: 0;
}
.my-table {
width: 50%;
margin-top: -50px;
margin-left: auto;
margin-right: auto;
background: white;
text-align: center;
border-collapse: separate;
border-spacing: 3rem 1.5rem;
border: 2px solid #E7E7E7;
}
.my-table th,
.my-table td {
padding: 0.5rem;
}
.my-table tr>td:last-child>a {
text-decoration: none;
display: block;
color: black;
padding: 0.5rem;
background: #E7E7E7;
}
#media (max-width: 575.98px) {
header h1 {
text-align: center
}
.my-table {
border-spacing: 1.5rem;
}
.my-table thead {
display: none;
}
.my-table tr {
display: flex;
flex-wrap: wrap;
text-align: center;
margin-bottom: 1.5rem;
}
.my-table tr>td:not(:last-child) {
flex: 1;
}
.my-table tr>td:last-child {
width: 100%;
}
}
<header>
<h1>Table Test</h1>
</header>
<table class="my-table">
<thead>
<th>Name</th>
<th>Surname</th>
<th>Action</th>
</thead>
<tbody>
<tr>
<td>Jack</td>
<td>Sales</td>
<td>Connect</td>
</tr>
<tr>
<td>John</td>
<td>Admin</td>
<td>Connect</td>
</tr>
<tr>
<td>James</td>
<td>Sales</td>
<td>Connect</td>
</tr>
</tbody>
</table>
(Change values according to your needs.)
With Bootstrap 3
Center table with offset. Use same concept as above.
body {
margin: 0;
}
header {
background: #00ADEE;
color: white;
height: 110px;
}
header h1 {
padding: 0.5rem;
margin: 0;
}
.my-table {
margin-top: -50px !important;
text-align: center;
background: white;
}
.my-table * {
border: none !important;
}
.my-table th {
text-align: center;
}
.my-table tr>td:last-child>a {
text-decoration: none;
display: block;
color: black;
background: #E7E7E7;
}
#media (max-width: 575.98px) {
header h1 {
text-align: center
}
.my-table thead {
display: none;
}
.my-table tr {
display: flex;
flex-wrap: wrap;
}
.my-table tr>td:not(:last-child) {
flex: 1;
}
.my-table tr>td:last-child {
width: 100%;
}
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<header>
<h1>Table Test</h1>
</header>
<div class="row">
<div class="col-xs-6 col-xs-offset-3 col-sm-6 col-sm-offset-3">
<table class="my-table table">
<thead>
<th>Name</th>
<th>Surname</th>
<th>Action</th>
</thead>
<tbody>
<tr>
<td>Jack</td>
<td>Sales</td>
<td>Connect</td>
</tr>
<tr>
<td>John</td>
<td>Admin</td>
<td>Connect</td>
</tr>
<tr>
<td>James</td>
<td>Sales</td>
<td>Connect</td>
</tr>
</tbody>
</table>
</div>
</div>
At the bottom of my page/view i got a white box that i can't remove. When i inspect elements there's no elements in that space (not even body or html)
I've tried to set body to height:100%, no paddings, margins etc but it made no difference.
Sorry if i've provided too little code, just shout if you need more.
Here's my CSS:
.header {
border: 0px;
margin: 0px;
padding: 0px;
padding-bottom: 10px;
background-color: black;
color: white;
display: block;
text-align: center;
}
h1 {
border: 0px;
margin: 0px;
padding: 20px;
}
.container-fluid {
height: auto;
border: 0px;
margin-left: auto;
margin-right: auto;
display: flex;
align-items: center;
justify-content: center;
background-color: black;
}
.btn btn-primary {
border: 20px;
}
.card {
align-items: center;
justify-content: center;
}
.card-body {
display: block;
padding: 0px;
}
.card-title > img {
margin-rigth: 5px;
}
.table {
font-size: 20px;
}
HTML:
#{
ViewData["Title"] = "Home Page";
}
<div class="header">
<h1>My Health Vision</h1>
<div class="col-md-3">
<button type="button" class="btn btn-primary btn-lg btn-block">Add new goal</button>
</div>
</div>
<div class="container-fluid">
<div class="card" style="width:400px">
<div class="card-body">
<h4 class="card-title"><img src="images/goal-icon.png" width="60" height="60" />My weigth goal</h4>
<table class="table">
<tbody>
<tr>
<th scope="row">Goal weigth</th>
<td>85</td>
</tr>
<tr>
<th scope="row">Deadline</th>
<td>2018-05-30</td>
</tr>
<tr>
<th scope="row">Current weight </th>
<td>90 <button type="button" class="btn btn-primary btn-sm">Update</button></td>
</tr>
<tr>
<th scope="row">Best weigth</th>
<td>87</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
Updated with HTML.
Instead of using:
height: 100%;
Use:
height: 100vh;
I want to basically have a table in my design where the size varies from 3 X 3 to 7 X 7 and need the full table to fit the small screens too.
So now going deeper, when the screen size is that of a mobile device I want the table to stretch full width, while on larger screens I need them to be in the center of the screen. Along with that in any screen size, the cells dimensions should be width = height, in other words a square.
How can I do this with CSS and TWITTER-BOOTSTRAP only?
P.S: I am new to bootstrap.
HTML
<div class="site-wrapper">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand"><span class="icon ion-arrow-left-c"></span> Back</a>
</div>
</div>
</nav>
<div class="container">
<table class="table table-bordered">
<tr>
<td data-cell="0"></td>
<td data-cell="1"></td>
<td data-cell="2"></td>
</tr>
<tr>
<td data-cell="3"></td>
<td data-cell="4"></td>
<td data-cell="5"></td>
</tr>
<tr>
<td data-cell="6"></td>
<td data-cell="7"></td>
<td data-cell="8"></td>
</tr>
</table>
</div>
</div>
CSS
body {
background-color: #fff;
color: #ffffff;
text-align: center;
margin: 0;
}
html, body {
height: 100%;
background-color: #333;
/*overflow: hidden;*/
}
a {
color: #ffffff;
}
a:hover, a:active {
color: #ffffff;
}
.site-wrapper {
width: 100%;
height: 100%;
min-height: 100%;
-webkit-box-shadow: inset 0 0 100px rgba(0,0,0,.5);
box-shadow: inset 0 0 100px rgba(0,0,0,.5);
border-top: 5px solid #5A332B;
background-color: #ccbb99 !important;
}
If I understand your issue then you should change table structure to div. Because you need square box for every device screen size. Also you need to write little bit of JavaScript or jQuery.
$(function(){
var newBoxHeight= $('#square-box .col-xs-4').outerWidth();
$('#square-box .col-xs-4').outerHeight(newBoxHeight);
});
.col-xs-4{
border: 2px solid #000000;
}
.col-xs-4:nth-child(2n+1){
background-color: #020202;
}
.col-xs-4:nth-child(2n+2){
background-color: #121212;
}
.center-content{
bottom: 0;
left: 0;
position: absolute;
right: 0;
top: 0;
}
.table-box,
.tbale-cell-box{
color: #ffffff;
font-size: 60px;
height: 100%;
width: 100%
}
.table-box{
display: table;
text-align: center;
}
.tbale-cell-box{
display: table-cell;
vertical-align: middle;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row" id="square-box">
<div class="col-xs-4 col-sm-4"><div class="center-content"><span class="table-box"><span class="tbale-cell-box">1</span></span></div></div>
<div class="col-xs-4"><div class="center-content"><span class="table-box"><span class="tbale-cell-box">2</span></span></div></div>
<div class="col-xs-4"><div class="center-content"><span class="table-box"><span class="tbale-cell-box">3</span></span></div></div>
<div class="col-xs-4"><div class="center-content"><span class="table-box"><span class="tbale-cell-box">4</span></span></div></div>
<div class="col-xs-4"><div class="center-content"><span class="table-box"><span class="tbale-cell-box">5</span></span></div></div>
<div class="col-xs-4"><div class="center-content"><span class="table-box"><span class="tbale-cell-box">6</span></span></div></div>
<div class="col-xs-4"><div class="center-content"><span class="table-box"><span class="tbale-cell-box">7</span></span></div></div>
<div class="col-xs-4"><div class="center-content"><span class="table-box"><span class="tbale-cell-box">8</span></span></div></div>
<div class="col-xs-4"><div class="center-content"><span class="table-box"><span class="tbale-cell-box">9</span></span></div></div>
</div>
</div>
Hope it will help.
Update: Just couldn't do the pure css version and powered with jQuery:
function setHeight() {
var myTable = $("#myTable");
myTable.height(myTable.width());
$( window ).resize(function() {
myTable.height(myTable.width());
});
}
setHeight();
body {
background-color: #fff;
color: #ffffff;
text-align: center;
margin: 0;
}
html, body {
height: 100%;
background-color: #333;
/*overflow: hidden;*/
}
a {
color: #ffffff;
}
a:hover, a:active {
color: #ffffff;
}
.site-wrapper {
width: 100%;
height: 100%;
min-height: 100%;
-webkit-box-shadow: inset 0 0 100px rgba(0,0,0,.5);
box-shadow: inset 0 0 100px rgba(0,0,0,.5);
border-top: 5px solid #5A332B;
background-color: #ccbb99 !important;
}
.container {
}
.table {
width: 50vw;
height: 50vw;
margin-left: 25%;
margin-top: 5%;
}
.table-bordered {
border: 1px solid black;
}
#media screen and (max-width: 750px) {
.table {
margin-left: 0;
margin-top: 0;
width: 100%;
height: 100%;
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="site-wrapper">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand"><span class="icon ion-arrow-left-c"></span> Back</a>
</div>
</div>
</nav>
<div class="container">
<table id="myTable" class="table table-bordered">
<tr>
<td data-cell="0">0</td>
<td data-cell="1">1</td>
<td data-cell="2">2</td>
</tr>
<tr>
<td data-cell="3">3</td>
<td data-cell="4">4</td>
<td data-cell="5">5</td>
</tr>
<tr>
<td data-cell="6">6</td>
<td data-cell="7">7</td>
<td data-cell="8">8</td>
</tr>
</table>
</div>
</div>
Picture of the white space between "header" and "content"
I just got back into web work and cannot figure this out! Theres a big gap between the header div and the content div that isn't present with the sidebar div and the code isn't too different for each one so thats why it confuses me. I don't know where the whitespace is coming from.
I took some stuff out of my code that wasn't relevant but let me know if theres something that isn't there.
<!-- Page Wrap -->
<div class="pagewrap">
<!-- Header -->
<div class="header">
<img src="images/Logo.jpg" width="530" height="180" alt=""/>
</div>
<!-- Header end -->
<!-- Sidebar -->
<div class="sidebartitle">
<center style="color: #FFFFFF">Specials</center>
</div>
<div class="sidebar">
<center>
<div class="page-popper">
</div>
<table width="187" height="196" border="0" align="center">
<tbody>
<tr>
<td><div class="buttonImageWrapper">
<img src="images/M-2.jpg" alt=""/>
</div></td>
<td>
Request an Appointment</td>
</tr>
<tr>
<td><div class="buttonImageWrapper">
<img src="images/M-2.jpg" alt=""/>
</div></td>
<td>Salon Menu</td>
</tr>
<tr>
<td><div class="buttonImageWrapper"><img src="images/M-2.jpg" alt=""/></div></td>
<td>Spa Menu</td>
</tr>
<tr>
<td><div class="buttonImageWrapper"><img src="images/M-2.jpg" alt=""/></div></td>
<td>Bridal Services</td>
</tr>
<tr>
<td><div class="facebookImageWrapper"><img src="images/facebook-logo.png" width="48" height="48"></div></td>
<td>Like us on Facebook</td>
</tr>
</tbody>
</table>
</center>
</div>
<!-- Sidebar end -->
<!-- Content -->
<div class="contenttitle">
<center style="color: #FFFFFF">Welcome</center>
</div>
<div class="content">
<!-- Picture Slider -->
<table width="350" border="0" cellpadding="2" cellspacing="2">
<tr>
<td align="left" valign="top"><div id="p7IRM_1" class="p7IRM01">
<div id="p7IRMow_1" class="p7IRMowrapper">
<div id="p7IRMw_1" class="p7IRMwrapper">
<div id="p7IRMdv_1" class="p7IRMdv"><a class="p7IRMlink" id="p7IRMlk_1" title=""><img class="p7IRMimage" src="../images/new/slide-show1/000.jpg" alt="000" name="p7IRMim_1" width="350" height="233" id="p7IRMim_1" /></a></div>
<div id="p7IRMdsw_1" class="p7IRMdesc_wrapper">
<div class="p7IRMdesc_close"><a id="p7IRMdsclose_1" href="javascript:;" title="Hide Description"><em>Hide</em></a></div>
<div id="p7IRMds_1" class="p7IRMdesc"> </div>
</div>
<div id="p7IRMdsopw_1" class="p7IRMdesc_open_wrapper">
<div id="p7IRMdsop_1" class="p7IRMdesc_open"><a id="p7IRMdsopen_1" href="javascript:;" title="Show Description"><em>Show</em></a></div>
</div>
</div>
</div>
<ul id="p7IRMlist_1" class="p7IRMlist">
<li>000</li>
<li>001</li>
<li>002</li>
<li>003</li>
<li>004</li>
<li>005</li>
<li>006</li>
<li>007</li>
</ul>
<!--[if IE 5.000]>
<style>.p7IRMdesc_wrapper {position:static !important;visibility:visible !important;}.p7IRMdesc_open_wrapper, .p7IRMdesc_close {display: none;}.p7IRMpaginator {position: static !important;height: 3em;}.p7IRMpaginator li, .p7IRMpaginator a {float: left !important;}.p7IRMpaginator a {float: left !important;overflow: visible !important;}</style>
<![endif]-->
<!--[if lte IE 6]>
<style>.p7IRMpaginator a {width: auto !important;}</style>
<![endif]-->
<!--[if lte IE 7]>
<style>.p7IRMpaginator li {display: inline !important;margin-right: 3px !important;}.p7IRMpaginator {zoom: 1;}</style>
<![endif]-->
<script type="text/javascript">P7_opIRM('p7IRM_1',1,1,1,3000,4000,1,0,1,0,1500,0,0);</script>
</div></td>
</tr>
</table>
<!-- Picture Slider end -->
<p><strong></strong><br />
<br />
<br />
</p>
<p>Salon Services | Spa Services | Spa Packages | Bridal Services | About Us | Contact Us</p>
</div>
<!-- Content end -->
and the css
.pagewrap {
width: 1000px;
margin: 0 auto;
}
.header {
background-color: black;
margin-bottom: 5px;
}
.header img {
width: 55%;
}
.sidebar {
width: 200px;
height: auto;
font-size: 16px;
float: left;
margin-bottom: 5px;
padding: 10px;
border: #000000 solid 2px;
border-bottom-left-radius: 2em;
border-bottom-right-radius: 2em;
}
.sidebartitle {
border: #000000 solid 2px;
border-top-left-radius: 2em;
border-top-right-radius: 2em;
padding: 10px;
height: auto;
width: 200px;
background-color: #68316B;
}
.content {
width: 600px;
height: auto;
font-size: 16px;
float: right;
margin-bottom: 5px;
padding: 10px;
border: #000000 solid 2px;
border-bottom-left-radius: 2em;
border-bottom-right-radius: 2em;
}
.contenttitle {
border: #000000 solid 2px;
border-top-left-radius: 2em;
border-top-right-radius: 2em;
float: right;
padding: 10px;
font-size: 16px;
width: 600px;
height: auto;
background-color: #68316B;
}
It's caused by the fact that .sidebartitle isn't floating, so .contenttitle won't float right of it, but stays below it. If you float .sidebartitle, however, .sidebar will be right of .sidebartitle, so just put a wrapper DIV around sidebartitle AND sidebar and make that float:left;.
See the result here: http://codepen.io/anon/pen/jqdNzy