I have some social icons on my wordpress theme I am working on, and I am trying to add the ability to select which icons to use. The problem is that when I remove icons, it automatically will mess up the alignment, because I use an offset on the first icon, and an extra class on another. Now I figured out a way around this(although not working as of yet), but after working on it I realized it is a little rediculous for me to mask bad css with a gigantic PHP function to help me work with the the problematic css. This approach can be seen here: https://wordpress.stackexchange.com/questions/126611/cannot-seem-to-get-a-value-or-key-from-array
So I am wondering if anyone could help me fix my social icons so that if I remove them it will not move their alignment from the center. So it always looks centered and even. Here is a JS fiddle of the icons: http://jsfiddle.net/g2SC4/
Here is a look at the HTML. In total there is 6 icons:
<!-- start: social icon -->
<div id="social-icons">
<div class="section-wrapper section-icon social-icon">
<div class="container">
<div class="row">
<div class="social-icon-phone clear-phone">
<div class="span1 offset3">
<div class="flip-container">
<div class="flipper">
<div class="front">
<div class="flip-a">
<i class="icon-facebook icon-2x"></i>
</div>
</div>
<div class="back">
<div class="flip-b facebook">
<span class="icon-back"><i class="icon-facebook icon-2x"></i></span>
</div>
</div>
</div>
</div>
</div>
<div class="span1">
<div class="flip-container">
<div class="flipper">
<div class="front ">
<div class="flip-a">
<i class="icon-twitter icon-2x"></i>
</div>
</div>
<div class="back">
<div class="flip-b twitter">
<span class="icon-back"><i class="icon-twitter icon-2x"></i></span>
</div>
</div>
</div>
</div>
</div>
<div class="span1">
<div class="flip-container">
<div class="flipper">
<div class="front ">
<div class="flip-a">
<i class="icon-google-plus icon-2x"></i>
</div>
</div>
<div class="back">
<div class="flip-b google">
<span class="icon-back"><i class="icon-google-plus icon-2x"></i></span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="social-icon-phone clear-phone">
<div class="span1">
<div class="flip-container">
<div class="flipper">
<div class="front ">
<div class="flip-a">
<i class="icon-github icon-2x"></i>
</div>
</div>
<div class="back">
<div class="flip-b github">
<span class="icon-back"><i class="icon-github icon-2x"></i></span>
</div>
</div>
</div>
</div>
</div>
<div class="span1">
<div class="flip-container">
<div class="flipper">
<div class="front ">
<div class="flip-a">
<i class="icon-pinterest icon-2x"></i>
</div>
</div>
<div class="back">
<div class="flip-b pinterest">
<span class="icon-back"><i class="icon-pinterest icon-2x"></i></span>
</div>
</div>
</div>
</div>
</div>
<div class="span1">
<div class="flip-container">
<div class="flipper">
<div class="front ">
<div class="flip-a">
<i class="icon-linkedin icon-2x"></i>
</div>
</div>
<div class="back">
<div class="flip-b linkedin">
<span class="icon-back"><i class="icon-linkedin icon-2x"></i></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div><!-- end: social icon -->
</div>
Here is the solution.
Remove the class offset3 from the first icon(span) and the following CSS:
.social-icon-phone.clear-phone {
display: inline-block;
}
#social-icons .row {
text-align: center; // remove margin left -30px
}
Related
I'd like to know how to replace the position for the image from right side to left side and the text from right side to left side
my code is :-
<div class="section margin-top_50">
<div class="container">
<div class="row">
<div class="col-md-6 layout_padding_2">
<div class="full">
<div class="heading_main text_align_left">
<h2><span> TT </span> ERP </h2>
</div>
<div class="full">
<p> TEST </p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="full">
<img src="images/img2.png" alt="#" />
</div>
</div>
</div>
</div>
</div>
There you go. to change the text from right to left just use the class text-left and if you want it to the right use text-right do the same for the image container
<div class="section margin-top_50">
<div class="container">
<div class="row">
<div class="col-md-6 layout_padding_2">
<div class="full">
<!-- added class text-left -->
<div class="heading_main text_align_left text-left">
<h2><span> TT </span> ERP </h2>
</div>
<!-- added class text-left -->
<div class="full text-left">
<p> TEST </p>
</div>
</div>
</div>
<div class="col-md-6">
<!-- added class text-left -->
<div class="full text-left">
<img src="images/img2.png" alt="#" />
</div>
</div>
</div>
</div>
</div>
if you only want to show image in left side and text in right side then the image column should be there after the text column
<div class="section margin-top_50">
<div class="container">
<div class="row">
<div class="col-md-6">
<div class="full">
<img src="images/img2.png" alt="#" />
</div>
</div>
<div class="col-md-6 layout_padding_2">
<div class="full">
<div class="heading_main text_align_left">
<h2><span> TT </span> ERP </h2>
</div>
<div class="full">
<p> TEST </p>
</div>
</div>
</div>
</div>
</div>
</div>
Swapping the elements should be helpful.
<div class="section margin-top_50">
<div class="container">
<div class="row">
<!-- Was in 2nd previously -->
<div class="col-md-6">
<div class="full">
<img src="images/img2.png" alt="#" />
</div>
</div>
<!-- Was in 1st previously -->
<div class="col-md-6 layout_padding_2">
<div class="full">
<div class="heading_main text_align_left">
<h2><span> TT </span> ERP </h2>
</div>
<div class="full">
<p> TEST </p>
</div>
</div>
</div>
</div>
</div>
</div>
I have some pricing boxes on this page:
https://www.shiftdivorceguide.com/pricing-plan/
Following code hides the last box:
.price-view-default:last-child {display:none;}
And following code is my assumption for hiding the second to last box:
.price-view-default:nth-child(4) {display:none;}
However, above code does not work. Does anyone know how to hide box using CSS?
.price-view-default:last-child {display:none;}
.price-view-default:nth-child(4) {display:none;}
<div class="page-inner-container lp_hide_general_plans " id="select_style" data-style="vertical_view_1"> <div class="col-md-4 price-view-default 685 ">
<div class="lp-price-main lp-border-radius-8 lp-border text-center">
<div class="lp-title" style="background-color: #2caae0;">
<div class="lp-plane-top-wrape">
<a>Monthly Listing</a>
<p>$39</p>
<span class="package-type">Per Listing</span><br><br>
</div>
</div>
<!--Bottom plan section -->
</div>
</div> <div class="col-md-4 price-view-default 687 featured-plan ">
<div class="lp-price-main lp-border-radius-8 lp-border text-center">
<div class="lp-title" style="background-color: #963693;">
<div class="lp-plane-top-wrape">
<a>Quarterly Listing</a>
<p>$99</p>
<span class="package-type">Per Listing</span><br><br>
</div>
</div>
<!--Bottom plan section -->
</div>
</div> <div class="col-md-4 price-view-default 686 ">
<div class="lp-price-main lp-border-radius-8 lp-border text-center">
<div class="lp-title" style="background-color: #58ee9e;">
<div class="lp-plane-top-wrape">
<a>Yearly Listing</a>
<p>$329</p>
<span class="package-type">Per Listing</span><br><br>
</div>
</div>
<!--Bottom plan section -->
</div>
</div> <div class="col-md-4 price-view-default 1765 ">
<div class="lp-price-main lp-border-radius-8 lp-border text-center">
<div class="lp-title" style="background-color: #ff8000;">
<div class="lp-plane-top-wrape">
<a>TEST Listing</a>
<p>$1</p>
<span class="package-type">Per Listing</span><br><br>
</div>
</div>
<!--Bottom plan section -->
</div>
</div> <div class="col-md-4 price-view-default 119 ">
<div class="lp-price-main lp-border-radius-8 lp-border text-center">
<div class="lp-title" style="background-color: #58ee9e;">
<div class="lp-plane-top-wrape">
<a>Basic Legacy Listing<br>Limited Time Only!</a>
<p>Free</p>
<span class="package-type">Per Listing</span><br><br>
</div>
</div>
<!--Bottom plan section -->
</div>
</div>
</div>
You are looking for the :nth-last-child selector. Which is the same as :nth-child, but counting backwards instead.
https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-last-child
.price-view-default:nth-last-child(2)
I'm struggling with a rather simple task but the lack of CSS experience is getting the better of me:
<div class="row">
<div class="col-lg-3">
<div class="ibox-content m-b-sm border-bottom">
<div class="ibox-title">
<span class="label label-info pull-right">Offline</span>
<h5>Equipment Pass</h5>
</div>
<div class="ibox-content">
<h1 class="no-margins">#Model.AirportPassEquipmentOffline.TransactionCount</h1>
<small># of Transactions</small>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="ibox-content m-b-sm border-bottom">
<div class="ibox-title">
<span class="label label-success pull-right">Online</span>
<h5>Equipment Pass</h5>
</div>
<div class="ibox-content">
<h1 class="no-margins">#Model.AirportPassEquipmentOnline.TransactionCount</h1>
<small># of Transactions</small>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="ibox-content m-b-sm border-bottom">
<div class="ibox-title">
<span class="label label-info pull-right">Offline</span>
<h5>Visitor Pass</h5>
</div>
<div class="ibox-content">
<h1 class="no-margins">#Model.AirportPassVisitorOffline.TransactionCount</h1>
<small># of Transactions</small>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="ibox-content m-b-sm border-bottom">
<div class="ibox-title">
<span class="label label-success pull-right">Online</span>
<h5>Visitor Pass</h5>
</div>
<div class="ibox-content">
<h1 class="no-margins">#Model.AirportPassVisitorOnline.TransactionCount</h1>
<small># of Transactions</small>
</div>
</div>
</div>
</div>
Above is a row on my view. There are many like it:
I want to split the smallest div to show a second Heading1. Here is base HTML:
<div class="ibox-content">
<h1 class="no-margins">#Model.AirportPassEquipmentOffline.TransactionCount</h1>
<small># of Transactions</small>
<h1 class="no-margins">#Model.AirportPassEquipmentOffline.Income</h1>
<small>Income generated</small>
</div>
Target:
I need to show more information and I see that the div card is empty on the right side. I want to split this div into two. Experimenting with bootstrap classes, the layout breaks.
Afer a bit of trial and error, i realized that the small grid class was the issue. I switched to class-md and got the desired result. So this:
<div class="ibox-content">
<h1 class="no-margins">#Model.AirportPassEquipmentOffline.TransactionCount</h1>
<small># of Transactions</small>
<h1 class="no-margins">#Model.AirportPassEquipmentOffline.Income</h1>
<small>Income generated</small>
</div>
Became this:
<div class="ibox-content">
<div class="row">
<div class="col-md-6">
<h1 class="no-margins">#Model.AirportPassEquipmentOnline.TransactionCount.ToString("N0")</h1>
<small># of Transactions</small>
</div>
<div class="col-md-6">
<h1 class="no-margins">AED #Model.AirportPassEquipmentOnline.Income.ToString("N2")</h1>
<small>Revenue generated</small>
</div>
</div>
</div>
I have three different divs that should be displaying one after the other, but they just jump right up to each other on the webpage. Here is the code for all of them:
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<div class="top-section">
<center>
<div class="container" style="margin-top:150px;">
<div class="row">
<div class="top-title">
<h1>Introducing 10/40 Academy.</h1>
<h3>An affordable entrepreneurship course that can double as high school credit.</h3>
<img src="/Man_iPhone_Desk.jpg" style="height:300px;margin:30px;border-radius:4px;" class="raised hidden-xs" /><br>
Watch Video <span class="glyphicon glyphicon-play-circle"></span>
<h3 class="hidden-sm hidden-xs" style="letter-spacing:2px;margin-top:0px;">SCROLL DOWN</h3>
<h1 class="hidden-sm hidden-xs" style="font-weight:100;font-size:30px;"><span class="glyphicon glyphicon-chevron-down"></span></h1>
</div>
</div>
</div>
</center>
</div>
<div class="begin-tour">
<div class="container">
<div class="row">
<div class="col-md-6" style="margin-top:50px;">
<h2>Interested in small business?</h2>
<h2>We're here to help.</h2>
<p>
Paragraph
</p>
</div>
<div class="col-md-6">
<center>
<img width="70%" src="/MacImageBase.png" />
</center>
</div>
</div>
</div>
</div>
<div class="qualif">
<div class="container">
<div class="row">
<div class="col-md-6">
<h2>Header here</h2>
<h2>Header</h2>
<p>
some text
</p>
</div>
<div class="col-md-6"></div>
</div>
</div>
</div>
The best way to explain what happens is through a photo.
I've added the 3 divs into the bootstrap container, took out center(it is not used anymore or supported by HTML5), put each div as a 12 column row(col-md-12 class) so they show up one after the other like you wanted:
<div class="container">
<div class="row">
<div class="top-section col-md-12">
<div class="container" style="margin-top:150px;">
<div class="row">
<div class="top-title">
<h1>Introducing 10/40 Academy.</h1>
<h3>An affordable entrepreneurship course that can double as high school credit.</h3>
<img src="/Man_iPhone_Desk.jpg" style="height:300px;margin:30px;border-radius:4px;" class="raised hidden-xs" /><br>
Watch Video <span class="glyphicon glyphicon-play-circle"></span>
<h3 class="hidden-sm hidden-xs" style="letter-spacing:2px;margin-top:0px;">SCROLL DOWN</h3>
<h1 class="hidden-sm hidden-xs" style="font-weight:100;font-size:30px;"><span class="glyphicon glyphicon-chevron-down"></span></h1>
</div>
</div>
</div>
</div>
<div class="begin-tour col-md-12">
<div class="container">
<div class="row">
<div class="col-md-6" style="margin-top:50px;">
<h2>Interested in small business?</h2>
<h2>We're here to help.</h2>
<p>
Paragraph
</p>
</div>
<div class="col-md-6">
<center>
<img width="70%" src="/MacImageBase.png" />
</center>
</div>
</div>
</div>
</div>
<div class="qualif col-md-12">
<div class="container">
<div class="row">
<div class="col-md-6">
<h2>Header here</h2>
<h2>Header</h2>
<p>some text</p>
</div>
<div class="col-md-6"></div>
</div>
</div>
</div>
</div>
</div>
Here is the plunker so you can see it.
Please let me know if this helps. I didn't see your image until now so I hope it helps.
I have this code for making a cards stackable box. The problem is that this box is showing me a right paddding in the fragment, can anyone help me?
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<link rel="stylesheet" href="./semantic/semantic.css"/>
<title>Agora</title>
</head>
<body>
<div class="ui teal inverted menu" style="border-radius: 0px;">
<div class="item">
<div class="huge ui buttons">
<div class="ui button">One</div>
<div class="ui button">Two</div>
<div class="ui button">Three</div>
</div>
</div>
<div class="item">
<div class="ui button">Log-in</div>
</div>
</div>
<div class="ui column centered grid">
<div class="fourteen wide column">
<div class="ui center aligned segment">
<div class="ui stackable four column centered grid" >
<div class="column">
<div class="ui card">
<div class="image">
<img src="http://semantic-ui.com/images/avatar/large/elliot.jpg">
</div>
<div class="content">
<a class="header">Stevie Feliciano</a>
<div class="meta">
<span class="date">Joined in 2014</span>
</div>
<div class="description">
Stevie Feliciano is a library scientist living in New York City. She likes to spend her time reading, running, and writing.
</div>
</div>
<div class="extra content">
<a>
<i class="user icon"></i>
22 Friends
</a>
</div>
</div>
</div>
<div class="column">
<div class="ui card">
<div class="image">
<img src="http://semantic-ui.com/images/avatar/large/elliot.jpg">
</div>
<div class="content">
<a class="header">Stevie Feliciano</a>
<div class="meta">
<span class="date">Joined in 2014</span>
</div>
<div class="description">
Stevie Feliciano is a library scientist living in New York City. She likes to spend her time reading, running, and writing.
</div>
</div>
<div class="extra content">
<a>
<i class="user icon"></i>
22 Friends
</a>
</div>
</div>
</div>
<div class="column">
<div class="ui card">
<div class="image">
<img src="http://semantic-ui.com/images/avatar/large/elliot.jpg">
</div>
<div class="content">
<a class="header">Stevie Feliciano</a>
<div class="meta">
<span class="date">Joined in 2014</span>
</div>
<div class="description">
Stevie Feliciano is a library scientist living in New York City. She likes to spend her time reading, running, and writing.
</div>
</div>
<div class="extra content">
<a>
<i class="user icon"></i>
22 Friends
</a>
</div>
</div>
</div>
<div class="column">
<div class="ui card">
<div class="image">
<img src="http://semantic-ui.com/images/avatar/large/elliot.jpg">
</div>
<div class="content">
<a class="header">Stevie Feliciano</a>
<div class="meta">
<span class="date">Joined in 2014</span>
</div>
<div class="description">
Stevie Feliciano is a library scientist living in New York City. She likes to spend her time reading, running, and writing.
</div>
</div>
<div class="extra content">
<a>
<i class="user icon"></i>
22 Friends
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
This is the problem image:
http://imgur.com/1lrpbUL.png
I need to remove the padding that's in the right side.
Here is the working example:
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui#2.4.2/dist/semantic.min.css">
<title>Agora</title>
<style type="text/css">
.ui.card {
margin: auto;
}
</style>
</head>
<body>
<div class="ui teal inverted menu" style="border-radius: 0px;">
<div class="item">
<div class="huge ui buttons">
<div class="ui button">One</div>
<div class="ui button">Two</div>
<div class="ui button">Three</div>
</div>
</div>
<div class="item">
<div class="ui button">Log-in</div>
</div>
</div>
<div class="ui column centered grid">
<div class="fourteen wide column">
<div class="ui center aligned segment">
<div class="ui stackable four column centered grid" >
<div class="column">
<div class="ui card">
<div class="image">
<img src="http://semantic-ui.com/images/avatar/large/elliot.jpg">
</div>
<div class="content">
<a class="header">Stevie Feliciano</a>
<div class="meta">
<span class="date">Joined in 2014</span>
</div>
<div class="description">
Stevie Feliciano is a library scientist living in New York City. She likes to spend her time reading, running, and writing.
</div>
</div>
<div class="extra content">
<a>
<i class="user icon"></i>
22 Friends
</a>
</div>
</div>
</div>
<div class="column">
<div class="ui card">
<div class="image">
<img src="http://semantic-ui.com/images/avatar/large/elliot.jpg">
</div>
<div class="content">
<a class="header">Stevie Feliciano</a>
<div class="meta">
<span class="date">Joined in 2014</span>
</div>
<div class="description">
Stevie Feliciano is a library scientist living in New York City. She likes to spend her time reading, running, and writing.
</div>
</div>
<div class="extra content">
<a>
<i class="user icon"></i>
22 Friends
</a>
</div>
</div>
</div>
<div class="column">
<div class="ui card">
<div class="image">
<img src="http://semantic-ui.com/images/avatar/large/elliot.jpg">
</div>
<div class="content">
<a class="header">Stevie Feliciano</a>
<div class="meta">
<span class="date">Joined in 2014</span>
</div>
<div class="description">
Stevie Feliciano is a library scientist living in New York City. She likes to spend her time reading, running, and writing.
</div>
</div>
<div class="extra content">
<a>
<i class="user icon"></i>
22 Friends
</a>
</div>
</div>
</div>
<div class="column">
<div class="ui card">
<div class="image">
<img src="http://semantic-ui.com/images/avatar/large/elliot.jpg">
</div>
<div class="content">
<a class="header">Stevie Feliciano</a>
<div class="meta">
<span class="date">Joined in 2014</span>
</div>
<div class="description">
Stevie Feliciano is a library scientist living in New York City. She likes to spend her time reading, running, and writing.
</div>
</div>
<div class="extra content">
<a>
<i class="user icon"></i>
22 Friends
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
It might be a problem that each of these cards do not fill the width of their column so they are aligned to the left.
You could use the class ".cards" which is mentioned here (it uses flexbox to fit the cards perfectly).
The code found in documentation:
<div class="ui cards">
<div class="card">
<a class="image">
<img src="/images/avatar/large/elliot.jpg">
</a>
<div class="content">
<a class="header">Elliot Fu</a>
<div class="meta">
<a>Friends</a>
</div>
<div class="description">
Elliot Fu is a film-maker from New York.
</div>
</div>
</div>
<div class="card">
<a class="image">
<img src="/images/avatar/large/helen.jpg">
</a>
<div class="content">
<a class="header">Helen Troy</a>
<div class="meta">
<a>Friends</a>
</div>
<div class="description">
Helen Troy is an archivist living in New York, who enjoys cooking, fine art, and gardening.
</div>
</div>
</div>
</div>