I'm trying to make a layout of blocks, like this:
Pattern design
But I get this:
Pattern made with HTML and css
Does someone know what went wrong? You would really help me out!
Plus all the borders and colors for the other blocks
Snippet Below
#blocks {
font-size: 0; /* To prevent white-space from taking space */
}
.horBlock, .verBlock {
display: inline-block;
box-sizing: border-box;
}
.horBlock {
width: 50%;
padding-top: 25%;
vertical-align: top;
}
.verBlock {
width: 25%;
padding-top: 50%;
vertical-align: top;
}
#javaBlock {
border: 10px solid red;
}
#phpBlock {
border: 10px solid green;
}
#objective-CBlock {
border: 10px solid yellow;
}
#CBlock {
border: 10px solid purple;
}
#pythonBlock {
border: 10px solid blue;
}
#jsBlock {
border: 10px solid #FF7F00;
}
<div id="blocks">
<div class="horBlock" id="javaBlock" onclick="launchInfo(); java();">
<img src="javaLogo.svg">
</div>
<div class="verBlock" id="phpBlock" onclick="launchInfo(); php();">
<img src="phpLogo.svg">
</div>
<div class="verBlock" id="objective-CBlock" onclick="launchInfo(); objectiveC();">
<img src="objective-CLogo.svg">
</div>
<div class="verBlock" id="CBlock" onclick="launchInfo(); C();">
<img src="CLogo.svg">
</div>
<div class="verBlock" id="pythonBlock" onclick="launchInfo(); python();">
<img src="pythonLogo.svg">
</div>
<div class="horBlock" id="jsBlock" onclick="launchInfo(); js();">
<img src="jsLogo.svg">
</div>
</div>
This is a situation where you actually want to be using float properties on specific elements.
Create your own utility classes and assign them to elements as required; like using a specific class to float an element left or right with corresponding classes .alignLeft and .alignRight, e.g:
<div class="horBlock alignLeft nestedBlock" id="javaBlock" onclick="launchInfo(); java();">
<img src="https://placehold.it/200x200">
</div>
<div class="verBlock alignRight nestedBlock" id="phpBlock" onclick="launchInfo(); php();">
<img src="https://placehold.it/200x200">
</div>
Code Snippet Demonstration:
* {
box-sizing: border-box;
}
#blocks {
font-size: 0;
/* To prevent white-space from taking space */
}
.horBlock,
.verBlock {
display: inline-block;
box-sizing: border-box;
}
.horBlock {
width: 50%;
padding-top: 25%;
vertical-align: top;
}
.verBlock {
width: 25%;
padding-top: 50%;
vertical-align: top;
}
#javaBlock {
border: 10px solid red;
}
#phpBlock {
border: 10px solid green;
}
#objective-CBlock {
border: 10px solid yellow;
}
#CBlock {
border: 10px solid purple;
}
#pythonBlock {
border: 10px solid blue;
}
#jsBlock {
border: 10px solid #FF7F00;
}
/* Start Additional */
.alignLeft {
float: left;
}
.alignRight {
float: right;
}
.nestedBlock {
position: relative; /* required to vertically and horizontally align nested img element */
}
.nestedBlock img {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
max-width: 100%;
max-height: 100%;
}
/* End Additional */
<div id="blocks">
<div class="horBlock alignLeft nestedBlock" id="javaBlock" onclick="launchInfo(); java();">
<img src="https://placehold.it/200x200">
</div>
<div class="verBlock alignRight nestedBlock" id="phpBlock" onclick="launchInfo(); php();">
<img src="https://placehold.it/200x200">
</div>
<div class="verBlock alignRight nestedBlock" id="objective-CBlock" onclick="launchInfo(); objectiveC();">
<img src="https://placehold.it/200x200">
</div>
<div class="verBlock alignLeft nestedBlock" id="CBlock" onclick="launchInfo(); C();">
<img src="https://placehold.it/200x200">
</div>
<div class="verBlock alignLeft nestedBlock" id="pythonBlock" onclick="launchInfo(); python();">
<img src="https://placehold.it/200x200">
</div>
<div class="horBlock alignLeft nestedBlock" id="jsBlock" onclick="launchInfo(); js();">
<img src="https://placehold.it/200x200">
</div>
</div>
Related
I have absolutely no idea at this point. I have done everything I could to make sure the arrows and the thumbnail images are centered but somehow, it will not budge... I have even tried the but doesn't seem to make an affect. There is an JS file too but I don't think that really matters so I am not posting on here.
.gallery-outer {
overflow: hidden;
width: 830px;
/*left: 18px;
padding: 0 0 0 5px;*/
height: 250px;
margin-left: -50%;
float: left;
}
.gallery-inner {
float: left;
height: 140px;
position: relative;
width: 3390px;
}
.gallery-tmb {
float: left;
margin: 0 10px 0 0;
}
#gallery {
border-left: 1px solid #E9E9E9;
border-right: 1px solid #E9E9E9;
height: 80px;
margin: 15px;
padding: 0;
position: relative;
width: 400px;
}
#arrow-left {
background:#d1d1d1;
cursor: pointer;
height: 82px;
position: absolute;
left: -7px;
top: 0px;
width: 25px;
}
#arrow-left-small {
padding: 10px;
box-shadow: 4px -4px 0 1px black;
position: relative;
display: inline-block;
margin: 40px;
transform: rotate(225deg);
right: 27px;
top:-9px;
}
#arrow-right {
background:#d1d1d1;
cursor: pointer;
height: 82px;
position: absolute;
right: -476px;
top: 0px;
width: 25px;
}
#arrow-right-small {
padding: 10px;
box-shadow: 4px -4px 0 1px black;
position: relative;
display: inline-block;
margin: 40px;
transform: rotate(45deg);
right: 49px;
top:-9px;
}
<div id="gallery">
<div id="arrow-left">
<div id="arrow-left-small">
</div>
</div>
<div class="gallery-outer">
<div class="gallery-inner">
<div class="gallery-tmb">
<img src="images/executive1.png" alt="Executive1" height="auto" width="250"/>
</div>
<div class="gallery-tmb">
<img src="images/executive2.png" alt="Executive2" height="auto" width="250"/>
</div>
<div class="gallery-tmb">
<img src="images/executive3.png" alt="Executive3" height="auto" width="250"/>
</div>
<div class="gallery-tmb">
<img src="images/executive4.png" alt="Executive4" height="auto" width="250"/>
</div>
<div class="gallery-tmb">
<img src="images/executive5.png" alt="Executive5" height="auto" width="250"/>
</div>
<div class="gallery-tmb">
<img src="images/executive6.png" alt="Executive6" height="auto" width="250"/>
</div>
<div class="gallery-tmb">
<img src="images/executive7.png" alt="Executive7" height="auto" width="250"/>
</div>
</div>
</div>
<div id="arrow-right">
<div id="arrow-right-small">
</div>
</div>
</div>
(function ($) {
$.fn.thumbGallery = function (settings) {
var $this = $(this);
return this.each(function () {
settings = jQuery.extend({
speed: 800,
leftArrow: $this.find('#arrow-left'),
rightArrow: $this.find('#arrow-right'),
galleryContainer: $this.find('.gallery-inner'),
visibleImagesSize: 4
}, settings);
var imgElements = settings.galleryContainer.find('img').length;
var size = settings.visibleImagesSize;
settings.leftArrow.hide();
if (imgElements > settings.visibleImagesSize) {
settings.rightArrow.show();
} else {
settings.rightArrow.hide();
}
function animateLeft() {
var el = settings.galleryContainer.children(":last");
settings.galleryContainer.animate({
left: '+=' + el.outerWidth(true) + 'px'
},
settings.speed);
}
function animateRight() {
var el = settings.galleryContainer.children(":first");
settings.galleryContainer.animate({
left: '-=' + el.outerWidth(true) + 'px'
},
settings.speed);
}
function checkArrows() {
if (size === settings.visibleImagesSize) {
settings.leftArrow.hide();
} else {
settings.leftArrow.show();
}
if (size === imgElements) {
settings.rightArrow.hide();
} else {
settings.rightArrow.show();
}
}
settings.leftArrow.click(function () {
animateLeft();
size--;
checkArrows();
});
settings.rightArrow.click(function () {
animateRight();
size++;
checkArrows();
});
});
};
})(jQuery);
$(document).ready(function () {
$('#gallery').thumbGallery();
});
Solution with use of flexbox.
.gallery-outer {
overflow: hidden;
width: 830px;
/*left: 18px;
padding: 0 0 0 5px;*/
height: 250px;
}
.gallery-inner {
float: left;
height: 100%;
position: relative;
width: 3390px;
}
.gallery-tmb {
float: left;
margin: 0 10px 0 0;
}
#gallery {
border-left: 1px solid #E9E9E9;
border-right: 1px solid #E9E9E9;
display: flex;
justify-content: space-between;
margin: 15px;
padding: 0;
position: relative;
width: 800px;
}
#arrow-left {
background:#d1d1d1;
cursor: pointer;
height: 82px;
width: 25px;
align-self: center;
}
#arrow-left-small {
padding: 10px;
box-shadow: 4px -4px 0 1px black;
position: relative;
display: inline-block;
margin: 40px;
transform: rotate(225deg);
right: 27px;
top:-9px;
}
#arrow-right {
background:#d1d1d1;
cursor: pointer;
height: 82px;
width: 25px;
align-self: center;
}
#arrow-right-small {
padding: 10px;
box-shadow: 4px -4px 0 1px black;
position: relative;
display: inline-block;
margin: 40px;
transform: rotate(45deg);
right: 49px;
top:-9px;
}
Flexbox solution
I just built you an example with all the basics.
I don't recommend float abuse, only use it when really needed.
// HOPE IT HELPS
.gallery{
max-width: 600px;
margin: 0 auto;
text-align: center; /* this will center all the inline and inline-block content */
background: purple;
}
.arrow-left,.arrow-right{
width: 100px;
height: 100px;
display: inline-block;
vertical-align: middle;
background: blue;
color: white;
font-size: 5rem; /* just to make arrows show */
}
/* this is just to make the arrows show :p */
.arrow-left:before{
content: '←';
}
.arrow-right:after{
content: '→';
}
/* i'm just between the arrows and also inline (inline-block)*/
.gallery ul{
vertical-align: middle;
background: green;
margin: 0;
padding: 0;
display: inline-block;
}
/* where the images will go (you can use divs instead of ul, li) */
.gallery li {
display: inline-block;
}
img {
background: red;
width: 100px;
height:100px;
}
<div class="gallery">
<div class="arrow-left"></div>
<ul>
<li><img src="#" width=100 height=100 /></li>
<li><img src="#" width=100 height=100 /></li>
<li><img src="#" width=100 height=100 /></li>
</ul>
<div class="arrow-right">
</div>
</div>
You can use a bootstrap template like this:
<!DOCTYPE html>
<html lang="en">
<head>
<style>
.thumbnail{
height: 200px;
}
</style>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
<div class="container-fulid">
<div class="row">
<div class="col-md-2 text-right">
<span class="glyphicon glyphicon-chevron-left" style="margin-top:20%"></span>
</div>
<div class="col-md-2">
<div class="thumbnail">
</div>
</div>
<div class="col-md-2">
<div class="thumbnail">
</div>
</div>
<div class="col-md-2">
<div class="thumbnail">
</div>
</div>
<div class="col-md-2">
<div class="thumbnail">
</div>
</div>
<div class="col-md-2 text-left">
<span class="glyphicon glyphicon-chevron-right" style="margin-top:20%"></span>
</div>
</div>
</div>
</div>
</body>
</html>
I'm using html and css to make 3 boxes act as links, equally spaced apart. For some reason when I got the divs to be equally spaced, a line was created between all three, acting as a link to the div left of the line.
Why is the line there?
here is the code: (with some stuff taken out)
.divider{
text-align: center;
}
.image{
float:left;
}
#javatut, #frgames, #scratchtut{
display: inline-block;
zoom: 2.0;
background-color: #c0c0c0;
text-align: center;
padding: 10px;
width: 20%;
}
#javatut {
border: 2px solid #ff8300;
}
#frgames {
border: 2px solid #0000ff;
}
#scratchtut {
border: 2px solid #ff8300;
}
#container {
text-align: justify;
}
.stretch {
width: 100%;
display: inline-block;
}
<div id="container">
<a href="url">
<div id="javatut">
<!-- stuff in here -->
</div>
</a>
<a href="url">
<div id="frgames">
<!-- stuff in here -->
</div>
</a>
<a href="url">
<div id="scratchtut">
<!-- stuff in here -->
</div>
</a>
<span class="stretch"></span>
</div>
This line is caused by the browsers default styling of links as underlined. Just set text-decoration: none; on your links and the line will be invisible.
a {
text-decoration: none;
}
.divider {
text-align: center;
}
.image {
float: left;
}
#javatut,
#frgames,
#scratchtut {
display: inline-block;
zoom: 2.0;
background-color: #c0c0c0;
text-align: center;
padding: 10px;
width: 20%;
}
#javatut {
border: 2px solid #ff8300;
}
#frgames {
border: 2px solid #0000ff;
}
#scratchtut {
border: 2px solid #ff8300;
}
#container {
text-align: justify;
}
.stretch {
width: 100%;
display: inline-block;
}
<div id="container">
<a href="url">
<div id="javatut">
<!-- stuff in here -->
</div>
</a>
<a href="url">
<div id="frgames">
<!-- stuff in here -->
</div>
</a>
<a href="url">
<div id="scratchtut">
<!-- stuff in here -->
</div>
</a>
<span class="stretch"></span>
</div>
It's because text-decoration CSS property. Set to none, and it works.
#container a {
text-decoration: none;
}
Your markup is not right
Make your a tags inside the div, all your styles will work correctly
check this
.divider {
text-align: center;
}
.image {
float: left;
}
#javatut,
#frgames,
#scratchtut {
display: inline-block;
zoom: 2.0;
background-color: #c0c0c0;
text-align: center;
padding: 10px;
width: 20%;
}
#javatut {
border: 2px solid #ff8300;
}
#frgames {
border: 2px solid #0000ff;
}
#scratchtut {
border: 2px solid #ff8300;
}
#container {
text-align: justify;
}
.stretch {
width: 100%;
display: inline-block;
}
<div id="container">
<div id="javatut">
<a href="url">
</a>
</div>
<div id="frgames">
<!-- stuff in here -->
<a href="url">
</a>
</div>
<div id="scratchtut">
<!-- stuff in here -->
</div>
<span class="stretch"></span>
</div>
Hope this helps
You can also do using flexbox for this
I really need your help with this. For the life of me, I cannot begin to understand as to why I cannot seem to get my form DIV to properly be positioned on the right side of my 2 column layout.
See attached picture below:
Here is the HTML & CSS in question:
* {
font-family: Segoe UI;
font-size: 9pt;
}
html, body {
padding: 0;
margin: 0;
}
body {
background: rgb(187,195,203);
}
.Absolute-Center {
margin: auto;
}
#wrapper {
position:absolute;
top:50%;
left:50%;
transform: translate(-50%,-50%);
}
#layout {
height: auto;
width: 900px;
border: 1px solid rgb(112,112,112);
}
#box1 {
background: rgb(141,155,169);
color: #FFF;
padding: 3px;
font-weight: bold;
}
#box2 {
width: 100%;
background: rgb(240,240,240);
border-bottom: 1px solid rgb(180,180,180);
padding: 4px;
box-sizing: border-box;
}
#box3 {
width: 100%;
border-bottom: 1px solid rgb(180,180,180);
}
#box4 {
background: #FFF;
float: left;
width: 175px;
height: 375px;
border-right: 1px solid rgb(180,180,180);
}
#box5 {
background: rgb(240,240,240);
height: 375px;
}
#box7 {
background: rgb(240,240,240);
padding: 5px;
text-align:center;
}
#leftcolumn {
float: left;
}
#rightcolumn {
border: 0;
padding: 3px;
text-align: center;
}
.clear {
clear: both;
}
fieldset {
margin: 0;
padding: 2px;
padding-bottom: 5px;
}
div.wrapper {
width: 500px;
}
div.form {
width: 100%;
background-color: rgb(240,240,240);
border: 1px sold #000;
padding: 5px;
}
div.row {
clear: both;
padding-top: 5px;
}
div.row span.label {
float: left;
width: 50px;
text-align: right;
padding-right: 5px;
}
div.row span.formw {
float: left;
width: 200px;
text-align: left;
}
div.spacer {
clear: both;
}
span.title {
color: rgb(70,141,180);
}
input {
width: 150px;
border: 1px solid #000;
}
<div id="wrapper">
<div id="layout" class="Absolute-Center">
<div id="box1">Application Title</div>
<div id="box2">
<div id="leftcolumn"></div>
<div id="rightcolumn"></div>
<div class="clear"></div>
</div>
<div id="box3">
<!-- LEFT WINDOW PANE -->
<div id="box4">
<div id="menu_wrapper">
<ul id="menu">
<li data-show="#1">File Information</li>
<li data-show="#2">Comments</li>
</ul>
</div>
</div>
<!-- RIGHT WINDOW PANE -->
<div id="box5">
<!-- CONTENT [TAB1] -->
<div id="1" style="width: 100%;" class="hidden tab">
<div class="form">
<form>
<div style="border-bottom: 1px solid #000;" class="row"><span class="title">FILE INFORMATION</span></div>
<div class="row">
<span><b>Date Received</b></span>
</div>
<div class="row">
<span class="label">From:</span><span class="formw"><input type="text"/></span>
</div>
<div class="row">
<span class="label">To:</span><span class="formw"><input type="text"/></span>
</div>
<div class="spacer"></div>
</form>
</div>
</div>
<!-- CONTENT [TAB2] -->
<div id="2" class="hidden tab"></div>
</div>
</div>
</div>
</div>
I got it to sit in the right container by adding float:right to the form container div
Fiddle - http://jsfiddle.net/90777hu9/
It's because you float box4 left but you do not float box5 right. So it is still in the flow of the document and pushed below the float left.
Added float:left and width: 78%; to .box5 Press in the snippet the fullpage button to see it
* {
font-family: Segoe UI;
font-size: 9pt;
}
html, body {
padding: 0;
margin: 0;
}
body {
background: rgb(187,195,203);
}
.Absolute-Center {
margin: auto;
}
#wrapper {
position:absolute;
top:50%;
left:50%;
transform: translate(-50%,-50%);
}
#layout {
height: auto;
width: 900px;
border: 1px solid rgb(112,112,112);
}
#box1 {
background: rgb(141,155,169);
color: #FFF;
padding: 3px;
font-weight: bold;
}
#box2 {
width: 100%;
background: rgb(240,240,240);
border-bottom: 1px solid rgb(180,180,180);
padding: 4px;
box-sizing: border-box;
}
#box3 {
width: 100%;
border-bottom: 1px solid rgb(180,180,180);
}
#box4 {
background: #FFF;
float: left;
width: 175px;
height: 375px;
border-right: 1px solid rgb(180,180,180);
}
#box5 {
background: rgb(240,240,240);
height: 375px;
float:left;
width: 78%;
}
#box7 {
background: rgb(240,240,240);
padding: 5px;
text-align:center;
}
#leftcolumn {
float: left;
}
#rightcolumn {
border: 0;
padding: 3px;
text-align: center;
}
.clear {
clear: both;
}
fieldset {
margin: 0;
padding: 2px;
padding-bottom: 5px;
}
div.wrapper {
width: 500px;
}
div.form {
width: 100%;
background-color: rgb(240,240,240);
border: 1px sold #000;
padding: 5px;
}
div.row {
clear: both;
padding-top: 5px;
}
div.row span.label {
float: left;
width: 50px;
text-align: right;
padding-right: 5px;
}
div.row span.formw {
float: left;
width: 200px;
text-align: left;
}
div.spacer {
clear: both;
}
span.title {
color: rgb(70,141,180);
}
input {
width: 150px;
border: 1px solid #000;
}
<div id="wrapper">
<div id="layout" class="Absolute-Center">
<div id="box1">Application Title</div>
<div id="box2">
<div id="leftcolumn"></div>
<div id="rightcolumn"></div>
<div class="clear"></div>
</div>
<div id="box3">
<!-- LEFT WINDOW PANE -->
<div id="box4">
<div id="menu_wrapper">
<ul id="menu">
<li data-show="#1">File Information</li>
<li data-show="#2">Comments</li>
</ul>
</div>
</div>
<!-- RIGHT WINDOW PANE -->
<div id="box5">
<!-- CONTENT [TAB1] -->
<div id="1" style="width: 100%;" class="hidden tab">
<div class="form">
<form>
<div style="border-bottom: 1px solid #000;" class="row"><span class="title">FILE INFORMATION</span></div>
<div class="row">
<span><b>Date Received</b></span>
</div>
<div class="row">
<span class="label">From:</span><span class="formw"><input type="text"/></span>
</div>
<div class="row">
<span class="label">To:</span><span class="formw"><input type="text"/></span>
</div>
<div class="spacer"></div>
</form>
</div>
</div>
<!-- CONTENT [TAB2] -->
<div id="2" class="hidden tab"></div>
</div>
</div>
</div>
</div>
Well, I have a problem. I have my layout exactly as I want it, but when I add text in, the layout changes. It's kind of hard to explain, so I'm going to show pictures.
Layout Before Text:
Layout After Text:
Any help is greatly appreciated
html, body { height: 100%; width: 100%; margin: 0; padding: 0; }
.header {
color: #AEC6CF;
font-family: gabriola;
font-weight: 900;
font-size: 50px;
position: relative;
}
/* ID */
#row1 {
width: 100%;
height: 15%;
}
#row2 {
width: 100%;
height: 2.5%;
}
#row3 {
width: 100%;
height: 70%;
}
#row4 {
width: 100%;
height: 2.5%;
}
#row5 {
width: 100%;
height: 9.7%;
}
#column1 {
border-bottom: 3px solid black;
border-right: 3px solid black;
width: 20%;
height: 100%;
left: 0;
display: inline-block;
margin-right: -0.25%;
}
#column2 {
border-bottom: 3px solid black;
border-left: 3px solid black;
width: 79%;
height: 100%;
right: 0;
display: inline-block;
margin-left: -0.25%;
}
/* Misc. */
.center {
text-align: center;
}
.right {
text-align: right;
}
.left {
text-align: left;
}
.clearfix {
float: clear;
margin: 0;
padding: 0;
}
<!DOCTYPE html>
<head>
<meta charset=utf-8>
<link type="text/css" rel="stylesheet" href="stylesheet.css">
<title>Test</title>
</head>
<body>
<div id="row1">
<div id="column1" class="clearfix">
</div>
<div id="column2" class="clearfix">
<h1 class="header center">See The Problem?</h1>
</div>
</div>
<div id="row2">
<div id="column1" class="clearfix">
</div>
<div id="column2" class="clearfix">
</div>
</div>
<div id="row3">
<span id="column1" class="clearfix">
</span>
<span id="column2" class="clearfix">
</span>
</div>
<div id="row4">
<span id="column1" class="clearfix">
</span>
<span id="column2" class="clearfix">
</span>
</div>
<div id="row5">
<div id="column1" class="clearfix" style="border-bottom: 0px;">
</div>
<div id="column2" class="clearfix" style="border-bottom: 0px;">
</div>
</div>
</body>
</html>
I have type of card created. It has 3 rows with a p and a div. I want both of them to come in the same line. How can I do this?
HTML:
<div class="user_card">
<div class="skills">
<p>Skills</p>
<div class="progress_wrap">
<div class="progress" style="width:95%"></div>
</div>
</div>
<div class="commitment">
<p>Commitment</p>
<div class="progress_wrap">
<div class="progress" style="width:35%;"></div>
</div>
</div>
<div class="reputation">
<p>Reputation</p>
<div class="progress_wrap">
<div class="progress" style="width:65%;"></div>
</div>
</div>
</div>
CSS:
.user_card {
background-color: #eee;
width: 30%;
padding: 10px;
}
.user_card div p {
display: inline;
}
.user_card div.skills {
margin-left: -1px;
}
.user_card div div.progress_wrap {
background-color: white;
width: 100%;
border: 1px solid #bbb;
}
.user_card div div.progress {
height: 30px;
background-color: #ddd;
}
Fiddle.
Please post fiddle as well with your answers!
Using display table, table-row, table-cell.
http://jsfiddle.net/vnama/
.user_card {
background-color: #eee;
width: 30%;
padding: 10px;
display:table;
}
.user_card p {
display: table-cell;
vertical-align:top;
line-height:30px;
padding:2px 10px 2px 2px;
}
.user_card div {
display:table-row;
padding:2px;
}
.user_card div div {
display:table-cell;
}
.user_card div div.progress_wrap {
background-color: white;
width: 100%;
border: 1px solid #bbb;
}
.user_card div div.progress {
height: 30px;
background-color: #ddd;
}
You can try using tables: http://jsbin.com/efugop
I have it:
HTML:
<div class="user_card">
<div class="skills">
<table><tr><td>
<p>Skills</p></td><td>
<div class="progress_wrap" style="margin-left:70px;">
<div class="progress" style="width:95%"></div>
</div></td></tr></table></div>
<div class="commitment">
<table><tr><td>
<p style="position:relative;margin-top:6px;">Commitment</p>
<div class="progress_wrap" style="position:relative;left:35px;margin-left:70px;">
<div class="progress" style="width:35%;"></div>
</div></td></tr></table>
</div>
<div class="reputation">
<table><tr><td>
<p style="position:relative;margin-top:6px;">Reputation</p>
<div class="progress_wrap" style="position:relative;left:35px;margin-left:70px;">
<div class="progress" style="width:65%;"></div>
</div>
</td></tr></table>
</div>
</div>
CSS:
.user_card {
background-color: #eee;
width: 50%;
padding: 20px 80px 20px 20px;
}
.user_card div p {
display: inline;
float: left;
}
.user_card div.skills {
margin-left: -1px;
}
.user_card div div.progress_wrap {
background-color: white;
width: 100px;
border: 1px solid #bbb;
}
.user_card div div.progress {
height: 30px;
background-color: #ddd;
}
You can use css to float left
. progress_wrap {
float: right;
}
HTML
<div class="user_card">
<div class="skills">
<p>Skills</p>
<div class="progress_wrap" style="margin-left:80px;">
<div class="progress" style="width:95%"></div>
</div>
</div>
<div class="commitment">
<p style="margin-left:-35px;">Commitment</p>
<div class="progress_wrap" style="margin-left:80px;">
<div class="progress" style="width:35%;"></div>
</div>
</div>
<div class="reputation">
<p style="margin-left:-73px;">Reputation</p>
<div class="progress_wrap" style="margin-left:80px;">
<div class="progress" style="width:65%;"></div>
</div>
</div>
In CSS
.user_card {
background-color: #eee;
width: 50%;
padding: 20px 100px 20px 20px;
}
.user_card div p {
display: inline;
float: left;
}
.user_card div.skills {
margin-left: -1px;
}
.user_card div div.progress_wrap {
background-color: white;
width: 100%;
border: 1px solid #bbb;
}
.user_card div div.progress {
height: 30px;
background-color: #ddd;
}