htmlcssionicons

How can I get the ticks to go to the left of the short line of text (see screenshot) HTML & CSS


Screenshot of ticks
Hi,
As you can see from my screenshot, I am trying to get the blue ticks (which are a font style) to go to the left of the text instead of above the text like in the screenshot.
Here is my code, ignoring the fact I have ionicons v2 font also (https://ionicons.com/v2/) :)
I've not written many posts, so feel free to ask for more info.
Thanks All!

.section-monthly-donations {
	background-color: #434343;
}

.plan-box {
	background-color: #696969;
	border-radius: 5px;
	width: 90%;
	margin-left: 5%;
}

.plan-box div {
	padding: 15px;
	border-bottom: 1px solid #424242;
}

.plan-box div:last-child {
	text-align: center;
}

.plan-price {
	font-size: 190%;
	margin-bottom: 10px;
	font-weight: 200;
	color: #00BFFE;
}

.plan-price span {
	font-size: 70%;
	font-weight: 300;
}

.plan-box ul {
	list-style: none;
}

.plan-box ul li {
	font-size: 70%;
	padding: 5px 0;
}


.row {
    zoom: 1; /* For IE 6/7 (trigger hasLayout) */
}

.row:before,
.row:after {
    content:"";
    display:table;
}
.row:after {
    clear:both;
}

/*  GRID COLUMN SETUP   ==================================================================== */

.col {
	display: block;
	float:left;
	margin: 1% 0 1% 1.6%;
}

.col:first-child { margin-left: 0; } /* all browsers except IE6 and lower */


/*  REMOVE MARGINS AS ALL GO FULL WIDTH AT 480 PIXELS */

@media only screen and (max-width: 480px) {
	.col { 
		/*margin: 1% 0 1% 0%;*/
        margin: 0;
	}
}

/*  GRID OF THREE   ============================================================================= */

	
.span-3-of-3 {
	width: 100%; 
}

.span-2-of-3 {
	width: 66.13%; 
}

.span-1-of-3 {
	width: 32.26%; 
}
<section class="section-monthly-donations">
			<div class="row">
				<h2>Pledge a monthly donation</h2>
			</div>
			<div class="row">
				<div class="col span-1-of-3">
					<div class="plan-box">
						<div>
							<h3>Gold</h3>
							<p class="plan-price">£200+ <span>per month</span></p>
						</div>
						<div>
							<ul>
								<li><i class="ion-checkmark-round icon-small"></i>Executive letter signed by the team</li>
								<li><i class="ion-checkmark-round icon-small"></i>Exclusive access to ...</li>
								<li><i class="ion-checkmark-round icon-small"></i>Exclusive ...</li>
								<li><i class="ion-checkmark-round icon-small"></i>Sed consequat, leo eget bibendum</li>
							</ul>
						</div>
						<div>
							<a href="#" class="btn btn-full-light">Pledge now</a>
						</div>
					</div>
				</div>
      </div>
<section>


Solution

  • There are 2 ways to do icons like this in list items.

    1. You can add display: inline to the <i> element in the <li> which will make it a part of the list item. Then you can add margin to it if you want to push the content a bit away from the icon.
    2. The other way if you don't like the text wrapping with the icon is to make it position: absolute and then position the icon inside of a <li> that uses position: relative and padding to give extra space on the left for the icon.

    Snippets below to illustrate both:

    .section-monthly-donations {
    	background-color: #434343;
    }
    
    .plan-box {
    	background-color: #696969;
    	border-radius: 5px;
    	width: 90%;
    	margin-left: 5%;
    }
    
    .plan-box div {
    	padding: 15px;
    	border-bottom: 1px solid #424242;
    }
    
    .plan-box div:last-child {
    	text-align: center;
    }
    
    .plan-price {
    	font-size: 190%;
    	margin-bottom: 10px;
    	font-weight: 200;
    	color: #00BFFE;
    }
    
    .plan-price span {
    	font-size: 70%;
    	font-weight: 300;
    }
    
    .plan-box ul {
    	list-style: none;
    }
    
    .plan-box ul li {
    	font-size: 70%;
    	padding: 5px 0;
    }
    
    /* New CSS */
    .plan-box ul li i {
      display: inline;
      margin-right: 5px;
    }
    /* End new CSS */
    
    
    .row {
        zoom: 1; /* For IE 6/7 (trigger hasLayout) */
    }
    
    .row:before,
    .row:after {
        content:"";
        display:table;
    }
    .row:after {
        clear:both;
    }
    
    /*  GRID COLUMN SETUP   ==================================================================== */
    
    .col {
    	display: block;
    	float:left;
    	margin: 1% 0 1% 1.6%;
    }
    
    .col:first-child { margin-left: 0; } /* all browsers except IE6 and lower */
    
    
    /*  REMOVE MARGINS AS ALL GO FULL WIDTH AT 480 PIXELS */
    
    @media only screen and (max-width: 480px) {
    	.col { 
    		/*margin: 1% 0 1% 0%;*/
            margin: 0;
    	}
    }
    
    /*  GRID OF THREE   ============================================================================= */
    
    	
    .span-3-of-3 {
    	width: 100%; 
    }
    
    .span-2-of-3 {
    	width: 66.13%; 
    }
    
    .span-1-of-3 {
    	width: 32.26%; 
    }
    <link href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet"/>
    <section class="section-monthly-donations">
    			<div class="row">
    				<h2>Pledge a monthly donation</h2>
    			</div>
    			<div class="row">
    				<div class="col span-1-of-3">
    					<div class="plan-box">
    						<div>
    							<h3>Gold</h3>
    							<p class="plan-price">£200+ <span>per month</span></p>
    						</div>
    						<div>
    							<ul>
    								<li><i class="ion-checkmark-round icon-small"></i>Executive letter signed by the team</li>
    								<li><i class="ion-checkmark-round icon-small"></i>Exclusive access to ...</li>
    								<li><i class="ion-checkmark-round icon-small"></i>Exclusive ...</li>
    								<li><i class="ion-checkmark-round icon-small"></i>Sed consequat, leo eget bibendum</li>
    							</ul>
    						</div>
    						<div>
    							<a href="#" class="btn btn-full-light">Pledge now</a>
    						</div>
    					</div>
    				</div>
          </div>
    <section>

    .section-monthly-donations {
    	background-color: #434343;
    }
    
    .plan-box {
    	background-color: #696969;
    	border-radius: 5px;
    	width: 90%;
    	margin-left: 5%;
    }
    
    .plan-box div {
    	padding: 15px;
    	border-bottom: 1px solid #424242;
    }
    
    .plan-box div:last-child {
    	text-align: center;
    }
    
    .plan-price {
    	font-size: 190%;
    	margin-bottom: 10px;
    	font-weight: 200;
    	color: #00BFFE;
    }
    
    .plan-price span {
    	font-size: 70%;
    	font-weight: 300;
    }
    
    .plan-box ul {
    	list-style: none;
    }
    
    /* Adjusted CSS */
    .plan-box ul li {
      position: relative;
    	font-size: 70%;
    	padding: 5px 0 5px 15px;
    }
    /* End adjusted CSS */
    
    /* New CSS */
    .plan-box ul li i {
      position: absolute;
      left: 0;
    }
    /* End new CSS */
    
    
    .row {
        zoom: 1; /* For IE 6/7 (trigger hasLayout) */
    }
    
    .row:before,
    .row:after {
        content:"";
        display:table;
    }
    .row:after {
        clear:both;
    }
    
    /*  GRID COLUMN SETUP   ==================================================================== */
    
    .col {
    	display: block;
    	float:left;
    	margin: 1% 0 1% 1.6%;
    }
    
    .col:first-child { margin-left: 0; } /* all browsers except IE6 and lower */
    
    
    /*  REMOVE MARGINS AS ALL GO FULL WIDTH AT 480 PIXELS */
    
    @media only screen and (max-width: 480px) {
    	.col { 
    		/*margin: 1% 0 1% 0%;*/
            margin: 0;
    	}
    }
    
    /*  GRID OF THREE   ============================================================================= */
    
    	
    .span-3-of-3 {
    	width: 100%; 
    }
    
    .span-2-of-3 {
    	width: 66.13%; 
    }
    
    .span-1-of-3 {
    	width: 32.26%; 
    }
    <link href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet"/>
    <section class="section-monthly-donations">
    			<div class="row">
    				<h2>Pledge a monthly donation</h2>
    			</div>
    			<div class="row">
    				<div class="col span-1-of-3">
    					<div class="plan-box">
    						<div>
    							<h3>Gold</h3>
    							<p class="plan-price">£200+ <span>per month</span></p>
    						</div>
    						<div>
    							<ul>
    								<li><i class="ion-checkmark-round icon-small"></i>Executive letter signed by the team</li>
    								<li><i class="ion-checkmark-round icon-small"></i>Exclusive access to ...</li>
    								<li><i class="ion-checkmark-round icon-small"></i>Exclusive ...</li>
    								<li><i class="ion-checkmark-round icon-small"></i>Sed consequat, leo eget bibendum</li>
    							</ul>
    						</div>
    						<div>
    							<a href="#" class="btn btn-full-light">Pledge now</a>
    						</div>
    					</div>
    				</div>
          </div>
    <section>