I am using Bootstrap CSS. How can I make this styling using CSS:
I have used this content. this is the result i m getting
html
<div class="container">
<img class="post-thumb" src="https://image.ibb.co/gmbNQT/matthew.png" alt="matthew">
<ul>
<li>
<a href="https://github.com/ankul007" target="_blank">
<i class="fa fa-github-square" style="font-size:48px;color:purple"></i>
</a>
</li>
.
.
</ul>
<p class="post-content" >...........</p>
</div>
using this css
.post-thumb {
float: left;
border-radius: 50%;
display: inline-block;
height: 300px;
widows: 300px;
}
li {
list-style-type: none;
display: inline-block;
margin-right: 30px;
padding-top: 4px;
text-align: center;
}
.post-content {
margin-left: 350px;
text-align: justify;
}
Put both the icons and the image in a single parent and float them left:
.post-thumb {
float: left;
}
.post-thumb img {
border-radius: 50%;
display: inline-block;
height: 300px;
widows: 300px;
}
.post-thumb li {
list-style-type: none;
display: inline-block;
margin-right: 30px;
padding-top: 4px;
text-align: center;
font-size: 48px;
}
.post-content {
margin-left: 350px;
text-align: justify;
}
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<div class="container">
<figure class="post-thumb">
<img src="https://image.ibb.co/gmbNQT/matthew.png" alt="matthew">
<ul>
<li>
<a href="https://github.com/ankul007" target="_blank">
<i class="fa fa-github-square"></i>
</a>
</li>
<li>
<a href="https://github.com/ankul007" target="_blank">
<i class="fa fa-facebook-square"></i>
</a>
</li>
<li>
<a href="https://github.com/ankul007" target="_blank">
<i class="fa fa-twitter-square"></i>
</a>
</li>
</ul>
</figure>
<p class="post-content">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto culpa eaque a laboriosam mollitia nulla tempora ab in autem doloremque praesentium, facilis, assumenda incidunt earum delectus. Sequi suscipit ad voluptates.</p>
</div>
Preview
Related
I'm having some issues with item alignment in IE and Safari and I'm not that good on cross-browser compatibility so would appreciate it if someone could suggest what I'm doing wrong with the following or what may be a good general fix.
Codepen: http://codepen.io/nickwcook/pen/vxjavM?editors=0110.
EDIT: Home image alignment sorted, but still having issues with the following:
The text in the About section of the page is fine in other browsers, but in IE its not taking into account the horizontal padding (30px) of the parent, and is actually overflowing past the sides of the viewport.
HTML:
<body ng-app="portfolioApp" data-spy="scroll" data-target="#navbar">
<div id="borderTop"></div>
<div id="borderRight"></div>
<div id="borderBottom"></div>
<div id="borderLeft"></div>
<div id="logo">
<img src="img/logo-basic-dark.png" alt="Logo">
</div>
<div class="container-fluid">
<nav class="navbar navbar-default navbar-fixed-top">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="navbar">
<ul class="nav navbar-nav pull-right">
<li class="navLink">Home</li>
<li class="navLink">About</li>
<li class="navLink">Work</li>
<li class="navLink">Contact</li>
</ul>
</div>
</nav>
</div>
<main>
<section id="home">
<div class="sectionContent">
<div id="homeText">
<h1 id="homePrimary">Home Text Primary</h1>
<h2 id="homeSecondary">Home Text Secondary</h2>
</div>
<div id="homeImageContainer">
<div id="homeImage" class="blend-red-blue">
<div id="homeImageMask"></div>
</div>
</div>
</div>
</section>
<section id="about" ng-controller="skillsController">
<div class="sectionContent">
<div class="row">
<div class="col-xs-12 col-md-8 col-md-push-2">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<div id="skillsList">
<p>My skills include:</p>
<p ng-repeat="skill in skills" class="skillItem">{{skill.name}}</p>
</div>
</div>
</div>
</div>
</section>
<section id="work" ng-controller="projectsController">
<div class="sectionContent">
<div class="row">
<div class="project col-xs-12 col-md-6 col-lg-3">
<div>
<h2>Project One</h2>
<h4>Project Description</h4>
<a ng-href="#" target="blank_">View Project</a>
</div>
</div>
<div class="project col-xs-12 col-md-6 col-lg-3">
<div>
<h2>Project One</h2>
<h4>Project Description</h4>
<a ng-href="#" target="blank_">View Project</a>
</div>
</div>
<div class="project col-xs-12 col-md-6 col-lg-3">
<div>
<h2>Project One</h2>
<h4>Project Description</h4>
<a ng-href="#" target="blank_">View Project</a>
</div>
</div>
<div class="project col-xs-12 col-md-6 col-lg-3">
<div>
<h2>Project One</h2>
<h4>Project Description</h4>
<a ng-href="#" target="blank_">View Project</a>
</div>
</div>
</div>
</div>
</section>
<section id="contact">
<div class="sectionContent">
</div>
</section>
</main>
</body>
CSS:
/* GENERAL LAYOUT */
html, body
{
padding: 0;
margin: 0;
background-color: #fefefe;
overflow-x: hidden;
}
/* SECTIONS */
section
{
display: block;
margin: 0;
background: transparent;
z-index: 90;
}
.sectionContent
{
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
padding: 100px 30px;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
}
/* HOME SECTION */
#home #homeImageContainer
{
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
}
#home #homeImage
{
position: absolute;
height: 30vw;
width: 30vw;
background-image: url('../img/laptop-hands.png');
background-position: center center;
background-size: cover;
z-index: 90;
-webkit-box-shadow: 3px 3px 100px 4px rgba(153,153,153,1);
-moz-box-shadow: 3px 3px 100px 4px rgba(153,153,153,1);
box-shadow: 3px 3px 100px 4px rgba(153,153,153,1);
}
#home #homeImage > #homeImageMask
{
height: 100%;
width: 100%;
background-color: rgba(84, 17, 200, 0.6);
z-index: 91;
}
#home #homeText
{
z-index: 95;
}
#homeText h1#homePrimary,
#homeText h2#homeSecondary
{
color: #000;
text-align: center;
}
#homeText h1#homePrimary
{
font-size: 30px;
font-weight: 600;
margin-bottom: 10px;
}
#homeText h2#homeSecondary
{
font-family: 'Open Sans', sans-serif;
font-size: 16px;
font-weight: 600;
}
/* ABOUT SECTION */
#about p
{
line-height: 26px;
text-align: center;
}
#about #skillsList
{
width: 100%;
text-align: center;
margin-top: 50px;
}
#about #skillsList p:first-of-type
{
margin-bottom: 10px;
}
#about #skillsList p.skillItem
{
display: inline;
margin: 0 15px;
}
what about simplifying like this:
body, h1, h2 {
margin: 0;
}
.box-content {
width: 30vw;
height: 30vw;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
padding: 100px 30px;
box-sizing: border-box;
background: rgba(84, 17, 200, 0.6);
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: auto;
box-shadow: 3px 3px 100px 4px rgba(153, 153, 153, 1);
text-align: center;
}
<div class="sectionContent">
<div id="homeText" class="box-content">
<h1 id="homePrimary">Home Text Primary</h1>
<h2 id="homeSecondary">Home Text Secondary</h2>
</div>
</div>
You can remove absolute css property from selector '#home #homeImage' issue is fixed at my end
I would like the overlay content to come from bottom of the image when hovered, but for some reason it's always visible, am I missing something with positioning? Here's the pen: http://codepen.io/anon/pen/PbjVgy
* {
background-color: grey;
color: white;
}
.about__images {
max-width: 800px;
margin: 0 auto;
}
.about__inner {
margin-top: 60px;
}
.about__inner img {
max-width: 100%;
margin-right: 20px;
}
/**/
.about .about__inner {
position: relative;
}
.about .about__inner .about__inner--overlay {
position: absolute;
top: 100%;
left: 15px;
text-align: center;
background: rgba(0, 0, 0, 0.8);
width: 89%;
height: 100%;
transition: all 0.1s ease-in;
}
p {
margin-top: 60px;
}
.about .about__inner:hover .about__inner--overlay {
top: 0;
}
<section class="about">
<h5 class="small__title">Lorem ipsum</h5>
<p class="description">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Beatae commodi nisi aut animi, excepturi impedit dicta natus culpa. Veniam atque sapiente assumenda fugiat tempore ipsam eos quae</p>
<div class="container">
<div class="about__images">
<div class="row">
<div class="about__inner col-md-4">
<img src="https://placeholdit.imgix.net/~text?txtsize=37&txt=390%C3%97259&w=390&h=259" alt="">
<div class="about__inner--overlay">
<p>overlay content</p>
</div>
</div>
<div class="about__inner col-md-4">
<img src="https://placeholdit.imgix.net/~text?txtsize=37&txt=390%C3%97259&w=390&h=259" alt="">
<div class="about__inner--overlay">
<i class="fa fa-user" aria-hidden="true"></i>
<p>overlay content</p>
</div>
</div>
<div class="about__inner col-md-4">
<img src="https://placeholdit.imgix.net/~text?txtsize=37&txt=390%C3%97259&w=390&h=259" alt="">
<div class="about__inner--overlay">
<i class="fa fa-user" aria-hidden="true"></i>
<p>overlay content</p>
</div>
</div>
</div>
</div>
</div>
</section>
Add overflow: hidden to .about__inner
.about__inner {
margin-top: 60px;
overflow: hidden;
}
http://codepen.io/anon/pen/ENXMxW
I have the fa-circle-thin in which i want to place a glyphicon, so that it looks like there is a round border around my glyphicon. I just want to know if this is even possible?
I've tried following:
<div class="col-md-4">
<span class="circle">
<i class="glyphicon glyphicon-star"></i>
</span>
<h4 class="service-heading">Lorem</h4>
<p class="text-muted">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minima maxime quam architecto quo inventore harum ex magni, dicta impedit.</p>
</div>
However the two icons shows up side by side. I made a class for my FA that looks like this:
.circle:before {
font-family: fontawesome-webfont;
text-decoration: none;
content: "\f1db";
background-color: transparent;
z-index:-1;
}
I'd just use border-radius: 50% instead of trying to position two glyphs (plus you can style the border!). I'm also centering things with text-align: center and by matching the line-height and height values:
.circle {
border: 1px solid black;
border-radius: 50%;
padding: 3px;
width: 25px;
height: 25px;
display: inline-block;
text-align: center;
line-height: 25px;
}
.alt {
border-width: 2px;
border-color: red;
color: red;
width: 15px;
height: 15px;
line-height: 15px;
}
<div class="circle">
🌟
</div>
<div class="circle alt">
🌟
</div>
How about using posiiton:absolute?
.glyphicon{
position: absolute;
top: 3px;
left: 15px;
}
Result: jsfiddle
In my classes .fam-col-right and .fam-col-left I am using display: table-cell; vertical-align: middle; float: none; in my css to vertically center the content I have as seen below. The .row is set to display: table;.
The problem I'm having is my columns aren't stacking at all and I'm not sure why. Here is what it looks like instead of it stacking.
How can I have my content stack and stay vertically aligned to the middle?
Here is my code:
<!-- Families -->
<div id="families">
<div class="container-fluid">
<div class="row text-center center-row">
<div class="col-md-6 col-md-push-6 fam-col-left">
<h2>Families & Individuals</h2>
<br>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus earum dolorum sapiente quod, voluptas optio, ducimus nemo rerum commodi porro laudantium nam. Veritatis ex enim culpa voluptatem, corporis? Distinctio, obcaecati.</p>
</div>
<div class="col-md-6 col-md-pull-6 fam-col-right">
<ul class="list-unstyled">
<li><i class="fa fa-map-o fa-fw fa-1x"></i> Wealth Management</li>
<li><i class="fa fa-pie-chart fa-fw fa-1x"></i> Asset Allocation</li>
<li><i class="fa fa-anchor fa-fw fa-1x"></i> Insurance Risk Assessments</li>
<li><i class="fa fa-graduation-cap fa-fw fa-1x"></i> Education Funds Planning</li>
<li><i class="fa fa-calendar-check-o fa-fw fa-1x"></i> Retirement Planning</li>
<li><i class="fa fa-area-chart fa-fw fa-1x"></i> Investments</li>
</ul>
</div>
</div> <!-- end row -->
</div> <!-- end container-fluid -->
</div> <!-- end families -->
.center-row {
display: table;
}
#families {
margin-bottom: -30px;
}
.fam-col-left {
background: url('../img/space.jpg');
background-position: 50% 50%;
background-repeat: no-repeat;
background-size: cover;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
height: 550px;
color: #FCFFF5; /*white*/
display: table-cell;
vertical-align: middle;
float: none;
}
.fam-col-left p {
width: 50%;
margin: 0 auto;
}
.fam-col-right {
display: table-cell;
vertical-align: middle;
float: none;
}
.fam-col-right li {
padding-bottom: 20px;
}
looking for something like this? - https://jsfiddle.net/9s1e9tm0/
.center-row {
display: table;
}
#families {
margin-bottom: -30px;
}
.fam-col-left {
background: url('http://www.unoosa.org/res/timeline/index_html/space-2.jpg');
background-position: 50% 50%;
background-repeat: no-repeat;
background-size: cover;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
height: 550px;
color: #FCFFF5; /*white*/
display: table-cell;
vertical-align: middle;
float: none;
width:50%;
}
.fam-col-left p {
width: 50%;
margin: 0 auto;
}
.fam-col-right {
display: table-cell;
vertical-align: middle;
float: none;
width:50%;
}
.fam-col-right li {
padding-bottom: 20px;
}
So I'm a self learner on this accordion menu from this site. My objective is to make the background image to be at the center of content area of slide-1. However, I'm unable to achieve this as the image does not centered on the content div. My current background image size 640x480 pixel. Appreciate any help on what went wrong
here is my html
<div id='h-accordion'>
<ul id='slides'>
<li class='slide open active' id='slide-1'>
<div class='text-box'>
<div class='slidebutton'>
<h3>Sign In</h3>
</div>
<div class='content'>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
</div>
</li>
<li class='slide open' id='slide-2'>
<div class='text-box'>
<div class='slidebutton'>
<h3>Reset Password</h3>
</div>
<div class='content'>
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
</div>
</li>
<li class='slide open' id='slide-3'>
<div class='text-box'>
<div class='slidebutton'>
<h3>Register</h3>
</div>
<div class='content'>
<p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</p>
</div>
</div>
</li>
<li class='slide open' id='slide-4'>
<div class='text-box'>
<div class='slidebutton'>
<h3>Useful Links</h3>
</div>
<div class='content'>
<div id='extlist'>
<ol class='liststyle'>
<li><a href='#' target='_blank'>Sub-Menu-1</a></li>
<li><a href='#' target='_blank'>Sub-Menu-2</a></li>
<li><a href='#' target='_blank'>Sub-Menu-3</a></li>
<li><a href='#' target='_blank'>Sub-Menu-3</a></li>
<li><a href='#' target='_blank'>Sub-Menu-4</a></li>
</ol>
</div>
</div>
</div>
</li>
</ul>
</div>
my css
#wrapper {
width: 100%;
margin: 0 auto;
}
#content {
width: 90%;
margin: 0 auto;
}
#extlist {
margin-left: 10px;
margin-top: 10px;
}
ul li {
list-style: none;
}
#h-accordion {
position: relative;
width: 900px;
height: 450px;
margin: 30px auto;
}
ul#slides {
list-style: none;
width: 900px;
overflow: hidden;
position: absolute;
height: 450px;
}
.text-box {
width:900px;
height:450px;
}
.slidebutton {
width:50px;
float:left;
height:450px;
background: #3399FF;
}
.content {
width:660px;
float:left;
padding-left:10px;
height:450px;
}
#slide-1 {
position: absolute;
top: 0;
left: 165px;
z-index: 4;
background: #FFFFFF url('images/login.jpg') no-repeat center center;
}
#slide-2 { position: absolute;
top: 0;
left: 110px;
z-index: 3;
background-color: #FFFFFF;
}
#slide-3 { position: absolute;
top: 0;
left: 55px;
z-index: 2;
background-color: #FFFFFF;
}
#slide-4 { position: absolute;
top: 0;
left: 0px;
z-index: 1;
margin-top:auto;
margin-bottom:auto;
background-color: #FFFFFF;
}
.slidebutton h3 {
transform: rotate(-90deg);
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
position:relative;
top: 50px;
left: -15px;
display:inline-block;
color:#fff;
text-transform:capitalize;
width: 150px;
height: 100px;
}
and the associated jQuery
$(document).ready(function() {
// Main Accordion
$('.slide')
.bind('open', function(){
if(! $(this).hasClass('open')){
$(this).next().trigger('open');
$(this).addClass('open');
$(this).animate({left: "-=680px"});
}
else{
$(this).prev().trigger('close');
}
$(this).siblings().removeClass('active');
$(this).addClass('active');
})
.bind('close', function(){
if($(this).hasClass('open')){
$(this).removeClass('open');
$(this).animate({left: "+=680px"});
$(this).prev().trigger('close');
}
});
$('.slidebutton')
.click(function(){
$(this).parent().trigger('open');
$('#content-' + $(this).parent().attr('id')).trigger('show');
});
});
edit to include link to JSFiddle
Try this... Add an image tag for each slide like so:
.cover {
width:100%;
height: 100%;
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
z-index:1;
}
<img src="bg-image.jpg" class="cover">
This solution is great for all modern browsers (e.g. IE7+, Chrome, FF, Safari)