Aligning text to center of last div - html

I am new due css & Html design. I am facing an issue in aligning text to center of a last div.
I have created js fiddle :http://jsfiddle.net/80sems56/
Please help aligning last div text "Stress" to center of last image.
Code is like:
<div>
<div id="imgWeight" class="floatLeft">
<img alt="Body Weight" class="icon110" src="../../images/OnTrack/bmi_icon_100.png"/>
<div class="textaligncenter">Body Weight</div>
</div>
<div id="imgBloodPressure" class="margin5 floatLeft">
<img alt="Blood Pressure" class="icon110" src="../../images/OnTrack/health_manager_icon_100.png"/>
<div class="textaligncenter">Blood Pressure</div>
</div>
<div id="imgStress" class="floatleft">
<img alt="Stress" class="icon110" src="../../images/OnTrack/stress_icon_100.png"/>
<div class="textaligncenter">Stress</div>
</div>
</div>
css
.
padding20px{
padding:20px;
}
.margin20px{
margin:20px;
}
.imgSteps{
padding:20px;
position:absolute;
}
.bckColor{
background-color: #secondary;
color:#white;
}
.fontfamily {
font-family: "Avenir Next Light";
}
h3{
color:grey;
}
.margin5 {
margin-left: 5%;
margin-right: 5%;
}
.margin15 {
margin-left: 15%;
}
.margin6{
margin-left: 6%;
}
.margin10 {
margin-left: 10%;
}
.margin50{
margin-left:50%;
}
.absPosition{
position: absolute;
}
.floatLeft{
float:left;
}
.shadow {
box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.4);
}
.opacity{
opacity: 0.3;
filter: alpha(opacity=30);
}
#dvNavigationArea ul li {
display: inline;
padding-right:20px;
width:100px;
position:relative;
}
.underline{
content:'';
height: 0;
left:0;
bottom:0px;
border-bottom: 4px solid #53ADB3;
}
/*for css chart control*/
.container {
width: 100px;
margin: 20px;
background: #fff;
padding: 20px;
float: left;
}
.horizontal .progress-bar {
height: 45px;
width: 100%;
padding: 12px 0;
}
.horizontal .progress-track {
width: 100%;
height: 20px;
background: #ebebeb;
}
.horizontal .progress-fill {
background: #666;
height: 20px;
width: 50%;
color: #fff;
text-align: center;
font-size: 12px;
line-height: 20px;
}
.fontColor{
color:#53ADB3;
}
.fontsizexlarge{
font-size: x-large;
}
.fontsizexxlarge{
font-size: xx-large;
}
.fontsize22{
font-size: larger;
}
.fontsize10{
font-size: large;
}
.icon110
{
background-color:#secondary;
-moz-border-radius:50%;
-webkit-border-radius:50%;
border-radius: 50%;
width:#col-size;height:#col-size;
}
.textaligncenter{
text-align:center;
}
.minwidth
{
}

You did the typo while assigning the class for the last div. Use floatLeft instead of floatleft (the letter l is culprit)
Js Fiddle

Your last div class name should be floatLeft instead of flaotleft.
<div id="imgStress" class="floatLeft">
Fiddle

* add this code *
.floatleft{
float: left;
text-align: center;}
http://jsfiddle.net/80sems56/3/

Your HTML has a mistake in. Your missing a capital 'L' on the floatLeft class.
Updated Fiddle
<div>
<div id="imgWeight" class="floatLeft">
<img alt="Body Weight" class="icon110" src="../../images/OnTrack/bmi_icon_100.png"/>
<div class="textaligncenter">Body Weight</div>
</div>
<div id="imgBloodPressure" class="margin5 floatLeft">
<img alt="Blood Pressure" class="icon110" src="../../images/OnTrack/health_manager_icon_100.png"/>
<div class="textaligncenter">Blood Pressure</div>
</div>
<div id="imgStress" class="floatLeft">
<img alt="Stress" class="icon110" src="../../images/OnTrack/stress_icon_100.png"/>
<div class="textaligncenter">Stress</div>
</div>
</div>

Related

Center icon vertically next to text

I have tried below code to get desired output, how to display that lock in middle of that.
I have tried so many thing, which I found on SO, but nothing helpful.
I am not very experienced in CSS.
I want to display like this:
.inline-block {
display: inline-block;
}
.lock_image {
width: 30px;
height: 30px;
}
hr {
width: 250px;
margin: 0px;
bottom: 1px;
margin-bottom: 5px !important;
margin-top: 5px !important;
}
.title {
margin: 0px;
}
<div class="inline-block"><img src="https://image.ibb.co/f7sA2Q/icons8_Lock_50.png" alt="icons8_Lock_50" border="0" class="lock_image"></div>
<div class="inline-block">
<p class="title">Google Drive Integrated Email</p>
<hr>
<a class="mgl20" href="javascript:void(0);">xyz#gmail.com</a>
</div>
I added a wrapper around the content you had and made it a flexbox with vertical center alignment.
.wrapper {
display: flex;
align-items: center;
}
.inline-block {
display: inline-block;
}
.lock_image {
width: 30px;
height: 30px;
}
hr {
width: 250px;
margin: 0px;
bottom: 1px;
margin-bottom: 5px !important;
margin-top: 5px !important;
}
.title {
margin: 0px;
}
<div class="wrapper">
<div class="inline-block">
<img src="https://image.ibb.co/f7sA2Q/icons8_Lock_50.png" alt="icons8_Lock_50" border="0" class="lock_image">
</div>
<div class="inline-block">
<p class="title">Google Drive Integrated Email</p>
<hr>
<a class="mgl20" href="javascript:void(0);">xyz#gmail.com</a>
</div>
</div>
Please add vertical-align:middle in inline-block class.
.inline-block{
display:inline-block;
vertical-align:middle;
}
.lock_image{
width:30px;
height:30px;
}
hr{
width: 250px;
margin: 0px;
bottom: 1px;
margin-bottom: 5px !important;
margin-top: 5px !important;
}
.title{
margin:0px;
}
<div class="inline-block"><img src="https://image.ibb.co/f7sA2Q/icons8_Lock_50.png" alt="icons8_Lock_50" border="0" class="lock_image"></div>
<div class="inline-block"><p class="title">Google Drive Integrated Email</p><hr>
<a class="mgl20" href="javascript:void(0);">xyz#gmail.com</a>
</div>
Try this code:
Here is the jsfiddle: https://jsfiddle.net/rhulkashyap/71a9uLvy/
.inline-block{
display:inline-block;
vertical-align:middle;
}
.lock_image{
width:30px;
height:30px;
}
hr{
width: 250px;
margin: 0px;
bottom: 1px;
margin-bottom: 5px !important;
margin-top: 5px !important;
}
.title{
margin:0px;
}
<div class="inline-block"><img src="https://cdn.pbrd.co/images/GHHKwv7.png" alt="icons8_Lock_50" border="0" class="lock_image"></div>
<div class="inline-block"><p class="title">Google Drive Integrated Email</p><hr>
<a class="mgl20" href="javascript:void(0);">xyz#gmail.com</a>
</div>

HTML & CSS with div problems

I am beginner in CSS & HTML and still learning on it.
I want to get this result:
can anyone help me to solve my problem?
Here is my code:
body {
background: black;
}
.process {
background-color: rgba(255, 255, 255, 0.15);
height: 255px;
width: 630px;
}
.process img {
text-align: center;
display: block;
padding-top: 40px;
padding-bottom: 33px;
}
.lockup {
text-align: center;
}
.lockup h2 {
color: #5db442;
font-size: 26px;
font-weight: 100;
text-transform: uppercase;
}
.sign {
}
.fill {
}
.fill p {
color: white;
}
<div class="process">
<img src="http://s33.postimg.org/m5kmwz9ov/upanddown.png"/>
<div class="lockup">
<div class="sign">
<img src="http://s33.postimg.org/h2h988fdb/signup.png" />
</div>
<div class="fill">
<h2>Signup Process</h2>
<p>1. User enters email address</p>
<p> 2. Clicks on "Sign up for free"</p>
</div>
</div>
</div>
please help thanks.
Please have look at following jsFiddle, I hope it works for you.
jsFiddle Link
<div class="process"> <img src="http://s33.postimg.org/m5kmwz9ov/upanddown.png"/>
<div class="lockup">
<div class="sign"> <img src="http://s33.postimg.org/h2h988fdb/signup.png" /> </div>
<div class="fill">
<h2>Signup Process</h2>
<p>1. User enters email address</p>
<p> 2. Clicks on "Sign up for free"</p>
</div>
</div>
</div>
<style>
body {
background: black;
}
.process {
background-color: rgba(255, 255, 255, 0.15);
height: 255px;
width: 630px;
margin-left: auto;
margin-right: auto;
}
.process img {
/*text-align: center;
display: block;*/
padding-top: 40px;
padding-bottom: 33px;
}
.lockup {
text-align: center;
}
.lockup h2 {
color: #5db442;
font-size: 26px;
font-weight: 100;
text-transform: uppercase;
}
.sign {
float: left;
width: 43%;
text-align: right;
}
.fill {
float: left;
text-align: left;
padding-left: 4%;
}
.fill p {
color: white;
}
</style>
Look below code or Here is jsfiddle link : https://jsfiddle.net/hmxbes8u/2/
I hope this will help you.
HTML
<div class="process">
<img src="http://s33.postimg.org/m5kmwz9ov/upanddown.png"/>
<div class="lockup">
<div class="sign">
<img src="http://s33.postimg.org/h2h988fdb/signup.png" />
</div>
<div class="fill">
<h2>Signup Process</h2>
<p>1. User enters email address</p>
<p> 2. Clicks on "Sign up for free"</p>
</div>
</div>
</div>
CSS:
body {
background: black;
}
.process {
background-color: rgba(255, 255, 255, 0.15);
height: 255px;
width: 630px;
position:relative;
text-align: center;
}
.process > img {
text-align: center;
display: inline-block;
padding-top: 40px;
padding-bottom: 33px;
}
.lockup {
text-align: center;
position:absolute;
top:100px;
right:0;
left:0;
}
.lockup h2 {
color: #5db442;
font-size: 26px;
font-weight: 100;
text-transform: uppercase;
margin-top:0;
}
.sign {
display:inline-block;
vertical-align:top;
margin-right:30px;
}
.fill {
display:inline-block;
text-align:left;
}
.fill p {
color: white;
}

How do I center aligned vertically the text with my image

I'm trying to vertically centered align the text with my image. Currently, the text looks like it's aligned at the bottom of the image.
Here's my jsfiddle:
http://jsfiddle.net/huskydawgs/L5Le0w37/7/
Here's my HTML:
<div class="column-resources-box">
<img alt="Apples" height="50" src="http://www.clipartbest.com/cliparts/acq/ezj/acqezjKcM.jpeg" width="50" />
<h4 class="title-bar">Apple<br>
Center</h4>
<ul>
<li>Gala</li>
<li>Pink Lady</li>
<li>Fuji</li>
</ul>
</div>
Here's my CSS:
.column-resources-box {
width: 200px;
float: left;
margin: 15px;
}
.column-resources-box img {
margin:0 2%;
float:left;
height:50px;
width:50px;
}
}
h4.title-bar {
color: #2251a4;
background: none;
font-family: 'Arial', inherit;
font-weight: normal;
text-transform: none;
line-height: normal;
margin: 0;
padding: 0;
text-align: left;
}
Try this out.
I wrapped the two items you want centered in the div, and then centered the image.
.wrap {
display:inline
}
.apple_image {
vertical-align:middle
}
.column-resources-box {
width: 200px;
float: left;
margin: 15px;
}
.column-resources-box img {
margin:0 2%;
float:left;
height:50px;
width:50px;
}
}
h4.title-bar {
color: #2251a4;
background: none;
font-family: 'Arial', inherit;
font-weight: normal;
text-transform: none;
line-height: normal;
margin: 0 0 0 0;
padding: 0;
text-align: left;
}
<div class="column-resources-box">
<div class="wrap">
<a class="apple_image" href="http://en.wikipedia.org/wiki/Apple">
<img alt="Apples" height="50" src="http://www.clipartbest.com/cliparts/acq/ezj/acqezjKcM.jpeg" width="50" />
</a>
<h4 class="title-bar">AppleCenter</h4>
</div>
<ul>
<li>Gala</li>
<li>Pink Lady</li>
<li>Fuji</li>
</ul>
</div>
You could use absolute positioning to put things exactly where you want them.
Fiddle: http://jsfiddle.net/t8rL871j/
.column-resources-box {
width: 200px;
float: left;
margin: 15px;
position: relative;
}
.column-resources-box img {
margin:0 2%;
height:50px;
width:50px;
position: absolute;
}
h4.title-bar {
color: #2251a4;
background: none;
font-family:'Arial', inherit;
font-weight: normal;
text-transform: none;
line-height: normal;
margin: 0 0 0 0;
padding: 0;
text-align: left;
position: absolute;
top: 10px;
left: 60px;
}
.column-resources-box ul {
margin:60px 2%;
height:50px;
width:70px;
position: absolute;
}
<div class="column-resources-box"> <img alt="Apples" height="50" src="http://www.clipartbest.com/cliparts/acq/ezj/acqezjKcM.jpeg" width="50" />
<h4 class="title-bar">Apple<br>
Center</h4>
<ul>
<li>Gala</li>
<li>Pink Lady</li>
<li>Fuji</li>
</ul>
</div>
There's a syntax error in your CSS. Here's your CSS, excerpted from the top:
.column-resources-box {
width: 200px;
float: left;
margin: 15px;
}
.column-resources-box img {
margin:0 2%;
float:left;
height:50px;
width:50px;
}
}
Notice the extraneous close brace. That seems to be preventing the browser from getting to the remaining CSS.
Fixed: http://jsfiddle.net/L5Le0w37/13/
You can move it down a little to center it with position:relative; top:7px;:
Centered: http://jsfiddle.net/L5Le0w37/16/
I rewrote your code a bit but here's another possible way using top padding..
vertical-align: top;
padding: 4px 0px 0px 0px; /* adjust top padding */
http://jsfiddle.net/Hastig/mj5yzsr7/3/
You can adjust the spacing between Apple and Center with h4.title-bar { line-height: 25px; } then adjust the top padding to compensate.
Wrap your text and image inside of a div and style it like this:
HTML
<div class="appleWrapper">
<img alt="Apples" height="50" src="http://www.clipartbest.com/cliparts/acq/ezj/acqezjKcM.jpeg" width="50" />
<h4 class="title-bar">Apple<br>Center</h4>
</div>
CSS
.appleWrapper {
height: 50px;
}
.title-bar {
margin: 0;
position: relative;
top: 50%;
transform: translateY(-50%);
}
Check out the online example here

How can I insert the skill name inside the progress bar?

I am working on my resume and I want the skill name inside the progress bar, and not above. But I dont get it. Thx
this is the web: http://working.virgiliodelavega.com/
<span class="skills-each">Illustrator</span>
<div class="progress-bar blue">
<span style="width: 90%"></span>
</div>
.skills-title {
font-size: 1em;
}
.skills-each {
font-size: .8em;
}
.progress-bar {
background-color: #727e7f;
height: 25px;
padding: 3px;
}
.progress-bar span {
display: inline-block;
height: 100%;
}
.blue span {
background-color: #34495e;
}
.red span {
background-color: #e74c3c;
}
I would recommend a change in markup. Using lists is a lot cleaner than divs/spans.
http://codepen.io/cimmanon/pen/Hikxp
ul.skills {
padding: 0;
}
ul.skills li {
background-color: #727e7f;
position: relative;
line-height: 2em;
margin: 1em 0;
padding: 0 .5em;
position: relative;
color: white;
}
ul.skills li span {
position: relative;
z-index: 10;
font-size: .8em;
}
ul.skills li:after {
position: absolute;
left: 3px;
top: 3px;
bottom: 3px;
content: '';
}
ul.skills li.seven:after {
width: 70%;
}
ul.skills li.eight:after {
width: 80%;
}
ul.skills li.nine:after {
width: 90%;
}
ul.skills li.ten:after {
right: 3px;
}
ul.skills.graphic li:after {
background-color: #34495e;
}
ul.skills.web li:after {
background-color: #e74c3c;
}
<h1>Graphic Skills</h1>
<ul class="skills graphic">
<li class="eight"><span>Illustrator</span></li>
<li class="ten"><span>Photoshop</span></li>
<li class="nine"><span>Indesign</span></li>
</ul>
<h1>Web Development</h1>
<ul class="skills web">
<li class="seven"><span>Illustrator</span></li>
<li class="eight"><span>Photoshop</span></li>
<li class="nine"><span>Indesign</span></li>
</ul>
hi you can try this way if you want
html
<span class="skillEachWrap"> <span class="skills-each">Illustrator</span></span>
<div class="progress-bar blue">
<span style="width: 90%"></span>
</div>
css
.skillEachWrap {
float:left;
position:relative;
}
.skills-each {
font-size: .8em;
position:absolute;
top:7px;
left:10px;
}
working demo hope this help you.....
You can use position:absolute to place the text on top of your progress bar. Then use line-height:25px to center the text vertically within the bar. I also recommend you give you bar a class and not just target it as span since we have multiple children in .progress-bar now.
jsFiddle
HTML
<div class="progress-bar blue">
<span class="bar" style="width: 80%"></span>
<span class="name">Photoshop</span>
</div>
CSS
.progress-bar {
background-color: #727e7f;
height: 25px;
padding: 3px;
position:relative;
}
.progress-bar .bar {
display: inline-block;
height: 100%;
}
.progress-bar.blue .bar {
background-color: #34495e;
}
.progress-bar .name {
color:#FFF;
position:absolute;
left:10px;
line-height:25px;
}

Css layout overlapping

Hello i am trying to get my columns in css to go down the page. Im new to css but know some css for messing around with things.
My columns are sat next to each other like so
collum1 collum2
I am trying to make them go down the page like so
collum1
collum2
But seems not wanting to move...
Here is my page source for the left side bar.
<div class="col1">
<div class="box" id="news">
<h1 id="news_handle">Home</h1>
<ul>
<li>Login</li>
<li>Register</li>
</ul>
<div class="bar">
<span>
<span></span></span></div>
</div>
<div class="box" id="events"></div>
</div>
<div class="co22">
<div class="box" id="news">
<h1 id="news_handle">22</h1>
<ul>
<li>1212</li>
<li>1212</li>
</ul>
<div class="bar">
<span>
<span></span></span></div>
</div>
<div class="box" id="events"></div>
</div>
Then here is my css style / file
body
{
background: #122530 url('./images/background.jpg') repeat-y;
text-align: center;
font: 12px Tahoma, Arial, Hevetica, Sans-serif;
}
a,a:visited
{
color: #1e3f51;
}
a:hover
{
text-decoration: none;
}
a img,a:visited img
{
border: 0;
}
/**
* General Structure
*/
div#container
{
width: 873px;
margin: 0 auto 0 auto;
text-align: left;
}
/**
* Banner/Nav
*/
div#banner
{
height: 255px;
background: url('./images/banner.jpg') no-repeat;
margin: 0 0 10px 0;
clear: both;
}
div#nav
{
background: url('./images/nav_bg.jpg') no-repeat;
height: 35px;
margin: 1px 0px 0px 2px;
width: 100%;
overflow: hidden;
float: left;
}
div#nav a
{
color: #ffffff;
font: bold 10px Tahoma, Arial, Hevetica, Sans-serif;
text-decoration: none;
height: 12px;
display: block;
float: left;
padding: 11px 7px 11px 7px;
text-transform: uppercase;
margin: 1px 0 0 0;
}
div#nav a:hover
{
background: url('./images/nav_hover.jpg') repeat-x;
}
/**
* Columns
*/
div.col1,div.col2
{
float: left;
}
div.col1
{
width: 190px;
}
div.col2
{
width: 479px;
margin: 0 7px 0 7px;
}
/**
* Columns
*/
div.co22
{
float: left;
}
div.co22
{
width: 190px;
}
div.co22
{
width: 479px;
margin:25px 50px 75px;
}
/**
* Box Elements
*/
div.box
{
margin: 0 0 10px 0;
}
div.box h1
{
height: 29px;
color: #ffffff;
font: 15px 'Trebuchet MS', Tahoma, Arial, Helvetica, Sans-serif;
padding: 6px 0 0 10px;
margin: 0;
border-bottom: 1px solid #112735;
cursor: move;
}
div.col2 div.box h1
{
cursor: auto;
}
div.col1 div.box h1
{
background: url('./images/col1_head.jpg') no-repeat;
}
div.col2 div.box h1
{
background: url('./images/col2_head.jpg') no-repeat;
}
div.box div.bar
{
height: 23px;
clear: both;
background: url('./images/box_foot.jpg') repeat-x;
color: #d1e3ee;
font: 11px Tahoma;
}
div.box div.bar span
{
height: 23px;
display: block;
background: url('./images/box_foot_left.jpg') no-repeat;
float: left;
padding: 4px;
}
div.box div.bar span span
{
height: 23px;
width: 2px;
background: url('./images/box_foot_right.jpg') top right no-repeat;
float: right;
display: block;
margin: -4px;
}
div.box div.bar a
{
display: block;
color: #d1e3ee;
text-decoration: none;
}
div.box div.bar a.right
{
text-align: right;
}
div.content
{
margin: 0 2px 0 2px;
background: #c1dae8 url('./images/body_bg.jpg') repeat-x;
border: 1px solid #ffffff;
padding: 10px 0 10px 0;
}
div.content p
{
margin: 0;
padding: 5px;
}
/**
* Lists
*/
ul
{
margin: 0;
padding: 0;
list-style: none;
}
ul li
{
background: url('./images/list_item.jpg') repeat-x;
border: 1px solid #112735;
border-top: 0px;
height: 14px;
padding: 4px;
}
ul li a
{
display: block;
text-decoration: none;
height: 14px;
}
ul.sponsors li
{
background: url('./images/list_sponsor.jpg') repeat-x;
height: 48px;
padding: 0;
}
ul.sponsors li a
{
height: 48px;
}
/**
* Footer
*/
div#footer
{
background: url('./images/footer.jpg') no-repeat;
height: 36px;
clear: both;
}
div#footer a
{
display: block;
height: 36px;
}
div#footer a span
{
display: none;
}
I have been awake 12 hours looking though google and trying to make them down under each other with no luck.
Okay Have looked at your code using firebug.
Why are you inserting more than one
<div class="col1">
...
</div>
You should just place all boxes in the same col1. You do not need two of these.
Basically, do not use two versions of col1 but place all boxes in the same col1, one below each other.
<div class="col1">
<div class="box" id="news" style="position: relative; "></div>
<div class="box" id="events" style="position: relative; "/> </div>
<div class="box" id="news" style="position: relative; "></div>
<div class="box" id="events" style="position: relative; "/> </div>
</div>
If you need to access each box directly then separate them by using different ids, id="news1", id="news2" ...
---EDIT---
Well I have tried it and look:
HTML for one of your col1 (same for both sides).
<div class="col1">
<div class="box" id="news">
<h1 id="news_handle">Home</h1>
<ul>
</ul>
<div class="bar">
<span>
<span></span></span></div>
</div>
<div style="height:20px;"> </div>
<div class="box" id="sponsors">
<h1 id="news_handle">Home</h1>
<ul>
<li>Login</li>
<li>Register</li>
</ul>
<div class="bar"> <span> <span></span></span></div>
</div>
<div class="box" id="affiliates"></div>
<div class="box" id="items"></div>
</div>
I have not changed your CSS, that is what is live
i would suggest removing the
float:left;
from columns... and add:
display:block;
Here you go : http://jsfiddle.net/d47Vs/
I would suggest to put both columns into a div:
<div class="sidebar">
<div id="col1"></div>
<div id="col2"></div>
</div>
Now float: left; for both center box and left sidebar. In order to have col1 and col2 underneath each other use as Philip said display: block;
Edit:
As you already have the first column on the left side if you want the second column on the right side of the box to the left side under the first column then just add the it like following:
<div id="col1">
First column content
<div id="col1>
Second column content
</div>
</div>
<div id="col2"></div>
Link to the html file with css